-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.js
181 lines (149 loc) · 4.89 KB
/
style.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
//Making pre-loader
window.onload = function() {
var loadingScreen = document.getElementById("loading-screen");
loadingScreen.style.display = "none";
}
//Making slideshow functions
function openSlideshow(slideIndex) {
var slides = document.querySelectorAll(".imageContainer1 img");
if (slides.length === 0) {
return;
}
document.getElementById("slideshow-img").src = slides[slideIndex-1].src;
document.getElementById("slideshow").style.display = "flex";
slideIndex = parseInt(slideIndex);
}
function closeSlideshow() {
document.getElementById("slideshow").style.display = "none";
}
var slideIndex = 1;
showSlide(slideIndex);
function prevSlide() {
showSlide(slideIndex -= 1);
}
function nextSlide() {
showSlide(slideIndex += 1);
}
function showSlide(index) {
var slides = document.querySelectorAll(".imageContainer1 img");
if (slides.length === 0) {
return;
}
slideIndex = index;
if (slideIndex < 1) {
slideIndex = slides.length;
} else if (slideIndex > slides.length) {
slideIndex = 1;
}
document.getElementById("slideshow-img").src = slides[slideIndex-1].src;
}
//Making the second slideshow
function openSlideshow2(slideIndex) {
var slides = document.querySelectorAll(".imageContainer2 img");
if (slides.length === 0) {
return;
}
document.getElementById("slideshow2-img").src = slides[slideIndex-1].src;
document.getElementById("slideshow2").style.display = "flex";
slideIndex = parseInt(slideIndex);
}
function closeSlideshow2() {
document.getElementById("slideshow2").style.display = "none";
}
var slideIndex = 1;
showSlide2(slideIndex);
function prevSlide2() {
showSlide2(slideIndex -= 1);
}
function nextSlide2() {
showSlide2(slideIndex += 1);
}
function showSlide2(index) {
var slides = document.querySelectorAll(".imageContainer2 img");
if (slides.length === 0) {
return;
}
slideIndex = index;
if (slideIndex < 1) {
slideIndex = slides.length;
} else if (slideIndex > slides.length) {
slideIndex = 1;
}
document.getElementById("slideshow2-img").src = slides[slideIndex-1].src;
}
//Makin the slideshow for the art exhibit
function openSlideshow3(slideIndex) {
var slides = document.querySelectorAll(".artContainer1 img");
if (slides.length === 0) {
return;
}
document.getElementById("slideshow3-img").src = slides[slideIndex-1].src;
document.getElementById("slideshow3").style.display = "flex";
slideIndex = parseInt(slideIndex);
}
function closeSlideshow3() {
document.getElementById("slideshow3").style.display = "none";
}
var slideIndex = 1;
showSlide3(slideIndex);
function prevSlide3() {
showSlide3(slideIndex -= 1);
}
function nextSlide3() {
showSlide3(slideIndex += 1);
}
function showSlide3(index) {
var slides = document.querySelectorAll(".artContainer1 img");
if (slides.length === 0) {
return;
}
slideIndex = index;
if (slideIndex < 1) {
slideIndex = slides.length;
} else if (slideIndex > slides.length) {
slideIndex = 1;
}
document.getElementById("slideshow3-img").src = slides[slideIndex-1].src;
}
//Locating the containers
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener('keydown', function(event) {
if (event.code === 'ArrowLeft') {
prevSlide();
} else if (event.code === 'ArrowRight') {
nextSlide();
}
});
const homeButton = document.getElementById("homeButton");
const aboutButton = document.getElementById("aboutButton");
const designButton = document.getElementById("designButton");
const artButton = document.getElementById("artButton");
//Containers
const archContainer = document.getElementById("architectContainer");
const artContainer = document.getElementById("artContainer");
const aboutContainer = document.getElementById("aboutContainer");
designButton.addEventListener("click", () => {
archContainer.style.display = 'block';
//turning off the other containers
artContainer.style.display = "none";
aboutContainer.style.display = "none";
});
artButton.addEventListener("click", () => {
artContainer.style.display = 'block';
//Turning the other containers off
archContainer.style.display = "none";
aboutContainer.style.display = "none";
});
aboutButton.addEventListener("click", () => {
aboutContainer.style.display = 'block';
//turning off the other containers
archContainer.style.display = "none";
artContainer.style.display = "none";
});
homeButton.addEventListener("click", () => {
archContainer.style.display = "none";
artContainer.style.display = "none";
aboutContainer.style.display = "none";
});
//Making the buttons to alternate windows
});