forked from concordia-fsae/formula_website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteam.js
98 lines (82 loc) · 2.8 KB
/
team.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
//work in progress
const menu = document.querySelector('.menu');
const close = document.querySelector('.close');
const nav = document.querySelector('nav');
menu.addEventListener('click', () => {
nav.classList.add('open-nav');
})
close.addEventListener('click', () => {
nav.classList.remove('open-nav');
})
//these final three closes the menu when an item of the menu is clicked
const aboutUs = document.getElementById('aboutUs');
const history = document.getElementById('history'); // Changed from subsystems to history
const contact = document.getElementById('contact');
history.addEventListener('click', () => {
nav.classList.remove('open-nav');
});
aboutUs.addEventListener('click', () => {
nav.classList.remove('open-nav');
});
contact.addEventListener('click', () => {
nav.classList.remove('open-nav');
});
//This makes header background appear white when scrolling down 20 px.
// window.onscroll = function() {scrollFunction()};
// function scrollFunction() {
// if (window.innerWidth > 750){
// if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
// document.querySelectorAll(".burger-items").forEach(item => {
// item.style.background = "rgba(255,255,255,0.8)";
// })
// }
// else {
// document.querySelectorAll(".burger-items").forEach(item => {
// item.style.background = "unset";
// })
// }
// }
// }
// this is the full google maps java code
// Initialize and add the map
let map;
async function initMap() {
// The location of CONCORDIA FORMULA RACING
const position = { lat: 45.497296578930325, lng: -73.57879827627701 };
// Request needed libraries.
//@ts-ignore
const { Map } = await google.maps.importLibrary("maps");
const { AdvancedMarkerElement } = await google.maps.importLibrary("marker");
// The map, centered at Uluru
map = new Map(document.getElementById("map"), {
zoom: 13, // ZOOM IS RESPONSIBLE OF HOW ZOOMED IN WE ARE (0 BEING THE VIEW OF THE WHOLE EARTH)
center: position,
mapId: "DEMO_MAP_ID",
});
// The marker, positioned at Uluru
const marker = new AdvancedMarkerElement({
map: map,
position: position,
title: "CONCORDIA FORMULA RACING",
});
}
initMap();
// animation java script
const observer = new IntersectionObserver ((entries) => {
entries.forEach((entry) => {
// console.log(entry)
if (entry.isIntersecting) {
entry.target.classList.add('show');
if (entry.target.classList.contains('noMove')) {
entry.target.classList.add('move');
}
} else {
entry.target.classList.remove('show');
if (entry.target.classList.contains('noMove')) {
entry.target.classList.remove('move');
}
}
});
});
const hiddenElements = document.querySelectorAll('.hidden');
hiddenElements.forEach((el) => observer.observe(el));