
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Fit any easing function with keyframes and cubic-bezier timinf function
( refactoring attempts in dev
branch )
Fit any easing function with keyframes and cubic-bezier timing function.
For example, assume we have an equation for a bouncing ball's height:
Math.abs(Math.sin(Math.pow(3 * t + 1.77, 2)) / ( Math.pow(3 * t + 2, 5 * t) + 1))
instead of simply sampling it with fixed interval of t, easing-fit breaks it into pieces of cubic bezier spline:
@keyframes bouncing {
0% {
animation-timing-function: cubic-bezier(0,0.5,1,0.6);
transform: translate(0.4px);
}
11.5% {
animation-timing-function: cubic-bezier(0.7,0.2,0.8,0.7);
transform: translate(36.9px);
}
24.6% {
animation-timing-function: cubic-bezier(0.2,0.3,0.3,0.9);
transform: translate(0px);
}
32.3% {
animation-timing-function: cubic-bezier(0.5,0.2,0.7,0.6);
transform: translate(13.8px);
}
43.3% {
animation-timing-function: cubic-bezier(0.3,0.5,0.6,0.8);
transform: translate(0px);
}
49.6% {
animation-timing-function: cubic-bezier(0.4,0.1,0.7,0.6);
transform: translate(4px);
}
59.2% {
animation-timing-function: cubic-bezier(0.3,0.5,0.7,0.8);
transform: translate(0px);
}
64.6% {
animation-timing-function: cubic-bezier(0.3,0.2,0.7,0.7);
transform: translate(1.1px);
}
73.1% {
animation-timing-function: cubic-bezier(0.3,0.5,0.7,1);
transform: translate(0px);
}
100% {
transform: translate(0px);
}
}
First, import easing-fit and use it to create a keyframes object for our customized easing function:
easingFit = require("easing-fit");
customFunc = function(t) {
return Math.sin(t * Math.PI * 2);
};
keyframes = easingFit.fit(customFunc, {});
The keyframes object contains all information needed. Then, convert it to CSS keyframe string with this help function:
var result = easingFit.toKeyframes(keyframes, {
format: "css",
prop: function(keyframe,config, idx) { return {"transform": "translate(" + keyframe.value + ")"}; },
name: "sine",
config: {.../* custom defined config */ }
});
/* result is the result CSS content */
Be sure to add your own prop function for converting value into CSS property. You can also check sample.ls for more detail.
To tweak easing-fit further more, you can pass configuration into easingFit.fit, in the second parameter.
MIT
v0.0.3
FAQs
Fit any easing function with keyframes and cubic-bezier timinf function
The npm package easing-fit receives a total of 1 weekly downloads. As such, easing-fit popularity was classified as not popular.
We found that easing-fit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.