<h1 data-heading="woah" contenteditable>woah</h1>
html,
body {
background: radial-gradient(ellipse at center, rgba(255,244,252,1) 65%,rgba(255,232,253,1) 100%);
width: 100%;
height: 100%;
}
h1 {
font-family: 'Infamy Fill';
font-size: 30vw;
margin: 0;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
position: absolute;
color: #f091ad;
text-transform: uppercase;
font-variant-ligatures: none;
line-height: 1;
&:before,
&:after {
content: attr(data-heading);
position: absolute;
left: 0;
font-variant-ligatures: none;
line-height: 0.97;
font-weight: normal;
}
&:before {
color: #f7cad8;
width: 100%;
z-index: 5;
font-family: 'Infamy Outline';
}
&:after {
color: rgba(#bf4970, .3);
width: 100%;
font-family: 'Infamy Shadow';
line-height: 1.1;
}
}
View Compiled
// JS is to make the text editable fot demo purpose, not required for the effect. Thanks for the suggestion @chriscoyier!
var h1 = document.querySelector("h1");
h1.addEventListener("input", function() {
this.setAttribute("data-heading", this.innerText);
});
// THIS JS IS JUST FOR LOADING MY FONTS TRIAL FONTS IN, IT IS NOT NEEDED FOR THE ACTUAL EFFECT IF YOU HAVE THE FONTS.
(function() {
var path = '//easy.myfonts.net/v2/js?sid=265311(font-family=Infamy+Fill)&sid=265312(font-family=Infamy+Highlight)&sid=265313(font-family=Infamy+Shadow)&sid=265314(font-family=Infamy+Outline)&key=ArVWnapeog',
protocol = ('https:' == document.location.protocol ? 'https:' : 'http:'),
trial = document.createElement('script');
trial.type = 'text/javascript';
trial.async = true;
trial.src = protocol + path;
var head = document.getElementsByTagName("head")[0];
head.appendChild(trial);
})();
/*
font-family: 'Infamy Fill'
font-family: 'Infamy Highlight'
font-family: 'Infamy Shadow'
font-family: 'Infamy Outline
https://www.myfonts.com/fonts/latinotype/infamy/
*/
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.