24
loading...
This website collects cookies to deliver better user experience
box-shadows
, pseudo-classes and the filter
property to achieve this effect.// Box shadow
box-shadow: -5px -5px 5px rgba(255, 255, 255, 0.1),
10px 10px 10px rgba(0, 0, 0, 0.4),
inset -5px -5px 5px rgba(255, 255, 255, 0.2),
inset 10px 10px 10px rgba(0, 0, 0, 0.4);
// Pseudo class
.loader:before {
content: "";
.
.
.
}
// Filter property
filter: blur(20px);
z-index
values they have. They also animate on top of each-other for a more natural transition.z-index
, but also it has some cool blue linear-gradient
and transform
properties on the x-axis.// Linear gradient
background: linear-gradient(45deg,
rgba(2,0,36,1) 0%,
rgba(9,9,121,1) 35%,
rgba(0,212,255,1) 100%);
// Z-index and transforms
@keyframes move-1 {
0% {z-index: 3; transform: translateX(0);}
.
.
.
100% {z-index: 1; transform: translateX(0);}
}
@for
flow control, and CSS blend mode.// Custom variables
$n: 10;
$r: 1.5em;
$oa: -90deg;
$ba: 360deg/$n;
$hl: 2*$r;
.
.
.
// Flow control
@for $i from 0 to $n {
$ca: $oa + $i*$ba;
$sh: $sh,
$rc*cos($ca) $rc*sin($ca) currentcolor
}
// Blend mode
.loader {
.
.
.
mix-blend-mode: multiply;
.
.
.
}
animation
values change be changed dynamically as per your liking as it uses SASS variables.@for
inside the animation @keyframes
code.Use of clip-path
to morph the shape.
// Dynamic animation
body { .
.
.
animation: fsx 4*$t steps(1) infinite
}
// Use of @for inside @keyframes
@keyframes fbg {
@for $i from 0 to $n {
#{$i/$n*100%} { background: nth($c, $i + 1) }
}
}
// Use of clip-path
@keyframes exp {
0%, #{$q} { clip-path: inset(0 .5*$d $d round 50%) }
100% { clip-path: inset(0 round 50%/ 0) }
}
transform: rotate()
function.// Control the amount of circles, diameter, radius and duration
.circle {
$circle-count: 60;
$circle-diameter: 0.5em;
$ring-radius: 4em;
$duration: 3s;
.
.
.
}
// Using rotate() to make a ring of circles
transform: rotate($ratio * 720deg) translateX($ring-radius);
filter
property and many of the CSS-SVG values like stop-color
, stroke-dasharray
and more!// CSS filter
.skugga {
filter: blur(5px);
.
.
.
}
// CSS-SVG values
.strecken {
stroke-dasharray: 26 54;
fill: none;
stroke: url(#gradient);
stroke-width: 23;
stroke-linecap: round;
}
linear-gradient
values.blur
filter.Pseudo classes like :nth-child()
and :after
are used.
.loader {
.
.
.
background: linear-gradient(#f07e6e, #84cdfa, #5ad1cd);
animation: animate 1.2s linear infinite;
}
transform: rotate()
function and with extra cautious values of @keyframes
.// Use of rotate
div:nth-of-type(2){transform:rotate(60deg)}
div:nth-of-type(3){transform:rotate(-60deg)}
// Use of precise values in @keyframes
@keyframes load1 {
0%{bottom:0;height:0}
6.944444444%{bottom:0;height:100%}
50%{top:0;height:100%}
59.944444433%{top:0;height:0}
/* 91.6666667%{top:0;height:0%;} */
}
content
property.// Pseudo class
.spinner:after {
animation: changeContent .8s linear infinite;
display: block;
content: "⠋";
font-size: 80px;
}
// The animation block
@keyframes changeContent {
10% { content: "⠙"; }
20% { content: "⠹"; }
30% { content: "⠸"; }
40% { content: "⠼"; }
50% { content: "⠴"; }
60% { content: "⠦"; }
70% { content: "⠧"; }
80% { content: "⠇"; }
90% { content: "⠏"; }
}
// Use of animation stops
@keyframes circle--1 {
0% {
top: 50%;
}
50% {
top: 120%;
}
100% {
top: 50%;
}
}
@keyframes circle--2 {
0% {
top: 50%;
}
50% {
top: -50%;
}
100% {
top: 50%;
}
}
transform
and opacity
properties, it’s amazing to see how many different loading spinner can be made! You can also check out its GitHub repo.24