Skip to content

skrollr-colors is a plugin for skrollr which allow you to use mixed colors formats in skrollr's keyframes.

Notifications You must be signed in to change notification settings

jacobclarke92/skrollr-colors

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

skrollr-colors

Parses data- tags and converts different colors formats to HSLA to allow transitions in skrollr.
It will parse every color in data- attributes, even in CSS gradients.

How to use:

Include the plugin before skrollr.js and enjoy.

<script src="js/skroll-colors.min.js"></script>
<!-- skrollr.js code -->
</body>

Now you can use codes like:

<div 
    data-0="background-color: #000;"
    data-400="background-color: hsl(100,80%,90%);"
    data-top="background-color: rgba(255,255,255,1);"
>
    WHOOT
</div>

Example:

Demo on Codepen

Supported color formats

skrollr-colors detects even if there are spaces between values and commas and is case-insensitive.

Supported formats:

  • HEX 3 digits: #F0F
  • HEX 6 digits: #FF00FF
  • RGB: rgb(0,0,0)
  • RGBA: rgba(0,0,0,0.5)
  • HSL: hsl(0,0%,0%)

HSLA is not parsed at all, seen skrollr-colors aims to convert everything to HSLA.

ToDo

  • Nothing?

About

skrollr-colors is a plugin for skrollr which allow you to use mixed colors formats in skrollr's keyframes.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%