Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
SVG library for transitioning numbers with motion blur
JavaScript odometer or slot machine effect library for smoothly transitioning numbers with motion blur. Library uses functional approach and ES7 Function Bind Syntax. Internally based on SVG.
See the live version.
To install the stable version:
npm install --save bounty
The API is really simple and straigthforward:
import bounty from `bounty`;
bounty({ el: '.js-bounty', value: '£42,000,000' });
You can use it with other options:
import bounty from `bounty`;
bounty({
el: '.js-bounty',
value: '£42,000,000',
initialValue: '£900,000',
lineHeight: 1.35,
letterSpacing: 1,
animationDelay: 100,
letterAnimationDelay: 100
duration = 3000
});
If you want to control ongoing animation just use methods from returned object:
import bounty from `bounty`;
const { cancel, pause, resume } = bounty({ el: '.js-bounty', value: '£42,000,000' });
const wait = (delay) => new Promise((resolve) => setTimeout(resolve, delay));
const pasueAndRun = async () => {
await wait(1500);
pause();
await wait(2000);
resume();
await wait(2000);
cancel();
};
pasueAndRun();
Library is built using UMD thus the following usage in HTML is possible.
<div class="js-bounty"></div>
<script src="/bounty.js"></script>
<script>
bounty.default({ el: ".js-bounty", value: "£42,000,000" });
</script>
The UMD build is also available on unpkg:
<script src="https://unpkg.com/bounty@1.1.6/lib/bounty.js"></script>
You can find the library on window.bounty
.
Yea! That's it. Other options like font-family
and font-size
are taken from computed styles so you can just style it like the other layers.
.js-bounty {
font-size: 60px;
font-family: Roboto;
fill: #fff;
text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
}
If you're interested how it's made, see the presentation.
There is a work in progress to implement additional features:
from
to
API.<svg-bounty>
The library is available under the MIT license. For more info, see the LICENSE file.
FAQs
SVG library for transitioning numbers with motion blur
We found that bounty 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.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.