<div><h1 contenteditable data-text="Next">Next</h1></div>
<!-- Click the text to add your own words in. -->
// Chrome only people!
@font-face {
font-family:'Decovar Regular24';
src:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/209981/Decovar-VF.ttf');
}
h1 {
margin: 0;
font-size: 25vw;
position: relative;
letter-spacing: 0.6rem;
transform: translateZ(0);
// Variable font
font-family: "Decovar Regular24";
font-variation-settings: 'SSTR' 1000, 'TSHR' 1000, 'wght' 1000;
// Background clip to image
background-clip: text;
text-fill-color: transparent;
background-image: url(https://images.unsplash.com/photo-1488920873278-ad544bf71d62?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&s=7190e9fef514fef6cf42ce2e311b97ff);
background-size: 30%;
background-repeat: repeat;
// Layering
mix-blend-mode: color-dodge;
text-shadow: 5px 5px 20px rgba(#2a4308, 0.4);
// Animate
animation: grow 3s linear infinite;
&::after {
content: attr(data-text);
position: absolute;
left: 0;
top: 0;
z-index: -1;
// Font variation
font-variation-settings: 'INLN' 0;
// Texture
background: linear-gradient(to right, #03001e, #7303c0, #ec38bc, #fdeff9);
background-size: 30%;
background-repeat: repeat;
background-clip: text;
text-fill-color: transparent;
// Blend
mix-blend-mode: difference;
}
}
@keyframes grow {
0% {
font-variation-settings: 'SSTR' 1000, 'TSHR' 1000, 'wght' 1000;
}
50% {
font-variation-settings: 'SSTR' 0, 'TSHR' 0, 'wght' 0;
}
}
//Positioning
html {
height: 100%;
}
body {
height: 100%;
overflow: hidden;
}
div {
background: linear-gradient(to right, #acb6e5, #86fde8);
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
text-align: center;
z-index: -1;
}
View Compiled
var h1 = document.querySelector("h1");
h1.addEventListener("input", function() {
this.setAttribute("data-text", this.innerText);
});
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.