Skip to content

Commit 838bb54

Browse files
committed
Another attempt lessgo
1 parent 2c91e7d commit 838bb54

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

_includes/team-showcase.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<section class="hero is-halfheight has-text-left" id="team-showcase">
2-
<figure class="hero-background" id="rotating-image">
2+
<figure class="hero-background" id="rotating-image" style="background-size: cover; background-position: center;">
33
<div class="overlay">
44
<div class="container is-centered">
55
<div class="title-text">
@@ -15,24 +15,24 @@ <h1 class="title has-text-white-ter is-size-1 is-uppercase has-text-weight-bold"
1515
<script>
1616
document.addEventListener('DOMContentLoaded', function() {
1717
const images = [
18-
"https://raw.githubusercontent.com/CabrilloRoboticsClub/cabrillorobotics.github.io/41309abdbb5d93dbc6c0119bf8f97a3bb38ad743/assets/images/seahawk-II/gallery-seahawk-II/interview.webp",
19-
"https://raw.githubusercontent.com/CabrilloRoboticsClub/cabrillorobotics.github.io/41309abdbb5d93dbc6c0119bf8f97a3bb38ad743/assets/images/seahawk-II/gallery-seahawk-II/stack.webp",
20-
"https://github.com/CabrilloRoboticsClub/cabrillorobotics.github.io/blob/258a1699f10c378fb2a1d18c2a986080bf3b6a57/assets/images/seahawk-II/gallery-seahawk-II/deploy.jpeg?raw=true",
21-
"https://raw.githubusercontent.com/CabrilloRoboticsClub/cabrillorobotics.github.io/782b579c031c16835e0fee2b57a22246c1a79618/assets/images/seahawk-II/gallery-seahawk-II/product-demo-pilot-2.webp"
18+
"https://raw.githubusercontent.com/CabrilloRoboticsClub/cabrillorobotics.github.io/41309abdbb5d93dbc6c0119bf8f97a3bb38ad743/assets/images/seahawk-II/gallery-seahawk-II/interview.webp",
19+
"https://raw.githubusercontent.com/CabrilloRoboticsClub/cabrillorobotics.github.io/41309abdbb5d93dbc6c0119bf8f97a3bb38ad743/assets/images/seahawk-II/gallery-seahawk-II/stack.webp",
20+
"https://github.com/CabrilloRoboticsClub/cabrillorobotics.github.io/blob/258a1699f10c378fb2a1d18c2a986080bf3b6a57/assets/images/seahawk-II/gallery-seahawk-II/deploy.jpeg?raw=true",
21+
"https://raw.githubusercontent.com/CabrilloRoboticsClub/cabrillorobotics.github.io/782b579c031c16835e0fee2b57a22246c1a79618/assets/images/seahawk-II/gallery-seahawk-II/product-demo-pilot-2.webp"
2222
];
2323

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

2727
function rotateImage() {
28-
imageElement.style.backgroundImage = `url(${images[currentIndex]})`;
29-
currentIndex = (currentIndex + 1) % images.length;
28+
image_element.style.backgroundImage = `url(${images[i]})`;
29+
i = (i + 1) % images.length;
3030
}
3131

32-
// Rotate the image every 5 seconds
33-
setInterval(rotateImage, 5000);
34-
3532
// Set the initial image
3633
rotateImage();
34+
35+
// Rotate the image every 5 seconds
36+
setInterval(rotateImage, 5000);
3737
});
3838
</script>

0 commit comments

Comments
 (0)