-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 24, 2023
1 parent
86dd3f2
commit c6a793c
Showing
7 changed files
with
118 additions
and
119 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,18 +1,16 @@ | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<link rel="stylesheet" href="style.css"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Light Bulb Animation</title> | ||
</head> | ||
|
||
<body> | ||
<div class="box"> | ||
<span></span> | ||
</div> | ||
</body> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<link rel="stylesheet" href="style.css" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Light Bulb Animation</title> | ||
</head> | ||
|
||
</html> | ||
<body> | ||
<div class="box"> | ||
<span></span> | ||
</div> | ||
</body> | ||
</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,50 +1,49 @@ | ||
* { | ||
padding: 0; | ||
margin: 0; | ||
box-sizing: border-box; | ||
padding: 0; | ||
margin: 0; | ||
box-sizing: border-box; | ||
} | ||
|
||
body { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background: #333; | ||
min-height: 100vh; | ||
overflow: hidden; | ||
} | ||
|
||
.box { | ||
position: relative; | ||
width: 500px; | ||
height: 500px; | ||
} | ||
|
||
.box span { | ||
position: absolute; | ||
inset: 0; | ||
} | ||
|
||
.box span::before { | ||
content: ''; | ||
position: absolute; | ||
width: 350px; | ||
height: 400px; | ||
left: 15%; | ||
background: url('https://i.ibb.co/C1S9Vwn/bulb-off.jpg'); | ||
background-size: cover; | ||
background-position: center; | ||
transform: scale(0.8); | ||
animation: animate 2s linear infinite; | ||
border-bottom: 10px ridge #fff; | ||
} | ||
|
||
@keyframes animate { | ||
0%, | ||
100% { | ||
background: url('https://i.ibb.co/C1S9Vwn/bulb-off.jpg'); | ||
} | ||
|
||
body { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background: #333; | ||
min-height: 100vh; | ||
overflow: hidden; | ||
50% { | ||
background: url('https://i.ibb.co/SXmm4cd/bulb-on.jpg'); | ||
} | ||
|
||
.box { | ||
position: relative; | ||
width: 500px; | ||
height: 500px; | ||
} | ||
|
||
.box span { | ||
position: absolute; | ||
inset: 0; | ||
} | ||
|
||
.box span::before { | ||
content: ""; | ||
position: absolute; | ||
width: 350px; | ||
height: 400px; | ||
left: 15%; | ||
background: url("https://i.ibb.co/C1S9Vwn/bulb-off.jpg"); | ||
background-size: cover; | ||
background-position: center; | ||
transform: scale(0.8); | ||
animation: animate 2s linear infinite; | ||
border-bottom: 10px ridge #fff; | ||
} | ||
|
||
@keyframes animate { | ||
0%, | ||
100% { | ||
background: url("https://i.ibb.co/C1S9Vwn/bulb-off.jpg"); | ||
} | ||
50% { | ||
background: url("https://i.ibb.co/SXmm4cd/bulb-on.jpg"); | ||
} | ||
} | ||
|
||
} |
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
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,45 +1,45 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="stylesheet" href="solar_system.css"> | ||
</head> | ||
<body> | ||
<div class="solar-system"> | ||
<div class="sun"></div> | ||
<div class="orbit mercury-orbit"> | ||
<div class="planet mercury"></div> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="stylesheet" href="solar_system.css" /> | ||
</head> | ||
<body> | ||
<div class="solar-system"> | ||
<div class="sun"></div> | ||
<div class="orbit mercury-orbit"> | ||
<div class="planet mercury"></div> | ||
</div> | ||
<div class="orbit venus-orbit"> | ||
<div class="planet venus"></div> | ||
</div> | ||
<div class="orbit earth-orbit"> | ||
<div class="planet earth"></div> | ||
</div> | ||
<div class="orbit mars-orbit"> | ||
<div class="planet mars"></div> | ||
</div> | ||
</div> | ||
<div class="orbit venus-orbit"> | ||
<div class="planet venus"></div> | ||
</div> | ||
<div class="orbit earth-orbit"> | ||
<div class="planet earth"></div> | ||
</div> | ||
<div class="orbit mars-orbit"> | ||
<div class="planet mars"></div> | ||
</div> | ||
</div> | ||
<div class="stars"></div> | ||
<script> | ||
function createRandomStars() { | ||
const numberOfStars = 100; | ||
const starsContainer = document.querySelector('.stars'); | ||
<div class="stars"></div> | ||
<script> | ||
function createRandomStars() { | ||
const numberOfStars = 100; | ||
const starsContainer = document.querySelector('.stars'); | ||
|
||
for (let i = 0; i < numberOfStars; i++) { | ||
const star = document.createElement('div'); | ||
star.className = 'star'; | ||
star.style.left = `${Math.random() * 100}vw`; | ||
star.style.top = `${Math.random() * 100}vh`; | ||
star.style.width = `${Math.random() * 80}px`; | ||
star.style.height = star.style.width; | ||
const twinklingTime = Math.random() * 5 + 0.5; | ||
star.style.animation = `twinkle ${twinklingTime}s infinite`; | ||
starsContainer.appendChild(star); | ||
for (let i = 0; i < numberOfStars; i++) { | ||
const star = document.createElement('div'); | ||
star.className = 'star'; | ||
star.style.left = `${Math.random() * 100}vw`; | ||
star.style.top = `${Math.random() * 100}vh`; | ||
star.style.width = `${Math.random() * 80}px`; | ||
star.style.height = star.style.width; | ||
const twinklingTime = Math.random() * 5 + 0.5; | ||
star.style.animation = `twinkle ${twinklingTime}s infinite`; | ||
starsContainer.appendChild(star); | ||
} | ||
} | ||
} | ||
createRandomStars(); | ||
</script> | ||
</body> | ||
createRandomStars(); | ||
</script> | ||
</body> | ||
</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,11 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<link rel="stylesheet" type="text/css" href="styles.css"> | ||
</head> | ||
<body> | ||
<head> | ||
<link rel="stylesheet" type="text/css" href="styles.css" /> | ||
</head> | ||
<body> | ||
<div class="colorful-background"> | ||
<div class="animated-text">This is a colorful background animation in CSS</div> | ||
<div class="animated-text"> | ||
This is a colorful background animation in CSS | ||
</div> | ||
</div> | ||
</body> | ||
</body> | ||
</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
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