Animated Gradient Shadow
Animated Gradient Shadow
HTML CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="try.css">
<title>Document</title>
</head>
<body>
<div class="main"><h1>Jennie Kim</h1></div>
</body>
</html>
CSS CODE
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
body{
margin: 0;
padding: 0;
background-color: black;
width: 100%;
height: 100vh;
display: flex;
justify-content: center; /*To bring div at Center*/
align-items: center; /*To bring div at Center*/
}
.main{
position: relative;
margin: 200px;
width: 400px;
height: 250px;
background: black;
color: white;
display: flex;
justify-content: center; /*To bring Text at Center of Div*/
align-items: center; /*To bring Text at Center of Div*/
font-family: Product Sans;
font-size: 1.5rem;
}
.main::before{
content: "";
position: absolute;
top: -2px;
left: -2px;
background: linear-gradient(45deg, red,orange,yellow,green,blue,indigo,violet);
background-size: 400%;
width: calc(100% + 4px);
height: calc(100% + 4px);
z-index: -1;
animation: madan 20s linear infinite;
}
.main:before, .main:after{
filter: blur(20px);
}
@keyframes madan{
0%{
background-position: 0 0;
}
50%{
background-position: 200% 0;
}
100%{
background-position: 0 200%;
}
}
Comments
Post a Comment