Skip to content

Commit 6452e80

Browse files
authored
Merge pull request #13 from uross-11/main
Added thunder on critical strike
2 parents 9fcea1e + 800330e commit 6452e80

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

crit.webp

48.3 KB
Loading

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<link rel="stylesheet" type="text/css" href="main.css">
99
</head>
1010
<body>
11+
<img src="crit.webp" id="critImg">
1112
<div id="popup">
1213
<div id="popupText">
1314
0

index.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ const eventsTable = [
7070
clickMe.disabled = true;
7171
clickMeText.innerText = `You broke it`;
7272
playFart(critFart);
73+
critImg.animate([
74+
{ opacity: 0 },
75+
{ opacity: 1 },
76+
{ opacity: 0 }
77+
], {
78+
duration: 1000,
79+
fill: "forwards"
80+
});
7381
},
7482
},
7583
{
@@ -116,6 +124,7 @@ const eventsTable = [
116124
{
117125
onCount: 69,
118126
action: () => {
127+
// TODO: add this sound here https://www.youtube.com/watch?v=3WAOxKOmR90
119128
clickMe.disabled = true;
120129
clickMeText.innerText = `Nice!`;
121130
playFart(critFart);
@@ -129,7 +138,17 @@ const eventsTable = [
129138
onCount: 100,
130139
action: () => {
131140
clickMe.disabled = true;
132-
setTimeout(() => clickMe.disabled = false, 3000);
141+
setTimeout(() => {
142+
clickMe.disabled = false;
143+
critImg.animate([
144+
{ opacity: 0 },
145+
{ opacity: 1 },
146+
{ opacity: 0 }
147+
], {
148+
duration: 1000,
149+
fill: "forwards"
150+
});
151+
}, 3000);
133152
clickMeText.innerText = `HERE COMES THE BIG ONE`;
134153
playFart(bigoneFart);
135154
}

main.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
body {
2+
margin: 0;
3+
}
14
.center {
25
position: absolute;
36
left: 50%;
@@ -16,6 +19,13 @@
1619
user-select: none;
1720
-webkit-user-select: none;
1821
}
22+
#critImg {
23+
opacity: 0;
24+
position: absolute;
25+
height: 100%;
26+
width: 100%;
27+
object-fit: cover;
28+
}
1929
#popup {
2030
visibility: hidden;
2131
position: absolute;
@@ -35,4 +45,4 @@
3545
}
3646
.customCursor {
3747
cursor: url("peach-emoji.png"), auto;
38-
}
48+
}

0 commit comments

Comments
 (0)