-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathproject.codee
More file actions
39 lines (34 loc) · 795 Bytes
/
project.codee
File metadata and controls
39 lines (34 loc) · 795 Bytes
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
29
30
31
32
33
34
35
36
37
38
39
###>><</CODEEBOX_SEPARATOR
<div id="container">
<button>Party?</button>
</div>
###>><</CODEEBOX_SEPARATOR
button {
background-color: #05f;
color: white;
border: none;
padding: .7em 1em;
font-size: 20px;
transition: background-color 100ms ease-in-out;
}
button:hover {
background-color: #04e;
}
body {
margin: 0;
padding: 0;
}
#container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
width: 100vw;
}
###>><</CODEEBOX_SEPARATOR
import canvasconfetti from 'https://cdn.skypack.dev/canvas-confetti'
const $ = sel => document.querySelector(sel)
$('button').addEventListener('click', () => {
canvasconfetti();
$('button').innerText = $('button').innerText === 'Party?' ? 'Party!' : 'Party?'
})