-
Notifications
You must be signed in to change notification settings - Fork 0
/
my_app.js
129 lines (108 loc) · 3.41 KB
/
my_app.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
$(document).ready(function(){
//The following line comes from the imagesloaded.pkgd.min.js library. It checks that the cover image is loaded before animations start.
$('.cover').imagesLoaded(function(){
function widthLimiter() {
if (x.matches){
$('.cover').animate({height: '80%'}, 1000, 'swing')
$('.cover').animate({width: '80%'}, 1200, 'swing')
}
else{
$('.cover').animate({height: '100%'}, 1000, 'swing')
}
}
var x = window.matchMedia("(min-width: 700px)")
widthLimiter(x)
x.addListener(widthLimiter)
$('#slider1').delay(1000).animate({left: '100%'}, 1200, 'swing')
});
// Init Scroll Magic
var controller = new ScrollMagic.Controller();
// Build a scene--SUN-LOGO
var sunTopHalfScene = new ScrollMagic.Scene({
triggerElement: '#section2',
triggerHook: 0.6
// This is where triggerHook will go: triggerHook: 1 for example. Remember to add comma after last command...
// reverse: false --- if we want the animation to only happen once...
})
.setClassToggle('#sun-top-half', 'fade-in') //add class to sun-top-half
// .addIndicators({})
.addTo(controller);
var project01Slider = new ScrollMagic.Scene({
triggerElement: '#project01-slider',
// reverse: false
triggerHook: 0.9
})
.setClassToggle('#project01-slider', 'slide-from-right') //add class
.addTo(controller);
var project02Slider = new ScrollMagic.Scene({
triggerElement: '#project02-slider',
// reverse: false
triggerHook: 0.9
})
.setClassToggle('#project02-slider', 'slide-from-left') //add class
.addTo(controller);
var project03Slider = new ScrollMagic.Scene({
triggerElement: '#project03-slider',
// reverse: false
triggerHook: 0.9
})
.setClassToggle('#project03-slider', 'slide-from-right') //add class
.addTo(controller);
var project04Slider = new ScrollMagic.Scene({
triggerElement: '#project04-slider',
// reverse: false
triggerHook: 0.9
})
.setClassToggle('#project04-slider', 'slide-from-left') //add class
.addTo(controller);
//**********************************************vvvvvvvvvv******************TO BE UPDATED*************************
// WORK EXPERIENCE
// Stone3
var stone3Slider = new ScrollMagic.Scene({
triggerElement: '#section4',
triggerHook: 0.2
})
.setClassToggle('#stone3-slider', 'slide-down')
.addTo(controller);
var stone3Content = new ScrollMagic.Scene({
triggerElement: '#section4',
triggerHook: 0.2
})
.setClassToggle('#stone3-content', 'slide-up')
.addTo(controller);
// YellowTail
var ytSlider = new ScrollMagic.Scene({
triggerElement: '#section4',
triggerHook: 0.2
})
.setClassToggle('#yt-slider', 'slide-up')
.addTo(controller);
var ytContent = new ScrollMagic.Scene({
triggerElement: '#section4',
triggerHook: 0.2
})
.setClassToggle('#yt-content', 'slide-down')
.addTo(controller);
// WildClover
var wildCloverSlider = new ScrollMagic.Scene({
triggerElement: '#section4',
triggerHook: 0.2
})
.setClassToggle('#wildclover-slider', 'slide-down')
.addTo(controller);
var wildCloverContent = new ScrollMagic.Scene({
triggerElement: '#section4',
triggerHook: 0.2
})
.setClassToggle('#wildclover-content', 'slide-up')
.addTo(controller);
});
document.addEventListener('DOMContentLoaded', () => {
const menuLinks = document.querySelectorAll('.options a');
const menuBtn = document.querySelector('.menu-btn');
menuLinks.forEach((menuLink) => {
menuLink.addEventListener('click', () => {
menuBtn.checked = false;
})
})
})