@kiyotd/is Browser Demo

Browser direct usage example (UMD format)

The following classes will be added to the body element based on scroll and device detection:

Check the body element classes in the developer tools while scrolling.

Usage

You can use it by loading the UMD file as follows:

<script src="dist/is.umd.min.js"></script>
<script>
  document.addEventListener('DOMContentLoaded', () => {
    // Use as direct global objects
    const isScrolled = new IsScrolled();
    isScrolled.init();

    const isDevice = new IsDevice();
    isDevice.init();
  });
</script>