Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
lottie-scale
Advanced tools
Lottie Scale is a very small NPM package to allow those with very little and out-of-scale SVG animations exported from Bodymovin to scale them, just by providing the container element and the scale multiplier.
It's particularly simple, that is, a single function call.
There are two possible ways to use Lottie Scale.
<script>
tag<script type="text/javascript" src="https://unpkg.com/lottie-scale@latest/dist/index.min.js"></script>
<!-- OR -->
<script type="text/javascript" src="https://unpkg.com/lottie-scale@latest/dist/index.js"></script>
import * as lottieScale from 'lottie-scale'
Lottie Scale can only do its magic after the DOM of the SVG animation is rendered so it's essential to add an event listener to the animation.
For now, the only function of the package is lottieScale
:
lottieScale(zoomMultiplier int, lottieObject obj)
Usage example in a real case scenario:
// If you're using ES6 import
import * as lottieScale from 'lottie-scale'
let el = document.querySelector('#svgContainer')
const anim = lottie.loadAnimation({
container: el,
renderer: 'svg',
loop: true,
autoplay: true,
path: 'data.json', // Dataset or any other source can be used here to provide Lottie with JSON for the animation to render
rendererSettings: {
scaleMode: 'cover',
}
})
let svgRendered = el.querySelector('svg')
anim.addEventListener('DOMContentLoaded', () => {
lottieScale(2, svgRendered)
})
In this example, the SVG animation is basically zoomed 200%.
Feel free to add your 2 cents via the issues or pull requests tabs.
FAQs
Fast and simple JS package to scale SVG Lottie animations
We found that lottie-scale 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.