An open API service indexing awesome lists of open source software.

https://github.com/JosephSmith127/react-color-scroll

Blend through colors as you scroll down the page.
https://github.com/JosephSmith127/react-color-scroll

Last synced: 15 days ago
JSON representation

Blend through colors as you scroll down the page.

Awesome Lists containing this project

README

        

# React color scroll

> React color scroll is a simple component which allows you to blend between colors as you're scrolling down the page. You can use it to fill an entire page, or within a wrapped container. ✨

[![NPM Version][npm-image]][npm-url]

## Install

```bash
npm i -S react-color-scroll
```

## Usage

```jsx
import React from 'react'
import ColorScroll from 'react-color-scroll'

class HomePage extends React.PureComponent {
render () {
return (
console.log(e)} // Optional access to the onScroll event
>
{/* Your site content in here */}

)
}
}

export default HomePage
```

It works by splitting up the container's scroll height and calculating the correct time to blend between colors for each color to have an equal percentage of your content.

## License

[MIT](http://vjpr.mit-license.org)

[npm-image]: https://img.shields.io/npm/v/react-color-scroll.svg
[npm-url]: https://npmjs.org/package/react-color-scroll