ambarvm / svelte-magnifier Goto Github PK
View Code? Open in Web Editor NEWSvelte image magnifier component
Home Page: https://ambarvm.github.io/svelte-magnifier/
Svelte image magnifier component
Home Page: https://ambarvm.github.io/svelte-magnifier/
When building application, the following warning is showing.
[vite-plugin-svelte] WARNING: The following packages have a svelte field in their package.json but no exports condition for svelte
I've been using this project on a small project which required the ability to flip and rotate images due to original uploads not always being in a sensible orientation.
Currently I make these changes by passing in CSS transforms:
:global(.magnifier-image) {
transform: rotate(var(--rotation)) scaleX(var(--flip-horizontal)) scaleY(var(--flip-vertical));
}
:global(.magnifying-glass) {
transform: rotate(var(--rotation)) scaleX(var(--flip-horizontal)) scaleY(var(--flip-vertical));
}
Because these transforms don't change the way calculations are performed, it means that a flipped image will move around "backwards" (e.g., moving the mouse left will show the right area magnified). Rotated images are even messier because of the change in dimensions causing a squashed effect.
Is it possible for the component to handle these cases in a native way so that the magnifier can appropriately re-calculate based on the current image position?
Hi I have the following styles
:global(.magnifying-glass) { /* Styles for magnifying glass */ border-radius: 15%; border: 5px solid rgba(0,0,0,.5) !important; }
This has no effect on the border which remains - square, white and solid
Hi I'm using svelte-magnifier in a gallery site displaying different size paintings.
How do I set up the classes .magnifier and .magnifier-image to display each painting, maximum size, maintaining aspect ratio and without cropping?
Any help much appreciated
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.