You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.5 KiB
HTML

1 year ago
<!DOCTYPE html>
<html>
<head>
1 year ago
<title>webweave</title>
1 year ago
<link rel="stylesheet" href="css/style_webweave.css">
</head>
<body>
1 year ago
<p id="header">webweave by clicking on a comment</p>
1 year ago
<div id="image-container"></div>
1 year ago
<a href="index.html" target="_blank">
1 year ago
<img id="christmas-image" src="images/christmas.png" alt="Christmas Image">
</a>
1 year ago
</body>
<p id="footer">credits for the webweaving go to sea--shore.tumblr.com</p>
<script>
const imageContainer = document.getElementById("image-container");
const header = document.getElementById("header");
const footer = document.getElementById("footer");
let currentIndex = 0;
let creditsDisplayed = false;
function showNextImage() {
1 year ago
if (currentIndex < 8) {
1 year ago
const image = document.createElement("img");
image.src = `images/web${currentIndex}.jpg`;
image.alt = `Image ${currentIndex}`;
imageContainer.appendChild(image);
currentIndex++;
// Add a click event to each image to show the next one
image.addEventListener("click", showNextImage);
}
1 year ago
if (currentIndex === 8 && !creditsDisplayed) {
header.style.display = "none"; // Hide the header when all images are displayed.
1 year ago
footer.style.display = "block"; // Show the footer text at the bottom
creditsDisplayed = true;
}
}
// Initialize by clicking on the first image
showNextImage();
</script>
</html>