-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
122 lines (102 loc) · 3.13 KB
/
script.js
File metadata and controls
122 lines (102 loc) · 3.13 KB
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
//Hamburger Variables Created
const hamburger = document.querySelector(".hamburger");
const menu = document.querySelector(".menu");
//Event Listener for Hamburger Created
hamburger.addEventListener("click", () => {
hamburger.classList.toggle("active");
menu.classList.toggle("active");
})
//Lists Items in Hamburger
document.querySelectorAll(".item").forEach(n => n.addEventListener("click", () => {
hamburger.classList.remove("active");
menu.classList.remove("active");
}))
//Creates Variables to Count Slide Index
let slideIndex = 0;
showSlides();
//Shows Slides on an Automated Timer
function showSlides() {
let i;
let slides = document.getElementsByClassName("mySlides");
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slideIndex++;
if (slideIndex > slides.length) {slideIndex = 1}
slides[slideIndex-1].style.display = "block";
setTimeout(showSlides, 5000);
}
//Creates Variables to Count Slide Index
let slideIndex2 = 0;
showSlides2();
//Shows Slides on an Automated Timer
function showSlides2() {
let i1;
let slides = document.getElementsByClassName("mySlides2");
for (i1 = 0; i1 < slides.length; i1++) {
slides[i1].style.display = "none";
}
slideIndex2++;
if (slideIndex2 > slides.length) {slideIndex2 = 1}
slides[slideIndex2-1].style.display = "block";
setTimeout(showSlides2, 5100);
}
//Creates Variables to Count Slide Index
let slideIndex3 = 0;
showSlides3();
//Shows Slides on an Automated Timer
function showSlides3() {
let slides = document.getElementsByClassName("mySlides3");
for (i1 = 0; i1 < slides.length; i1++) {
slides[i1].style.display = "none";
}
slideIndex3++;
if (slideIndex3 > slides.length) {slideIndex3 = 1}
slides[slideIndex3-1].style.display = "block";
setTimeout(showSlides3, 5200);
}
//Redirects to About Page
function pageAbout() {
window.location.href = "./about";
}
//Redirects to Apply Page
function pageApply() {
window.location.href = "./apply";
}
//Redirects to STREAM Page
function pageSTREAM() {
window.location.href = "./stream";
}
//Redirects to Contact Page
function pageContact() {
window.location.href = "./contact";
}
//Redirects to Home Page
function pageIndex() {
window.location.href = "https://www.upstreamprogram.org/";
}
//Redirects to Email
function pageEmail() {
window.location.href = "mailto:upstreamprogram@gmail.com";
}
//Redirects to Phone Number
function pagePhone() {
window.location.href = "tel:+12064864950";
}
//Redirects to Seattle Map
function pageLocation() {
window.open("https://www.google.com/maps/place/Seattle,+WA");
}
//Checks for Safari
function isSafari() {
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
}
//Adds Indent to Safari
if (isSafari()) {
var indent1 = document.getElementById("indent1");
indent1.innerHTML = "<br>";
var indent2 = document.getElementById("indent2");
indent2.innerHTML = "<br>";
var indent3 = document.getElementById("indent3");
indent3.innerHTML = "<br>";
}