-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjs.js
51 lines (45 loc) · 1.63 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
let count = 0
const p1b1 = document.getElementById('p1b1')
const p2b1 = document.getElementById('p2b1')
const pg1 = document.getElementById('page1')
const pg3 = document.getElementById('page3')
p1b1.addEventListener('click', function () {
count = count + 1
console.log(count)
var t1 = document.getElementById('p1t1')
t1.innerHTML = "Fool!"
p1b1.remove()
document.querySelector("#page1").style.animationPlayState = 'paused'
})
let rickRollCount = 0
const p2t1 = document.getElementById('p2t1')
p2b1.addEventListener('click', function () {
rickRollCount += 1
if (rickRollCount == 1) {
const para1 = document.createElement("p")
const para2 = document.createElement("p")
const txt1 = document.createTextNode("Good Job! I indeed did not tell you to not press this one!")
const txt2 = document.createTextNode("Press It Again")
para1.appendChild(txt1)
para2.appendChild(txt2)
p2t1.appendChild(para1)
page2.appendChild(para2)
} else {
document.querySelector("#page2").style.animationPlayState = 'running'
}
})
let c = 0
const p3t1 = document.getElementById("p3t1")
const p3b1 = document.getElementById("p3b1")
p3b1.addEventListener('click', function () {
p3t1.innerHTML = ""
p3b1.addEventListener('click', function () {
c++
document.querySelector("#p3b1").style.position = 'fixed'
if (c % 2 != 0) {
p3t1.innerHTML = p3t1.innerHTML + "<span>click-</span>"
} else {
p3t1.innerHTML = p3t1.innerHTML + "<span>clack-</span>"
}
})
})