Add files via upload
This commit is contained in:
parent
f0a806810a
commit
ab7d889e89
11
100_projects/86-white-snow-rain/index.html
Normal file
11
100_projects/86-white-snow-rain/index.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>White Snow Rain</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
<script src="script.js" defer></script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
15
100_projects/86-white-snow-rain/script.js
Normal file
15
100_projects/86-white-snow-rain/script.js
Normal file
@ -0,0 +1,15 @@
|
||||
function createSnow () {
|
||||
const snow = document.createElement("div");
|
||||
snow.classList.add("snow");
|
||||
snow.style.left = Math.random() * 100 + "vw";
|
||||
snow.style.animationDuration = Math.random() * 2 + 3 + "s";
|
||||
|
||||
snow.innerText = "❄️️";
|
||||
|
||||
document.body.appendChild(snow);
|
||||
|
||||
setTimeout(() => {
|
||||
snow.remove();
|
||||
}, 5000);
|
||||
}
|
||||
setInterval(createSnow, 300);
|
23
100_projects/86-white-snow-rain/style.css
Normal file
23
100_projects/86-white-snow-rain/style.css
Normal file
@ -0,0 +1,23 @@
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
background: #ADD8E6;
|
||||
}
|
||||
.snow {
|
||||
position: fixed;
|
||||
top: -1vh;
|
||||
font-size: 2rem;
|
||||
transform: translateY(0);
|
||||
animation: fall 3s linear forwards;
|
||||
}
|
||||
@keyframes fall {
|
||||
to {
|
||||
transform: translateY(105vh);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user