h1
span REVEAL with LABEL
button RELOAD
View Compiled
@import url('https://fonts.googleapis.com/css?family=Palanquin+Dark:500&display=swap');
body {
height: 100vh;
background: #103c42;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-family: 'Palanquin Dark', sans-serif;
letter-spacing: 0.1em;
}
h1 {
color: #ffe837;
font-size: 5vw;
font-weight: 500;
margin-bottom: 3rem;
text-shadow: 2px 2px 2px #222;
}
button {
background-color: transparent;
border: none;
cursor: pointer;
outline: none;
padding: 0;
appearance: none;
color: #fff;
padding: 0.8rem 2rem;
border: 1px solid #fff;
font-size: 0.7rem;
letter-spacing: 0.15em;
}
/* related to css reveal with label from here. */
h1 {
position: relative;
display: inline-block;
span {
animation: fadeIn 0s 0.3s backwards;
@keyframes fadeIn {
0% {
opacity: 0;
}
}
}
&::after {
position: absolute;
top: 0;
left: 0;
content: '';
display: block;
width: 100%;
height: 100%;
background: #02576c;
transform: scaleX(0);
animation: labelIn 0.3s 0s ease, labelOut 0.3s 0.3s ease;
animation-fill-mode: forwards;
@keyframes labelIn {
0% {
transform-origin: left;
transform: scaleX(0);
}
100% {
transform-origin: left;
transform: scaleX(1);
}
}
@keyframes labelOut {
0% {
transform-origin: right;
transform: scaleX(1);
}
100% {
transform-origin: right;
transform: scaleX(0);
}
}
}
}
View Compiled
//not related to css reveal with label.
var btn = $('button');
btn.on('click',function(){
location.reload();
})
View Compiled
This Pen doesn't use any external CSS resources.