JSFiddle - React, Tailwind, and code Playground
by c_vilander
HTML
<div class="text">
<p>Shadow</p>
</div>
<div class="light"></div>
<div class="light two"></div>
CSS
body {
margin: 0;
padding: 0;
background: rgb(0, 0, 0);
font-family: "Times New Roman", Georgia, Serif;
font-size: 98px;
}
p {
margin: 0;
padding: 0;
}
.text {
position: absolute;
top: 40px;
left: 100px;
margin: 0;
padding: 0;
color: rgb(0, 0, 0);
background: transparent;
text-shadow: 0px 10px 10px rgb(0, 0, 0);
z-index: 1;
-webkit-animation: shadow 6.0s ease-in-out infinite;
animation: shadow 6.0s ease-in-out infinite;
}
.light {
position: absolute;
top: 30px;
left: 50px;
width: 140px;
height: 140px;
margin: 0;
padding: 0;
opacity: 0.8;
border-radius: 100px;
z-index: 0;
background: -webkit-radial-gradient(center, ellipse cover, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.2) 100%);
background: radial-gradient(ellipse at center, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.2) 100%);
box-shadow: 0px 0px 50px rgba(255, 255, 255, 1);
-webkit-transform: translate3d(0, 0, 0);
-webkit-animation: light 6.0s ease-in-out infinite;
animation: light 6.0s ease-in-out infinite;
}
.light.two {
z-index: 2;
opacity: 0.7;
}
@-webkit-keyframes light {
0% {
left: 45px;
}
50% {
left: 335px;
}
100% {
left: 45px;
}
}
@keyframes light {
0% {
left: 45px;
}
50% {
left: 335px;
}
100% {
left: 45px;
}
}
@-webkit-keyframes shadow {
0% {
text-shadow: -9px 2px 5px rgb(0, 0, 0);
}
50% {
text-shadow: 9px 2px 5px rgb(0, 0, 0);
}
100% {
text-shadow: -9px 2px 5px rgb(0, 0, 0);
}
}
@keyframes shadow {
0% {
text-shadow: -9px 2px 5px rgb(0, 0, 0);
}
50% {
text-shadow: 9px 2px 5px rgb(0, 0, 0);
}
100% {
text-shadow: -9px 2px 5px rgb(0, 0, 0);
}
}