The content on this website, including videos and code examples, is for educational purposes only. All demonstrations and designs are fictional and created to illustrate coding techniques. Any resemblance to existing websites or brands is purely coincidental.
The creators and administrators of this website do not claim ownership or affiliation with any existing websites or companies. Users are encouraged to use the information responsibly for learning purposes. Liability for any misuse of the content provided is not accepted.
Below is the html code for this video.
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Whimsical Snow Ball Loader</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="loader">
<div class="loader-outer-ring"></div>
<div class="loader-inner-ring"></div>
<div class="loader-track-cover"></div>
<div class="loader-ball">
<div class="loader-ball-texture"></div>
<div class="loader-ball-outer-shadow"></div>
<div class="loader-ball-inner-shadow"></div>
<div class="loader-ball-side-shadows"></div>
</div>
</div>
</body>
</html>
Below is the css code for this video.
style.css
* {
margin: 0;
padding: 0;
border: 0;
box-sizing: border-box;
}
body {
display: grid;
height: 100vh;
width: 100%;
background-color: #e7edfe;
place-items: center;
}
.loader, .loader-ball, .loader-ball-inner-shadow, .loader-ball-side-shadows, .loader-ball-texture,
.loader-inner-ring, .loader-outer-ring, .loader-track-cover {
border-radius: 50%;
}
.loader {
position: relative;
height: 16em;
width: 16em;
}
.loader-ball, .loader-ball-inner-shadow, .loader-ball-outer-shadow, .loader-ball-side-shadows, .loader-ball-texture,
.loader-ball-texture::before, .loader-inner-ring, .loader-outer-ring, .loader-track-cover {
position: absolute;
}
.loader-ball, .loader-ball-inner-shadow, .loader-ball-outer-shadow, .loader-ball-texture::before, .loader-track-cover {
animation: snowBallAnim 2.4s linear infinite;
}
.loader-ball {
top: calc(50% - 1.25em);
left: calc(50% - 1.25em);
height: 2.5em;
width: 2.5em;
transform: rotate(0) translateY(-6.5em);
}
.loader-ball-inner-shadow {
height: 100%;
width: 100%;
animation-name: snowBallInnerShadowAnim;
box-shadow: 0 0.1em 0.2em #0000004d, 0 0 0.2em #0000001a inset, 0 -1em 0.5em #00000026 inset;
}
.loader-ball-outer-shadow {
top: 50%;
left: 0;
height: 250%;
width: 100%;
background-image: linear-gradient(#00000026, transparent);
transform: rotate(20deg);
transform-origin: 50% 0;
border-radius: 0 0 50% 50% / 0 0 100% 100%;
filter: blur(2.4px);
animation-name: snowBallOuterShadowAnim;
z-index: -2;
}
.loader-ball-side-shadows {
height: 100%;
width: 100%;
background-color: #0000001a;
transform: scale(0.75, 1.1);
filter: blur(2.4px);
z-index: -1;
}
.loader-ball-texture {
height: 100%;
width: 100%;
transform: translate3d(0, 0, 0);
overflow: hidden;
}
.loader-ball-texture::before {
content: "";
display: block;
top: 0;
right: 0;
height: 100%;
width: 200%;
background: url('https://www.lotpixel.com/products/products/free-snow-texture-358_2.webp') 0 0 / 50% 100%;
filter: brightness(1.32);
animation-name: snowBallTextureAnim;
animation-duration: 0.42s;
}
.loader-inner-ring {
top: 2.375em;
left: 2.375em;
height: calc(100% - 4.75em);
width: calc(100% - 4.75em);
box-shadow: 0 -0.25em 0.5em #ffffff66, 0 0.5em 0.75em #ffffff66 inset, 0 0.5em 0.375em #00000026, 0 -0.5em 0.75em #00000026 inset;
}
.loader-outer-ring {
top: 0.75em;
left: 0.75em;
height: calc(100% - 1.5em);
width: calc(100% - 1.5em);
box-shadow: 0 -0.45em 0.375em #00000026, 0 0.5em 0.75em #00000026 inset, 0 0.25em 0.5em #ffffff66, 0 -0.5em 0.75em #ffffff66 inset;
}
.loader-track-cover {
top: 0;
left: 0;
height: 100%;
width: 100%;
background-image: conic-gradient(#e7edfe 210deg, transparent 270deg);
animation-name: trackCoverAnim;
}
@keyframes snowBallAnim {
0% {
transform: rotate(0) translateY(-6.5em);
}
50% {
transform: rotate(180deg) translateY(-6em);
}
100% {
transform: rotate(360deg) translateY(-6.5em);
}
}
@keyframes snowBallInnerShadowAnim {
from {
transform: rotate(0);
}
to {
transform: rotate(-360deg);
}
}
@keyframes snowBallOuterShadowAnim {
from {
transform: rotate(20deg);
}
to {
transform: rotate(-340deg);
}
}
@keyframes snowBallTextureAnim {
from {
transform: translateX(0);
}
to {
transform: translateX(50%);
}
}
@keyframes trackCoverAnim {
from {
transform: rotate(0);
}
to {
transform: rotate(360deg);
}
}
Thanks for visiting