-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
49 lines (36 loc) · 1.74 KB
/
main.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
var onda1 = document.getElementById('onda1')
var onda2 = document.getElementById('onda2')
var onda3 = document.getElementById('onda3')
var onda4 = document.getElementById('onda4')
window.addEventListener('scroll', function(){
var rolagemPos = window.scrollY
onda1.style.backgroundPositionX = 400 + rolagemPos * 4 + 'px';
onda2.style.backgroundPositionX = 300 + rolagemPos * -4 + 'px';
onda3.style.backgroundPositionX = 200 + rolagemPos * 2 + 'px';
onda4.style.backgroundPositionX = 100 + rolagemPos * -2 + 'px';
})
var colheitadeira = document.querySelector('.colheitadeira-image');
window.addEventListener('scroll', function() {
var rolagemPos = window.scrollY;
colheitadeira.style.left = 50 + rolagemPos * 2 + 'px';
});
document.getElementById('menu-toggle').addEventListener('click', function() {
const menu = document.querySelector('nav ul');
const overlay = document.getElementById('overlay');
menu.classList.toggle('active');
overlay.classList.toggle('active');
});s
document.getElementById('overlay').addEventListener('click', function() {
const menu = document.querySelector('nav ul');
const overlay = document.getElementById('overlay');
menu.classList.remove('active');
overlay.classList.remove('active');
});
document.getElementById('menu-toggle').addEventListener('click', function() {
document.querySelector('nav ul').classList.toggle('active');
document.getElementById('overlay').classList.toggle('active');
});
document.getElementById('overlay').addEventListener('click', function() {
document.querySelector('nav ul').classList.remove('active');
document.getElementById('overlay').classList.remove('active');
});