Skip to content

Commit

Permalink
revert to more basic image viewer, update modules display on header
Browse files Browse the repository at this point in the history
  • Loading branch information
malyalar authored and malyalar committed Jan 24, 2024
1 parent ccff999 commit 65fff28
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 32 deletions.
1 change: 1 addition & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<body>
<nav class="nav-main">
<ul>
<li class="hvr-underline-reveal"><a href="{{ site.baseurl }}/modules/">modules</a></li>
<li class="hvr-underline-reveal"><a href="{{ site.baseurl }}/about/">about</a></li>
<li class="logo"><a class="hvr-ripple-out" href="{{ site.baseurl }}/">VV</a></li>
<li class="hvr-underline-reveal"><a href="{{ site.baseurl }}/blog/">blog</a></li>
Expand Down
40 changes: 8 additions & 32 deletions examples/basic_image/stereo-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,21 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Stereoscopic Image Viewer</title>
<title>Image Slideshow</title>
<style>
body {
margin: 0;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f0f0;
}
img {
max-width: 50%; /* Set max-width to 50% for side-by-side images */
height: auto;
width: 100%;
height: 100%;
object-fit: cover;
}
</style>
</head>
<body>
<img id="slideshowImage" src="https://<username>.github.io/<repository-name>/examples/basic_image/textures/image1_00.jpeg" alt="Image 1">
<img id="slideshowImage" src="https://<username>.github.io/<repository-name>/examples/basic_image/textures/stereo-demo-thorax.jpeg" alt="Image">

<script>
// Array of image filenames in the textures directory
Expand All @@ -34,7 +30,7 @@
"image2_02.jpeg",
"image3_00.jpeg",
"image3_01.jpeg",
"image3_02.jpeg",
"image3_02.jpeg"
// ...
];

Expand All @@ -44,28 +40,8 @@
// Function to update the image source
function showNextImage() {
currentImageIndex = (currentImageIndex + 1) % imageFilenames.length;
const currentImageSrc = `https://<username>.github.io/<repository-name>/examples/basic_image/textures/${imageFilenames[currentImageIndex]}`;

if (currentImageSrc.endsWith('_02.jpeg')) {
// Display stereoscopic image as is
slideshowImage.src = currentImageSrc;
} else {
// Display two images side by side
const nextImageIndex = (currentImageIndex + 1) % imageFilenames.length;
const nextImageSrc = `https://<username>.github.io/<repository-name>/examples/basic_image/textures/${imageFilenames[nextImageIndex]}`;
slideshowImage.src = null; // Clear previous image
slideshowImage.src = currentImageSrc;

// Create another image element for the second image
const secondImage = document.createElement('img');
secondImage.src = nextImageSrc;
secondImage.alt = `Image ${nextImageIndex + 1}`;
secondImage.style.maxWidth = '50%'; // Set max-width to 50% for side-by-side images
secondImage.style.height = 'auto';

// Append the second image to the body
document.body.appendChild(secondImage);
}
const nextImageSrc = `https://<username>.github.io/<repository-name>/examples/basic_image/textures/${imageFilenames[currentImageIndex]}`;
slideshowImage.src = nextImageSrc;
}

// Event listener for tap or click on the body
Expand Down
Binary file modified examples/basic_image/textures/.DS_Store
Binary file not shown.

0 comments on commit 65fff28

Please sign in to comment.