Skip to content

Commit b5dc829

Browse files
committed
docs: more images in landing
1 parent 3133cf0 commit b5dc829

File tree

1 file changed

+40
-6
lines changed

1 file changed

+40
-6
lines changed

landing/index.html

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575

7676
#img-col {
7777
display: flex;
78-
justify-content: flex-end;
78+
justify-content: center;
7979
}
8080

8181
.img-center {
@@ -94,7 +94,7 @@
9494

9595
#img-col img {
9696
max-height: 90vh;
97-
max-width: 90vw;
97+
/* max-width: 90vw; */
9898

9999
box-shadow: 0 5px 30px 0 rgba(255, 255, 255, 0.15);
100100

@@ -103,9 +103,10 @@
103103
animation-duration: 0.3s;
104104
}
105105

106-
#demo-img {
106+
.home-img {
107107
border-radius: 5px;
108108
border: solid 1px var(--border-color);
109+
max-width: max-content;
109110
width: 100%;
110111
height: 100%;
111112
}
@@ -176,6 +177,10 @@
176177
margin-bottom: 10%;
177178
}
178179

180+
#img-col img {
181+
max-width: 90vw;
182+
}
183+
179184
h5 {
180185
font-weight: 200;
181186
}
@@ -256,32 +261,61 @@ <h5>("eye" in Polish)</h5>
256261
</div>
257262
</div>
258263
<div id="img-col">
259-
<img id="demo-img" src="assets/demo.webp" width="2386" height="1160" alt="Oko demo">
264+
<img id="demo-img" class="home-img" src="assets/demo.webp" width="2386" height="1160" alt="Oko demo">
265+
<img id="streaming-img" class="home-img" src="assets/streaming.webp" width="2016" height="1134" alt="Oko streaming demo" style="display: none;">
266+
<img id="captive-img" class="home-img" src="assets/captive.webp" width="1488" height="1984" alt="Oko captive portal demo" style="display: none;">
267+
<img id="settings-img" class="home-img" src="assets/settings.webp" width="496" height="651" alt="Oko camera settings demo" style="display: none;">
268+
<img id="add-img" class="home-img" src="assets/add.webp" width="496" height="651" alt="Oko add camera demo" style="display: none;">
260269
<img id="poster-img" src="assets/poster.webp" width="1684" height="2384" alt="Oko poster" style="display: none;">
261270
</div>
262271
</div>
263272
<script>
264273
"use strict";
265274

275+
const HOME_IMG_SWITCH_INTERVAL = 4000;
276+
266277
const imgCol = document.getElementById("img-col");
267278
const aboutBtn = document.getElementById("about-btn");
268279
const posterBtn = document.getElementById("poster-btn");
269-
const demoImg = document.getElementById("demo-img");
270280
const posterImg = document.getElementById("poster-img");
271281

282+
const demoImg = document.getElementById("demo-img");
283+
const streamingImg = document.getElementById("streaming-img");
284+
const captiveImg = document.getElementById("captive-img");
285+
const settingsImg = document.getElementById("settings-img");
286+
const addImg = document.getElementById("add-img");
287+
288+
const homeImgs = [demoImg, streamingImg, captiveImg, settingsImg, addImg];
289+
290+
let imgIdx = 0;
291+
292+
function rotateHomeImages() {
293+
homeImgs[imgIdx].style.display = "none";
294+
imgIdx = (imgIdx + 1) % homeImgs.length;
295+
homeImgs[imgIdx].style.display = "block";
296+
}
297+
298+
let rotateHomeImagesInterval = window.screen.width > 1024 ? setInterval(rotateHomeImages, HOME_IMG_SWITCH_INTERVAL) : undefined;
299+
272300
aboutBtn.addEventListener("click", () => {
273301
aboutBtn.classList.add("selected");
274302
posterBtn.classList.remove("selected");
275303
imgCol.classList.remove("img-center");
276304
demoImg.style.display = "block";
277305
posterImg.style.display = "none";
306+
307+
if (typeof rotateHomeImagesInterval === "undefined") {
308+
rotateHomeImagesInterval = window.screen.width > 1024 ? setInterval(rotateHomeImages, HOME_IMG_SWITCH_INTERVAL) : undefined;
309+
}
278310
});
279311

280312
posterBtn.addEventListener("click", () => {
313+
rotateHomeImagesInterval = clearInterval(rotateHomeImagesInterval);
314+
imgIdx = 0;
281315
posterBtn.classList.add("selected");
282316
aboutBtn.classList.remove("selected");
283317
imgCol.classList.add("img-center");
284-
demoImg.style.display = "none";
318+
homeImgs.forEach(img => img.style.display = "none");
285319
posterImg.style.display = "block";
286320
});
287321
</script>

0 commit comments

Comments
 (0)