Created
July 17, 2021 12:32
-
-
Save rybarix/a433415cdb5a27bc8dc639fd336e7ce7 to your computer and use it in GitHub Desktop.
Cool animated deep shadows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.shadow1 { | |
box-shadow: inset 0 0 10px rgba(0,0,0,0.10); | |
background: #f1f1f1; | |
opacity: 0; | |
animation: 500ms show forwards; | |
animation-delay: 2s; | |
} | |
.shadow2 { | |
box-shadow: inset 0 0 10px rgba(0,0,0,0.25); | |
background: #e1e1e1; | |
opacity: 0; | |
animation: 500ms show forwards; | |
animation-delay: 3s; | |
} | |
.shadow3 { | |
box-shadow: inset 0 0 10px rgba(0,0,0,0.30); | |
background: #d1d1d1; | |
opacity: 0; | |
animation: 500ms show forwards; | |
animation-delay: 4s; | |
} | |
.shadow4 { | |
box-shadow: inset 0 0 10px rgba(0,0,0,0.40); | |
background: #c1c1c1; | |
opacity: 0; | |
animation: 500ms show forwards; | |
animation-delay: 5s; | |
} | |
.shadow5 { | |
box-shadow: inset 0 0 10px rgba(0,0,0,0.50); | |
background: #b1b1b1; | |
opacity: 0; | |
animation: 500ms show forwards; | |
animation-delay: 6s; | |
} | |
@keyframes show { | |
0% { | |
opacity: 0; | |
} | |
100% { | |
opacity: 1; | |
} | |
} | |
body { | |
background: white; | |
} | |
* {box-sizing: border-box; } | |
#box { | |
width: 200px; | |
height: 200px; | |
background: #fff; | |
border: 1px solid #dedede; | |
padding: 5px; | |
} | |
#box div { | |
width: 100%; | |
height: 100%; | |
/* background: red; */ | |
/* border: 1px solid #dedede; */ | |
padding: 5px; | |
} | |
#inner { | |
box-shadow: 0 0 8px black; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id="box" class="shadow1"> | |
<div class="shadow2"> | |
<div class="shadow3"> | |
<div class="shadow4"> | |
<div class="shadow5"> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment