html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!-- Created by TecSha -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Party Popper Shower</title>
</head>
<body>
<div class="container">
<button id="start-button">Start the Party!</button>
<div class="popper-container"></div>
</div>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* Created by TecSha */
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
}
.container {
width: 80%;
margin: 40px auto;
text-align: center;
}
#start-button {
padding: 10px 20px;
font-size: 18px;
cursor: pointer;
}
.popper-container {
position: relative;
width: 100%;
height: 600px;
overflow: hidden;
}
.popper {
position: absolute;
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Created by TecSha
document.addEventListener("DOMContentLoaded", ()=>{
const startButton = document.getElementById('start-button');
const popperContainer = document.querySelector('.popper-container');
startButton.addEventListener('click', startParty );
function startParty() {
startButton.disabled = true;
let intervalId = setInterval(createPopper, 200);
setTimeout(() => {
clearInterval(intervalId);
startButton.disabled = false;
}, 10000);
}
function createPopper() {
const popper = document.createElement('div');
popper.classList.add('popper');
popper.style.left = `${Math.random() * 80}%`;
popper.style.animationDelay = `${Math.random() * 2}s`;
popperContainer.appendChild(popper);
setTimeout(() => {
popper.remove();
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run