<div class="site-container">
<svg width="500" height="120" class="blinking-chars">
<text text-anchor="middle" x="50%" y="50%" class="blinking-chars-group">
<tspan class="char" dy="0">
H
</tspan>
<tspan class="char" dy="0">
e
</tspan>
<tspan class="char" dy="0">
l
</tspan>
<tspan class="char" dy="0">
l
</tspan>
<tspan class="char" dy="0">
o
</tspan>
</text>
</svg>
</div>
@import "https://fonts.googleapis.com/css2?family=Anton&display=swap";
:root {
--text-body-bg-color: #d2dae2;
--text-body-color: #82589f;
--text-font-family: "Anton", sans-serif;
--text-animation-speed: 1s;
--text-size: 5em;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
body {
font: 1em/160% sans-serif;
margin: 0;
background-color: var(--text-body-bg-color);
color: var(--text-body-color);
}
svg {
fill: currentColor;
max-width: 100%;
vertical-align: baseline;
}
.site-container {
padding: 2em;
min-height: 100vh;
display: grid;
place-items: center;
}
.blinking-chars {
font-family: var(--text-font-family);
font-size: var(--text-size);
}
.blinking-chars-group .char {
animation: blink var(--text-animation-speed) infinite alternate;
opacity: 0;
}
.blinking-chars .char:nth-child(1) {
animation-delay: calc(var(--text-animation-speed) * 0);
}
.blinking-chars .char:nth-child(2) {
animation-delay: calc(var(--text-animation-speed) * 0.2);
}
.blinking-chars .char:nth-child(3) {
animation-delay: calc(var(--text-animation-speed) * 0.4);
}
.blinking-chars .char:nth-child(4) {
animation-delay: calc(var(--text-animation-speed) * 0.6);
}
.blinking-chars .char:nth-child(5) {
animation-delay: calc(var(--text-animation-speed) * 0.8);
}
@keyframes blink {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.