Coder Social home page Coder Social logo

amarinediary / vanilla-js-pages-transition-loader Goto Github PK

View Code? Open in Web Editor NEW
16.0 1.0 1.0 153 KB

A simple and minimalistic, VanillaJS, standalone, pages transition loader, minified in a 1.31 kilobytes, one-line of code.

Home Page: https://stackoverflow.com/a/65691657/3645650

License: Creative Commons Zero v1.0 Universal

loader page-loader page-loading loading-animations page-transitions transition page-fade page-animation javascript loading

vanilla-js-pages-transition-loader's Introduction

Vanilla JS Pages Transition Loader

A simple and minimalistic, VanillaJS, standalone, pages transition loader, minified in a 1.31 kilobytes, one-line of code.

Fundamentals

  • Generate a <script> element appended to the <head> element, containing any required styling.
  • Generate a <div> element, acting as overlay, prepended to the <body> element.
  • Generate a <svg> element, acting as loader, prepended to the previously generated <div> element.
  • On window.onload self generated elements are automatically removed.

Quick start

to enable it, place the following script near the end of your pages, right before the closing </body> tag.

<script type="application/javascript" src="../path/to/vanilla-js-pages-transition-loader.min.js"></script>

Settings

let settings = {
    backgroundColor: "#2774ab",
    filterBrightness: 2,
    strokeWidth: 10,
    timeOnScreen: 100
}, //...
Option Description
backgroundColor Refer to MDN Web Docs color for acceptable values. The background-color CSS property sets the background color of an element. Default to Wordpress deep blue accent #2774ab #2774ab
filterBrightness number or percentage. The brightness of the svg loader element (brightness() CSS function). A value under 100% darkens the loader, while a value over 100% brightens it. The lacuna value for interpolation is 1. Default to 2.
strokeWidth Positive integer. Loader stroke's width. The stroke-width attribute is a presentation attribute defining the width of the stroke to be applied to the shape. Default to 10.
timeOnScreen Positive integer. The time on screen is appended to the page loading time. Default to 100 milliseconds.

Watch it, Star it, Fork it !

We made your day? Give us a star!

vanilla-js-pages-transition-loader's People

Contributors

amarinediary avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

netplayer

vanilla-js-pages-transition-loader's Issues

How can I add some text along with loader?

Your page loader is too good and simple. How can I add some text along with loader animation. Basically I want to add my page title be displayed just above the loader animation.
Pl.help

NPM please!

Hi,
Could you please provide a npm in the future?
Thanks!
David

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.