Skip to content

Commit 851df00

Browse files
committed
Another try lessgo
1 parent 8ed324c commit 851df00

File tree

1 file changed

+7
-41
lines changed

1 file changed

+7
-41
lines changed

_includes/team-showcase.html

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- <section class="hero is-halfheight has-text-left" id="team-showcase">
1+
<section class="hero is-halfheight has-text-left" id="team-showcase">
22
<figure class="hero-background" id="rotating-image" style="background-size: cover; background-position: center;">
33
<div class="overlay">
44
<div class="container is-centered">
@@ -10,42 +10,8 @@ <h1 class="title has-text-white-ter is-size-1 is-uppercase has-text-weight-bold"
1010
</div>
1111
</div>
1212
</figure>
13-
</section> -->
13+
</section>
1414

15-
<div id = "rotator1_div"></div>
16-
17-
<script>
18-
<!--
19-
var rotator1imgs = new Array("https://raw.githubusercontent.com/CabrilloRoboticsClub/cabrillorobotics.github.io/41309abdbb5d93dbc6c0119bf8f97a3bb38ad743/assets/images/seahawk-II/gallery-seahawk-II/interview.webp", "https://raw.githubusercontent.com/CabrilloRoboticsClub/cabrillorobotics.github.io/41309abdbb5d93dbc6c0119bf8f97a3bb38ad743/assets/images/seahawk-II/gallery-seahawk-II/stack.webp");
20-
var rotator1alt = new Array("qqjq", "liqjiq");
21-
var rotatorHtml = "";
22-
var endJs = "";
23-
24-
for(var img in rotator1imgs){
25-
var thisImg = new Image();
26-
thisImg.src = rotator1imgs[img];
27-
}
28-
var rotator1imgCt = 2;
29-
var rotator1currentAd = 0;
30-
var target = "";
31-
var rotator1banner = document.getElementById('rotator1');
32-
33-
function rotator1cycle() {
34-
var rotatorHtml = "";
35-
var endJs = "";
36-
if (rotator1currentAd == rotator1imgCt) {
37-
rotator1currentAd = 0;
38-
}
39-
40-
rotatorHtml += '<img src="' + rotator1imgs[rotator1currentAd] + '" alt = "' + rotator1alt[rotator1currentAd] + '" id="rotator1">' + endJs;
41-
document.getElementById("rotator1_div").innerHTML = rotatorHtml;
42-
rotator1currentAd++;
43-
window.setTimeout(rotator1cycle,5000);
44-
}
45-
rotator1cycle();
46-
// -->
47-
</script>
48-
<!--
4915
<script>
5016
document.addEventListener('DOMContentLoaded', function() {
5117
const images = [
@@ -55,12 +21,12 @@ <h1 class="title has-text-white-ter is-size-1 is-uppercase has-text-weight-bold"
5521
"https://raw.githubusercontent.com/CabrilloRoboticsClub/cabrillorobotics.github.io/782b579c031c16835e0fee2b57a22246c1a79618/assets/images/seahawk-II/gallery-seahawk-II/product-demo-pilot-2.webp"
5622
];
5723

58-
let i = 0;
59-
const image_element = document.getElementById('rotating-image');
24+
let currentIndex = 0;
25+
const imageElement = document.getElementById('rotating-image');
6026

6127
function rotateImage() {
62-
image_element.style.backgroundImage = `url(${images[i]})`;
63-
i = (i + 1) % images.length;
28+
imageElement.style.backgroundImage = `url(${images[currentIndex]})`;
29+
currentIndex = (currentIndex + 1) % images.length;
6430
}
6531

6632
// Set the initial image
@@ -69,4 +35,4 @@ <h1 class="title has-text-white-ter is-size-1 is-uppercase has-text-weight-bold"
6935
// Rotate the image every 5 seconds
7036
setInterval(rotateImage, 5000);
7137
});
72-
</script> -->
38+
</script>

0 commit comments

Comments
 (0)