-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Zero to Mastery
committed
Oct 2, 2023
1 parent
60046b7
commit 2d46909
Showing
2 changed files
with
144 additions
and
137 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" dir="ltr"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta charset="utf-8" /> | ||
<title>Falling Stars</title> | ||
<link rel="stylesheet" href="style.css"> | ||
<link rel="stylesheet" href="style.css" /> | ||
</head> | ||
<body> | ||
|
||
<div class="night"> | ||
<div class="star"></div> | ||
<div class="star"></div> | ||
<div class="star"></div> | ||
<div class="star"></div> | ||
<div class="star"></div> | ||
</div> | ||
|
||
</body> | ||
</html> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,142 +1,151 @@ | ||
body{ | ||
height: 100vh; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background-image: url("Elsa.png"); | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
background-size:contain; | ||
background-color: #929090; | ||
animation: change-color-anim 6s linear infinite; | ||
overflow: hidden; | ||
|
||
} | ||
|
||
.night{ | ||
position: top;/* position: relative; */ | ||
width: 100%; | ||
height: 100%; | ||
transform: rotateZ(40deg); | ||
} | ||
|
||
.star{ | ||
position: absolute; | ||
left: 50%; | ||
top: 50%; | ||
height: 5px; | ||
background: linear-gradient(-45deg, hsl(225, 14%, 95%), rgba(0, 0, 255, 0)); | ||
border-radius: 999px; | ||
filter: drop-shadow(0 0 6px hsl(220, 69%, 49%)); | ||
animation: tail 3s ease-in-out infinite, | ||
falling 3s ease-in-out infinite; | ||
} | ||
|
||
@keyframes tail{ | ||
0%{ | ||
width: 0; | ||
} | ||
30%{ | ||
width: 100px; | ||
} | ||
100%{ | ||
width: 0; | ||
} | ||
} | ||
|
||
@keyframes falling{ | ||
0%{ | ||
transform: translateX(0); | ||
} | ||
100%{ | ||
transform: translateX(600px); | ||
} | ||
} | ||
|
||
.star::before, .star::after{ | ||
content: ''; | ||
position: absolute; | ||
top: calc(50% - 2px); | ||
right: 0; | ||
height: 4px; | ||
background: linear-gradient(-45deg, rgba(0, 0, 255, 0), #457df6, rgba(0, 0, 255, 0)); | ||
border-radius: 100%; | ||
transform: translateX(50%) rotateZ(45deg); | ||
animation: shining 3s ease-in-out infinite; | ||
} | ||
|
||
@keyframes shining{ | ||
0%{ | ||
width: 0; | ||
} | ||
50%{ | ||
width: 60px; | ||
} | ||
100%{ | ||
width: 0; | ||
} | ||
} | ||
|
||
.star::after{ | ||
transform: translateX(50%) rotateZ(-45deg); | ||
} | ||
|
||
.star:nth-child(1){ | ||
top: calc(50% - 100px); | ||
left: calc(50% - 250px); | ||
animation-delay: 1s; | ||
body { | ||
height: 100vh; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background-image: url('Elsa.png'); | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
background-size: contain; | ||
background-color: #929090; | ||
animation: change-color-anim 6s linear infinite; | ||
overflow: hidden; | ||
} | ||
|
||
.night { | ||
position: top; /* position: relative; */ | ||
width: 100%; | ||
height: 100%; | ||
transform: rotateZ(40deg); | ||
} | ||
|
||
.star { | ||
position: absolute; | ||
left: 50%; | ||
top: 50%; | ||
height: 5px; | ||
background: linear-gradient(-45deg, hsl(225, 14%, 95%), rgba(0, 0, 255, 0)); | ||
border-radius: 999px; | ||
filter: drop-shadow(0 0 6px hsl(220, 69%, 49%)); | ||
animation: tail 3s ease-in-out infinite, falling 3s ease-in-out infinite; | ||
} | ||
|
||
@keyframes tail { | ||
0% { | ||
width: 0; | ||
} | ||
|
||
.star:nth-child(1)::before, .star:nth-child(1)::after{ | ||
animation-delay: 1s; | ||
30% { | ||
width: 100px; | ||
} | ||
|
||
.star:nth-child(2){ | ||
top: calc(50% - 50px); | ||
left: calc(50% - 200px); | ||
animation-delay: 1.2s; | ||
100% { | ||
width: 0; | ||
} | ||
|
||
.star:nth-child(2)::before, .star:nth-child(2)::after{ | ||
animation-delay: 1.2s; | ||
} | ||
|
||
@keyframes falling { | ||
0% { | ||
transform: translateX(0); | ||
} | ||
|
||
.star:nth-child(3){ | ||
top: calc(50% - 0px); | ||
left: calc(50% - 150px); | ||
animation-delay: 1.4s; | ||
100% { | ||
transform: translateX(600px); | ||
} | ||
|
||
.star:nth-child(3)::before, .star:nth-child(3)::after{ | ||
animation-delay: 1.4s; | ||
} | ||
|
||
.star::before, | ||
.star::after { | ||
content: ''; | ||
position: absolute; | ||
top: calc(50% - 2px); | ||
right: 0; | ||
height: 4px; | ||
background: linear-gradient( | ||
-45deg, | ||
rgba(0, 0, 255, 0), | ||
#457df6, | ||
rgba(0, 0, 255, 0) | ||
); | ||
border-radius: 100%; | ||
transform: translateX(50%) rotateZ(45deg); | ||
animation: shining 3s ease-in-out infinite; | ||
} | ||
|
||
@keyframes shining { | ||
0% { | ||
width: 0; | ||
} | ||
|
||
.star:nth-child(4){ | ||
top: calc(50% - -50px); | ||
left: calc(50% - 200px); | ||
animation-delay: 1.6s; | ||
50% { | ||
width: 60px; | ||
} | ||
|
||
.star:nth-child(4)::before, .star:nth-child(4)::after{ | ||
animation-delay: 1.6s; | ||
100% { | ||
width: 0; | ||
} | ||
|
||
.star:nth-child(5){ | ||
top: calc(50% - -100px); | ||
left: calc(50% - 250px); | ||
animation-delay: 1.8s; | ||
} | ||
|
||
.star::after { | ||
transform: translateX(50%) rotateZ(-45deg); | ||
} | ||
|
||
.star:nth-child(1) { | ||
top: calc(50% - 100px); | ||
left: calc(50% - 250px); | ||
animation-delay: 1s; | ||
} | ||
|
||
.star:nth-child(1)::before, | ||
.star:nth-child(1)::after { | ||
animation-delay: 1s; | ||
} | ||
|
||
.star:nth-child(2) { | ||
top: calc(50% - 50px); | ||
left: calc(50% - 200px); | ||
animation-delay: 1.2s; | ||
} | ||
|
||
.star:nth-child(2)::before, | ||
.star:nth-child(2)::after { | ||
animation-delay: 1.2s; | ||
} | ||
|
||
.star:nth-child(3) { | ||
top: calc(50% - 0px); | ||
left: calc(50% - 150px); | ||
animation-delay: 1.4s; | ||
} | ||
|
||
.star:nth-child(3)::before, | ||
.star:nth-child(3)::after { | ||
animation-delay: 1.4s; | ||
} | ||
|
||
.star:nth-child(4) { | ||
top: calc(50% - -50px); | ||
left: calc(50% - 200px); | ||
animation-delay: 1.6s; | ||
} | ||
|
||
.star:nth-child(4)::before, | ||
.star:nth-child(4)::after { | ||
animation-delay: 1.6s; | ||
} | ||
|
||
.star:nth-child(5) { | ||
top: calc(50% - -100px); | ||
left: calc(50% - 250px); | ||
animation-delay: 1.8s; | ||
} | ||
|
||
.star:nth-child(5)::before, | ||
.star:nth-child(5)::after { | ||
animation-delay: 1.8s; | ||
} | ||
|
||
@keyframes change-color-anim { | ||
0%, | ||
100% { | ||
background-color: #929090; | ||
} | ||
|
||
.star:nth-child(5)::before, .star:nth-child(5)::after{ | ||
animation-delay: 1.8s; | ||
50% { | ||
background-color: #000000; | ||
} | ||
|
||
|
||
@keyframes change-color-anim { | ||
0%,100%{ | ||
background-color: #929090; | ||
} | ||
50%{ | ||
background-color: #000000; | ||
} | ||
} | ||
} |