<link href="https://fonts.googleapis.com/css?family=Archivo+Black&display=swap" rel="stylesheet">
<h1 class="playful" aria-label="Wash your hands">
<span aria-hidden="true">W</span><span aria-hidden="true">a</span><span aria-hidden="true">s</span><span aria-hidden="true">h</span><span aria-hidden="true"> </span><span aria-hidden="true">y</span><span aria-hidden="true">o</span><span aria-hidden="true">u</span><span aria-hidden="true">r</span><span aria-hidden="true"> </span><span aria-hidden="true">h</span><span aria-hidden="true">a</span><span aria-hidden="true">n</span><span aria-hidden="true">d</span><span aria-hidden="true">s</span><span aria-hidden="true">!</span>
</h1>
$background: #E4FFF7;
@function textShadow($precision, $size, $color){
$value: null;
$offset: 0;
$length: $size * (1 / $precision) - 1;
@for $i from 0 through $length {
$offset: $offset + $precision;
$shadow: $offset + px $offset + px $color;
$value: append($value, $shadow, comma);
}
@return $value;
}
.playful span {
position: relative;
color: #5362F6;
text-shadow: textShadow(0.25, 6, #E485F8);
animation: scatter 1.75s infinite;
}
.playful span:nth-child(2n) {
color: #ED625C;
text-shadow: textShadow(0.25, 6, #F2A063);
animation-delay: 0.3s;
}
.playful span:nth-child(3n) {
color: #FFD913;
text-shadow: textShadow(0.25, 6, #6EC0A9);
animation-delay: 0.15s;
}
.playful span:nth-child(5n) {
color: #555BFF;
text-shadow: textShadow(0.25, 6, #E485F8);
animation-delay: 0.4s;
}
.playful span:nth-child(7n), .playful span:nth-child(11n) {
color: #FF9C55;
text-shadow: textShadow(0.25, 6, #FF5555);
animation-delay: 0.25s;
}
@keyframes scatter {
0% {
top: 0;
}
50% {
top: -10px;
}
100% {
top: 0;
}
}
body {
background-color: $background;
}
h1 {
font-size: 65px;
text-transform: uppercase;
font-family: "Archivo Black", "Archivo", sans-serif;
font-weight: normal;
display: block;
width: 666px;
max-width: 80vw;
min-height: 90px;
height: auto;
text-align: center;
margin: 10rem auto;
margin: calc(50vh - 5rem) auto;
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.