Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

faded-header

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

faded-header

faded-header ============

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

faded-header

Change the color of an element based on how far the page has scrolled.

Intended to fade in a fixed header as a visitor scrolls down.

Will transform from any (or no) initial colors to any colors parseable by the excelent color library.

See index.html for usage example.

Arguments

fadedHeader(headerSelector, {
	// Default values below
	transformRange: window.innerHeight, // Page window.scrollY at which should be fully transformed
	backgroundColor: null, // Background color to transform to
	textColor: null, // Text color to transform to
	easingFunction: ratio => Math.pow(ratio, 2), // Easing function for the scrolled ratio. Number between 0 and 1 goes in and a number between 0 and 1 should come out
	backgroundEasingFunction: null, // Overrides easingFunction for background if set
	textEasingFunction: null // Overrides easing function for text if set
});

If neither backgroundColor nor textColor are passed, will just log and return without doing anything.

transformRange, backgroundColor, and textColor can be arrays.

FAQs

Package last updated on 06 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc