
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
🎭 Library for seamless transition animations of images.
View demo page or the sample app from the gif on the right.
<img>
tag or element with background-image
object-fit
, background-size
: cover
, contain
and percentages), positioning background-position
, clip-path
, etc...npm install eivor
<script type="importmap">
{"imports": {"eivor": "./node_modules/eivor/src/ImageTransition.js"}}
</script>
ImageTransition
classsource
and target
can be <img>
tag or any html element with background-image
css property. Third and optional argument is an options
object.
import {ImageTransition} from 'eivor'
let transition = new ImageTransition(source, target, {duration: 1000})
await transition.play()
Optionally you can await transition.ready
Promise
if you need to wait for images to load.
let transition = new ImageTransition(source, target)
// Wait for source and target images to load. Calculating position delta hasn't yet begun.
await transition.ready
// Images are now loaded, here you can do something
await transition.play()
// animation is over, temporary files are removed from DOM, source and target have returned to their original positions, any additional CSS props are removed.
options
objectoptions.easing
: string
options.duration
: number
options.fill
: string
options.mode
: 'crop'|'recreate'|'clone'
automatically determined. Can be overriden with caution.
crop
: Crop, scale and translation are applied to the larger image. Only available if one image fits into the other.
recreate
: The larger image is temporarily resized in order to display the whole image uncropped. Then the target image is animated like crop
.
clone
: Like recreate
, but animation is applied to a clone of the target image while the original is hidden.The script is already mighty as is right now. But there are still some edge cases or nice to have things I'd like to implement.
*ContainedWithinTarget
allows it, or which url to use for clone node)sourceContainedWithinTarget
/ targetContainedWithinSource
and forcing use of clone instead of manipulating the image that covers more imge space. (maybe it should be just an option defaulting to false)MIT, Mike Kovařík, Mutiny.cz
FAQs
🎭 Library for seamless transition animations of images.
The npm package eivor receives a total of 0 weekly downloads. As such, eivor popularity was classified as not popular.
We found that eivor 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
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.