n3r4zzurr0 / svg-spinners Goto Github PK
View Code? Open in Web Editor NEWA collection of 24 x 24 dp SVG spinners! (CSS & SMIL)
License: MIT License
A collection of 24 x 24 dp SVG spinners! (CSS & SMIL)
License: MIT License
For those that are using height and y for animation, for ex bars-scale.svg, it can cause the browser to repaint, which is not good for performance.
The same animation effect can be achieved using the transform property instead.
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<style>
.spinner_jCIR {
animation: spinner_B8Vq .9s linear infinite;
animation-delay: -.9s;
transform-origin: center;
animation-timing-function: cubic-bezier(0.36, .61, .3, .98);
}
.spinner_upm8 {
animation-delay: -.8s
}
.spinner_2eL5 {
animation-delay: -.7s
}
.spinner_Rp9l {
animation-delay: -.6s
}
.spinner_dy3W {
animation-delay: -.5s
}
@keyframes spinner_B8Vq {
0%,
66.66% {
transform: scaleY(1);
}
33.33% {
transform: scaleY(1.8);
}
}
</style>
<rect class="spinner_jCIR" x="1" y="6" width="2.8" height="12" />
<rect class="spinner_jCIR spinner_upm8" x="5.8" y="6" width="2.8" height="12" />
<rect class="spinner_jCIR spinner_2eL5" x="10.6" y="6" width="2.8" height="12" />
<rect class="spinner_jCIR spinner_Rp9l" x="15.4" y="6" width="2.8" height="12" />
<rect class="spinner_jCIR spinner_dy3W" x="20.2" y="6" width="2.8" height="12" />
</svg>
Most of the animations don't work on Firefox (102 beta 6).
The error in the log for this example is:
Unexpected value .75s parsing dur attribute.
Apparently Firefox does not support decimal numbers without a leading digit, which might be standard-conforming and not a bug in Firefox. Fixing the number to read 0.75 immediately restores the animation for the example above.
I looked for a bit into the SVG specification and I found a statement related to the "dur" attribute format in this particular case:
Timecount-val ::= Timecount ("." Fraction)? (Metric)?
In other words, the decimal point, the fractional part and the metric are optional, but the first digit must always be present.
currently it is displayed with black color, but I prefer it to be white
Hello,
Stemmed from my current use cases for this awesome resource, would it be a good thing to add fill="currentColor"
to the svg elements in the repo's code base?
Icon contains 2 elements with same id: spinner_JsnR
what is the license of svg-spinners
library?
would be good to know and also create a LICENSE
file for everyone interested because this looks amazing
I am working on a component library for React to use these spinners. Check it out here.
Here's a minimal reproduction. I tested this on the latest Safari (17.2) and confirmed that it's still an issue.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Off-center spinner</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.spinner_aj0A {
transform-origin: center;
animation: spinner_KYSC 0.75s infinite linear;
fill: hsl(var(--muted-foreground));
}
@keyframes spinner_KYSC {
100% {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z" class="spinner_aj0A" />
</svg>
</body>
</html>
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.