-
Notifications
You must be signed in to change notification settings - Fork 2
/
script.js
149 lines (119 loc) · 4.58 KB
/
script.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
//Documentation: https://scrollmagic.io/docs/ScrollMagic.Scene.html
//Controller
let controller = new ScrollMagic.Controller();
// ––––––––– New scene - SCENE 1 –––––––––
let scene1 = new ScrollMagic.Scene({
//Choose trigger element
triggerElement: '.frames--frame1'
})
//Give trigger element a toggle, and class
.setClassToggle('.frames--frame1', 'show1')
//Add the scene to the controller
.addTo(controller)
// ––––––––– New scene - SCENE 2 –––––––––
let scene2 = new ScrollMagic.Scene({
//Choose trigger element
triggerElement: '.frames--frame2'
})
//Give trigger element a toggle, and class
.setClassToggle('.frames--frame2', 'show2')
//Add the scene to the controller
.addTo(controller)
// ––––––––– New Scene - SCENE 3 –––––––––
let scene3 = new ScrollMagic.Scene({
//Choose trigger element
triggerElement: '.frames--frame3'
})
//Give trigger element a toggle, and class
.setClassToggle('.frames--frame3', 'show3')
//Add the scene to the controller
.addTo(controller)
// ––––––––– New Scene - SCENE 4 –––––––––
let scene4 = new ScrollMagic.Scene({
//Choose trigger element
triggerElement: '.frames--frame4'
})
//Give trigger element a toggle, and class
.setClassToggle('.frames--frame4', 'show4')
//Add the scene to the controller
.addTo(controller)
// ––––––––– New Scene - SCENE 5 –––––––––
let scene5 = new ScrollMagic.Scene({
//Choose trigger element
triggerElement: '.frames--frame5'
})
//Give trigger element a toggle, and class
.setClassToggle('.frames--frame5', 'show5')
//Add the scene to the controller
.addTo(controller)
// ––––––––– New Scene - SCENE 6 –––––––––
let scene6 = new ScrollMagic.Scene({
//Choose trigger element
triggerElement: '.frames--frame6'
})
//Give trigger element a toggle, and class
.setClassToggle('.frames--frame6', 'show6')
//Add the scene to the controller
.addTo(controller)
// ––––––––– New Scene - SCENE 7 –––––––––
let scene7 = new ScrollMagic.Scene({
//Choose trigger element
triggerElement: '.frames--frame7'
})
//Give trigger element a toggle, and class
.setClassToggle('.frames--frame7', 'show7')
//Add the scene to the controller
.addTo(controller)
// ––––––––– New Scene - SCENE 8 –––––––––
let scene8 = new ScrollMagic.Scene({
//Choose trigger element
triggerElement: '.frames--frame8'
})
//Give trigger element a toggle, and class
.setClassToggle('.frames--frame8', 'show8')
//Add the scene to the controller
.addTo(controller)
// ––––––––– New Scene - SCENE 9 –––––––––
let scene9 = new ScrollMagic.Scene({
//Choose trigger element
triggerElement: '.frames--frame9'
})
//Give trigger element a toggle, and class
.setClassToggle('.frames--frame9', 'show9')
//Add the scene to the controller
.addTo(controller)
// ––––––––– New Scene - SCENE 10 –––––––––
let scene10 = new ScrollMagic.Scene({
//Choose trigger element
triggerElement: '.frames--frame10'
})
//Give trigger element a toggle, and class
.setClassToggle('.frames--frame10', 'show10')
//Add the scene to the controller
.addTo(controller)
// ––––––––– New Scene - SCENE 11 –––––––––
let scene11 = new ScrollMagic.Scene({
//Choose trigger element
triggerElement: '.frames--frame11'
})
//Give trigger element a toggle, and class
.setClassToggle('.frames--frame11', 'show11')
//Add the scene to the controller
.addTo(controller)
//Function that scroll back to top when 'topBtn' is clicked
document.getElementById("topBtn").onclick = function() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
//Get the information frame, an put it into a variable
const infoFrame = document.querySelector("#infoFrame");
//Make the information frame hidden by default
infoFrame.style.visibility = 'hidden';
//Function that makes the information frame visible when 'infoBtn' is clicked
document.getElementById("infoBtn").onclick = function() {
infoFrame.style.visibility = 'visible';
}
//Function that makes the information frame hidden when 'closeBtn' is clicked
document.getElementById("closeBtn").onclick = function() {
infoFrame.style.visibility = 'hidden';
}