Socket
Socket
Sign inDemoInstall

smooth-gradient

Package Overview
Dependencies
0
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.2.4 to 2.3.0

26

docs/index.js

@@ -62,12 +62,3 @@ const NB_COLORS = 4;

document.getElementById('gradients').addEventListener("mousemove", (event) => {
const { x } = event;
const { width } = document.getElementById('gradients').getBoundingClientRect();
const position = x - document.getElementById('gradients').getBoundingClientRect().x;
const value = Math.floor(position * 100 / width);
if (value < 0) value = 0;
if (value > 100) value = 100;
const updateFrame = (value) => {
document.getElementById('selector').style.left = `${value - 1}%`;

@@ -86,2 +77,17 @@ const color = gradient.getColorFromValue(value, 'rgb');

//document.getElementById('gradients').style.border = `4px solid ${color}`;
}
updateFrame(randomValue(20, 80));
document.getElementById('gradients').addEventListener("mousemove", (event) => {
const { x } = event;
const { width } = document.getElementById('gradients').getBoundingClientRect();
const position = x - document.getElementById('gradients').getBoundingClientRect().x;
const value = Math.floor(position * 100 / width);
if (value < 0) value = 0;
if (value > 100) value = 100;
updateFrame(value);
});
{
"name": "smooth-gradient",
"version": "2.2.4",
"version": "2.3.0",
"description": "Generates a gradient and can return a calculated color from an input",

@@ -28,3 +28,3 @@ "type": "module",

"url": "git+git@github.com:jussetain/color-gradient.git",
"web": "https://github.com/jussetain/color-gradient/"
"web": "https://jussetain.github.io/color-gradient/"
},

@@ -31,0 +31,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc