Description:
Background Color Morph is a small (2kb minified) JavaScript library that applies a transition effect to background colors when scrolling down or up the webpage.
How to use it:
Import the JavaScript bg-color-morph.min.js and Stylesheet bg-color-morph.css into the document.
1 | <link href="dist/bg-color-morph.css" rel="stylesheet"> |
2 | <script src="dist/bg-color-morph.min.js"></script> |
Add the required CSS class bg-morph to the target container.
1 | <section class="bg-morph"> |
Set the start and end colors in hex.
1 | <section class="bg-morph" |
2 | data-start-color="#f7b733" |
3 | data-end-color="#fc4a1a"> |
Set the start/end trigger points.
1 | <section class="bg-morph" |
2 | data-start-color="#f7b733" |
3 | data-end-color="#fc4a1a" |
4 | data-start-trigger="top" |
5 | data-end-trigger="middle"> |
Demo: Link
Download: Github
Like this:
Like Loading...
JavaScript
tҺe website іѕ really good, I love your site!