Gradient text shimmer animation
<div class="animated-gradient">Shimmer</div> .animated-gradient {
background-image: linear-gradient(90deg, #ef476f 33%, #ffd166 66%, #ef476f);
background-size: 300%;
background-position: -200%;
/* background-clip:text be used widely now without a prefix.
Prefixed version is included to support max no. of browsers */
-webkit-background-clip: text;
background-clip: text;
color: transparent;
animation: move 6s linear infinite;
}
@keyframes move {
to {
background-position: 100%;
}
}
/* general styles */
body {
height: 100dvh;
margin: 0;
display: grid;
place-items: center;
background: black;
}
div {
font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
font-size: clamp(4rem, 1.6923rem + 12.3077vw, 8rem);
font-weight: bold;
} Description
Text with a gradient background is animated to create a shimmery effect.
The effect is achieved by making background wider than the text using background-size. Then, the position of the gradient is offset so it lines up with the start of the text using background-position. Then the background-position is animated to move the gradient across the text from left to right.