npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

animatedgradient-stoettw

v1.0.0

Published

The code uses the requestAnimationFrame function to implement the animation loop and changes the style properties of an element to create the gradient effect.

Downloads

2

Readme

Animated Gradient

This is a simple JavaScript example demonstrating how to create an infinite loop of gradient animation effect. The code uses the requestAnimationFrame function to implement the animation loop and changes the style properties of an element to create the gradient effect.

Usage

Ensure you have an HTML file with an element that has the ID "animated-element". Link the index.js file in your HTML file. Run your HTML file in a web browser.

How It Works

Upon loading the HTML file, the JavaScript code will wait for the DOMContentLoaded event. Once the event is triggered, it will start the animation loop by calling the animate() function. In each frame of the animation, the hue value of the gradient color is incremented, creating a smooth transition effect. The hue value is kept within the range of 0 to 360 degrees by using the modulo operator. The color is calculated using the HSL (Hue, Saturation, Lightness) color model, where the hue changes over time while saturation and lightness remain constant. The background color of the element with the ID "animated-element" is updated in each frame to reflect the current color of the gradient. The animation loop continues indefinitely, creating a continuous gradient animation effect.

Customization

You can adjust the size, shape, and position of the animated element by modifying its CSS styles. You can experiment with different color models (such as RGB or HEX) or modify the hue, saturation, and lightness values to achieve different gradient effects. Demo You can see a live demo here (Provide a link to a live demo if available).

Contributing

Contributions are welcome! Feel free to fork this repository and submit pull requests to suggest improvements or additional features.