Make your landing page feel alive
Click the headline to replay
The prompt
Written from your settings. Paste it into your AI tool.
Animate the main headline in the hero section of my landing page with an effect called Outline fill. Show the headline as outlined letters first, using a text stroke of 0.022em in the normal text colour with a transparent fill. After a 500ms pause, fill the letters with solid colour rising from the bottom to the top over 1300ms with the easing cubic-bezier(0.65, 0, 0.35, 1). Do this with a solid background clipped to the text whose height animates from 0 to 100 percent, anchored to the bottom. Play it once when the page loads and leave the headline fully filled at the end. 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/outline-fill 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 Outline fill with your settings. It assumes the headline has the class hero-title.
<!-- HTML -->
<!-- Outline fill animation from https://smthngfun.com/a/outline-fill -->
<h1 class="hero-title">Make your landing page feel alive</h1>
/* CSS */
.hero-title {
--text: #1c1c28; /* your text colour */
color: transparent;
-webkit-text-stroke: 0.022em var(--text);
background: linear-gradient(var(--text), var(--text)) 0 100% / 100% 0% no-repeat;
-webkit-background-clip: text;
background-clip: text;
animation: outline-fill 1300ms cubic-bezier(0.65, 0, 0.35, 1) 500ms forwards;
}
@keyframes outline-fill { to { background-size: 100% 100%; } }
@media (prefers-reduced-motion: reduce) {
.hero-title { animation: none; background-size: 100% 100%; }
}