Skip to content

Add a subtle fade-in/fade-out effect when accessing or navigating into a website.

License

Notifications You must be signed in to change notification settings

MarwanAlsoltany/dom-fader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DOM Fader

Add a subtle fade-in/fade-out effect when accessing or navigating into a website.

Inspired by Christopher Aue's article How To Fade Web Pages On Load And Unload (CSS + JS).

Installation

Just add the content of fader.htm directly after the body tag in your layout. This one-liner will add the necessary elements to your webpage, inject some CSS, and attach the events.

You can also use fader.min.js and link it directly after the body tag if you don't want to use a script tag with data-uri. Make sure that the script tag has the id fader-script.

Fading color can be customized using CSS Custom Properties. Simply overwrite --fader-color with the color you want, !important rule may be neccesary depending where you overwrite --fader-color in your stylesheet.

License

Licensed under the MIT License.
Copyright (c) 2020 Marwan Al-Soltany. All rights reserved.

About

Add a subtle fade-in/fade-out effect when accessing or navigating into a website.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published