Make your landing page feel alive
Click any word to animate that one
The prompt
Written from your settings. Paste it into your AI tool.
Animate one word in the main headline of my landing page with an effect called Word shine. In my example the headline reads "Make your landing page feel alive" and the animated word is "alive". Apply it to the word I point out in my own headline, and ask me which one if I have not said. Keep the rest of the headline still. Fill only that word with a linear gradient at 100 degrees using background-clip text. The gradient is the normal text colour everywhere except for a band of my accent colour in the middle that is 26 percent of the gradient wide. Make the background three times wider than the word and animate background-position so the band travels across it from left to right in about 1.5 seconds, then rests for about 1.3 seconds before repeating. Use ease-in-out. The word should look completely normal while the band is resting. Keep my existing font, colours and layout exactly as they are. Screen readers and search engines must still read the headline as one normal sentence, so put the full text in an aria-label on the heading and mark any decorative spans as aria-hidden. If the visitor has prefers-reduced-motion turned on, show the finished headline straight away with no animation. Make sure nothing shifts the layout while it plays. Use plain CSS and a little vanilla JavaScript, unless my project already has an animation library, in which case use that. A live demo with reference code for these exact settings is at https://smthngfun.com/a/word-shine and you can use that code as your starting point, adapted to my codebase and styling. If I am happy to credit the source, add a small "Animation by smthngfun" link to https://smthngfun.com in the footer of the page. Ask me before adding it.
Reference code
A working version of Word shine with your settings. It assumes the headline has the class hero-title.
<!-- HTML -->
<!-- Word shine animation from https://smthngfun.com/a/word-shine -->
<h1 class="hero-title">Make your landing page feel <span class="shine">alive</span></h1>
/* CSS */
.hero-title .shine {
--text: #1c1c28; /* your text colour */
--accent: #c3b3f3; /* your accent colour */
display: inline-block;
background: linear-gradient(100deg, var(--text) 37%, var(--accent) 50%, var(--text) 63%) 100% 0 / 300% 100% no-repeat;
-webkit-background-clip: text;
background-clip: text;
color: transparent;
animation: word-shine 2800ms ease-in-out infinite;
}
@keyframes word-shine {
0% { background-position: 100% 0; }
55%, 100% { background-position: 0% 0; }
}
@media (prefers-reduced-motion: reduce) {
.hero-title .shine { animation: none; background: none; color: var(--text); }
}