-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
82 lines (59 loc) · 1.75 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
let leftLeaves = document.querySelector('.leafL');
let rightLeaves = document.querySelector('.leafR');
let tween = gsap.timeline()
tween.to('.leafL', {
duration: 2,
y: 10,
rotation: 30,
ease: "power1.out",
width: 150,
stagger: 0.3
}, 0)
.to('.leafR', {
duration: 2,
y: 10,
rotation: 150,
ease: "power1.out",
width: 150,
stagger: 0.3
}, 0)
const controller = new ScrollMagic.Controller();
const scene = new ScrollMagic.Scene({
triggerElement: '.plants-home',
duration: '100%',
triggerHook: 0
})
.setTween(tween)
.addTo(controller)
let strategy = brand = ux = web = marketing = false
function showText(e) {
const text = document.querySelector(`#${e}-text`);
const chevron = document.querySelector(`#${e}-chevron`);
if (text.style.maxHeight != '800px' || text.style.maxHeight === null) {
chevron.style.rotate = '180deg'
text.style.maxHeight = '800px';
text.style.opacity = 1;
} else {
chevron.style.rotate = '0deg'
text.style.maxHeight = '0';
text.style.opacity = 0;
}
}
new ScrollMagic.Scene({
triggerElement: "#about",
triggerHook: 0.9 // show, when scrolled 10% into view
})
.setClassToggle("#about", "visible") // add class to reveal
.addTo(controller);
new ScrollMagic.Scene({
triggerElement: "#work",
triggerHook: 0.9 // show, when scrolled 10% into view
})
.setClassToggle("#work", "visible") // add class to reveal
.addTo(controller);
new ScrollMagic.Scene({
triggerElement: "#meetteam",
triggerHook: 0.9 // show, when scrolled 10% into view
})
.setClassToggle("#meetteam", "visible") // add class to reveal
.addTo(controller);