-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
206 lines (191 loc) · 7.82 KB
/
script.js
File metadata and controls
206 lines (191 loc) · 7.82 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
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
// let blogRow = document.getElementById("blogRow")
// axios.get("http://localhost:5000/api/v1/blog/blogs")
// .then((response) => {
// let data = response.data;
// console.log(data);
// data.forEach(data => {
// blogRow.innerHTML += `
// <div class="my-3 col col-lg-12 col-md-12 col-12">
// <div class="card pb-3 d-flex flex-row border-0">
// <div class="card-img">
// <img src="${data.File}" style="border-radius: 50%;" class="" width="100px" height="100px" alt="...">
// </div>
// <div class="text text-start">
// <h5 class="card-title my-3">${data.Title}</h5>
// <p class="card-text">${data.Message}</p>
// </div>
// </div>
// </div>
// `
// });
// })
// const backgrounds = [
// {
// category: "Friendly Debate",
// topic: "Discussing The Impact Of Technology On The World",
// image: 'images/img1.jpeg',
// text: 'Exhibition by London-based architect and curator Dave Peace with films by Tg Omori,<br>October 16 - December 10',
// next: "Trade Fair"
// },
// {
// category: "Trade Fair",
// topic: "Building International Relationship Through Trade",
// image: 'images/img3.jpeg',
// text: 'Exhibition by London-based architect and curator Dave Peace with films by Tg Omori,<br>March 21 - March 28',
// next: "Beauty"
// },
// {
// category: "Beauty",
// topic: "Awareness On The Essence Of Skin-Care",
// image: 'images/img22.png',
// text: 'Exhibition by London-based architect and curator Dave Peace with films by Tg Omori,<br>August 12 - September 29',
// next: "Friendly Debate"
// }
// ];
// let heroSec = document.querySelector(".herosection")
// let heroText = document.querySelector(".heroText")
// let heroCateg = document.querySelector(".category")
// let heroTopic = document.querySelector(".topic")
// function setRandomBackground() {
// const randomIndex = Math.floor(Math.random() * backgrounds.length);
// const randomBackground = backgrounds[randomIndex];
// heroSec.style.backgroundImage = `linear-gradient(#2a2a2ae5, #2a2a2aea), url(${randomBackground.image})`;
// heroText.innerHTML = randomBackground.text;
// heroCateg.innerHTML = randomBackground.category;
// heroTopic.innerHTML = randomBackground.topic;
// }
// setInterval(setRandomBackground, 2000);
const backgrounds = [
{
category: "Exhibition",
topic: "A Lot With Little",
image: 'images/img2.jpg',
text: 'Exhibition by London-based architect and curator Dave Peace with films by Tg Omori,<br>October 16 - December 10',
next: "Friendly Debate"
},
{
category: "Friendly Debate",
topic: "Discussing The Impact Of Technology On The World",
image: 'images/img1.jpeg',
text: 'Exhibition by London-based architect and curator Dave Peace with films by Tg Omori,<br>October 16 - December 10',
next: "Trade Fair"
},
{
category: "Trade Fair",
topic: "Building International Relationship Through Trade",
image: 'images/img3.jpeg',
text: 'Exhibition by London-based architect and curator Dave Peace with films by Tg Omori,<br>March 21 - March 28',
next: "Beauty"
},
{
category: "Beauty",
topic: "Awareness On The Essence Of Skin-Care",
image: 'images/img22.png',
text: 'Exhibition by London-based architect and curator Dave Peace with films by Tg Omori,<br>August 12 - September 29',
next: "Exhibition"
}
];
let currentIndex = 0;
let heroSec = document.querySelector(".herosection");
let heroText = document.querySelector(".heroText");
let heroCateg = document.querySelector(".category");
let heroTopic = document.querySelector(".topic");
let heroNext = document.querySelector(".next");
let radio1 = document.querySelector(".radio1")
let radio2 = document.querySelector(".radio2")
let radio3 = document.querySelector(".radio3")
let radio4 = document.querySelector(".radio4")
function setNextBackground() {
const currentBackground = backgrounds[currentIndex];
heroSec.style.backgroundImage = `linear-gradient(#2a2a2ae5, #2a2a2aea), url(${currentBackground.image})`;
heroText.innerHTML = currentBackground.text;
heroCateg.innerHTML = currentBackground.category;
heroTopic.innerHTML = currentBackground.topic;
heroNext.innerHTML = currentBackground.next;
currentIndex = backgrounds.findIndex(item => item.category === currentBackground.next);
if (currentIndex === -1) {
currentIndex = 0;
}
if (currentIndex === 0) {
radio4.style.backgroundColor = "#fff"
radio1.style.backgroundColor = "transparent"
radio2.style.backgroundColor = "transparent"
radio3.style.backgroundColor = "transparent"
} else if (currentIndex === 1) {
radio1.style.backgroundColor = "#fff"
radio2.style.backgroundColor = "transparent"
radio3.style.backgroundColor = "transparent"
radio4.style.backgroundColor = "transparent"
} else if (currentIndex === 2) {
radio2.style.backgroundColor = "#fff"
radio3.style.backgroundColor = "transparent"
radio4.style.backgroundColor = "transparent"
radio1.style.backgroundColor = "transparent"
} else if (currentIndex === 3) {
radio3.style.backgroundColor = "#fff"
radio4.style.backgroundColor = "transparent"
radio1.style.backgroundColor = "transparent"
radio2.style.backgroundColor = "transparent"
}
}
document.addEventListener("DOMContentLoaded", () => {
setNextBackground();
setInterval(setNextBackground, 5000);
})
// let teamImg = document.querySelector(".teamimg");
// let teamName = document.querySelector(".teamname");
// let teamJob = document.querySelector(".teamjob");
// let back = document.querySelector("#back");
// let front = document.querySelector("#front");
// const team = [
// {
// name: "Jessica John",
// job: "Jouranlist, Activist, Researcher",
// image: 'images/img2.jpg'
// },
// {
// name: "Reuben McDonalds",
// job: "Model, Activist, Lawyer",
// image: 'images/img6.jpg'
// },
// {
// name: "Charllote Henry",
// job: "Designer, Planner, Strategist",
// image: 'images/img4.png'
// }
// ];
// function setNextTeam() {
// const currentTeam = team[currentIndex]
// teamImg.src = currentTeam.image;
// teamName.innerHTML = currentTeam.name;
// teamJob.innerHTML = currentTeam.job;
// currentIndex = 0;
// }
// setNextTeam();
// document.addEventListener("DOMContentLoaded", () => {
// setInterval(setNextTeam, 5000);
// })
// // Initialize Swiper
// var swiper = new Swiper(".mySwiper", {
// // Set initial number of slides per view
// slidesPerView: 3,
// // Responsive breakpoints
// breakpoints: {
// // When window width is <= 768px
// 768: {
// slidesPerView: 1,
// },
// // When window width is <= 992px
// 992: {
// slidesPerView: 2,
// },
// },
// //Set gp between slides
// spaceBetween: 30,
// //Specify autoplay and delay
// autoplay: {
// delay: 6000,
// },
// //To loop
// loop: true,
// });