@manz/pageload
v1.0.2
Published
Small and agnostic javascript library for easy & fast page loading spinner. Ready for ES Modules.
Downloads
4
Maintainers
Readme
PageLoad.js
Small vanilla javascript library 3.5KB (~1.4KB gzipped) for easy and simple page loading spinner. Ready for ES Modules. Agnostic. Zero dependencies.
Basic Usage
1. Vía NPM
npm install pageload
import PageLoad from "pageload";
PageLoad.start({ fakeMode: true });
2. Vía CDN
<script type="module">
import PageLoad from "//unpkg.com/pageload";
PageLoad.start({ fakeMode: true });
</script>
fakeMode
mode run a slow progress bar
Custom Usage
FadeIn until completed
import PageLoad from "//unpkg.com/pageload";
PageLoad.start({
autoIncrement: true,
color: "mediumpurple",
fadeIn: true
});
Progress bar on dark mode
import PageLoad from "//unpkg.com/pageload";
document.body.style.backgroundColor = "black";
PageLoad.start({
fakeMode: true,
backgroundColor: "#222",
color: "#c00",
spinBarColor: "#ccc",
enableProgress: true
});