GithubHelp home page GithubHelp logo

zachleat / speedlify-score Goto Github PK

View Code? Open in Web Editor NEW
43.0 3.0 3.0 40 KB

A web component that shows Lighthouse scores via Speedlify.

Home Page: https://www.speedlify.dev/

HTML 39.18% JavaScript 60.82%
speedlify web-components

speedlify-score's Introduction

speedlify-score Web Component

Demo

Usage

Installation

npm install speedlify-score

Include Sources

Include speedlify-score.js in your page (preferably concatenated in via a build script).

Use Markup

Use <speedlify-score> in your markup.

Required attributes:

  • speedlify-url: Required. The URL to your Speedlify instance.
  • hash: Preferred but technically optional. A hash representing the active URL.
  • url: Optional. Not used if hash is supplied. This is the raw URL of the page you’d like to see the score for. Defaults to the current page.

Examples

<!-- Preferred -->
<speedlify-score speedlify-url="https://www.speedlify.dev/" hash="bbfa43c1">
<!-- Slower method, but doesn’t require hash -->
<speedlify-score speedlify-url="https://www.speedlify.dev/" url="https://www.11ty.dev/">

Use Attributes to customize output

  • If no attributes are used, it score is implicit and default.
  • If some attributes are in play, you must explicitly add score.
  • requests
  • weight
  • rank
  • rank-change (difference between old and new rank)

Changelog

  • v1.0.0: First release
  • v2.0.0: Changes default render behavior (only shows Lighthouse scores by default, summary and weight are not). Adds feature to use attributes to customize output if you want to opt-in to more.
  • v3.0.0: Removes flex-wrap: wrap for top level component.
  • v4.0.0: Using Shadow DOM, removes need for external stylesheet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.