1.0.13 • Published 1 year ago

eruda-pixel v1.0.13

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

eruda-pixel

Eruda plugin for UI.

A high-precision UI restoration aid that is dedicated to making front-end developers headaches and crashes. Designers check tools.

Demo

Browse it on your phone: https://eruda.liriliri.io/

Install

npm install eruda eruda-pixel -D
eruda.init();
eruda.add(erudaPixel);

CDN

const loadOneJS = (url, callback) => {
  const script = document.createElement('script');
  const fn = callback || (() => {});

  script.type = 'text/javascript';

  script.onload = () => {
    fn();
  };

  script.src = url;

  document.getElementsByTagName('head')[0].appendChild(script);
};
const loadJS = (urls, callback) => {
  let i = 0;
  const fn = callback || (() => {});

  urls.forEach((url) => {
    loadOneJS(url, () => {
      i = 1 + i;
      if (urls.length === i) {
        fn();
      }
    });
  });
};

loadJS(
  [
    '//cdn.bootcdn.net/ajax/libs/eruda/2.4.1/eruda.min.js',
    '//unpkg.com/eruda-pixel@1.0.13/eruda-pixel.js',
  ],
  () => {
    const eruda = window.eruda;
    if (typeof eruda !== 'undefined') {
      eruda.init();
      eruda.add(window.erudaPixel);
    }
  },
);

Make sure Eruda is loaded before this plugin, otherwise won't work.

1.0.11

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago