</ul>
</nav>
<main>
- <div class="slideshow">
+ <div class="slideshow full">
<img
srcset="/media/photos_960/le-blanc-fine-art1.jpg,
/media/photos_1920/le-blanc-fine-art1.jpg x2,
</ul>
</nav>
<main>
- <div class="slideshow">
+ <div class="slideshow full">
<img
srcset="/media/photos_960/live-music1.jpg,
/media/photos_1920/live-music1.jpg x2,
</ul>
</nav>
<main>
- <div class="slideshow">
+ <div class="slideshow full">
<img
srcset="/media/photos_960/cotton-town1.jpg,
/media/photos_1920/cotton-town.jpg x2,
</ul>
</nav>
<main>
- <div class="slideshow">
+ <div class="slideshow full">
<img
srcset="/media/photos_960/zine1.png,
/media/photos_1920/zine1.png x2,
</ul>
</nav>
<main>
- <div class="slideshow">
+ <div class="slideshow full">
<img
srcset="/media/photos_960/photojournalism1.jpg,
/media/photos_1920/photojournalism1.jpg x2,
});
// sets up the image enlarge
- const images = document.getElementsByTagName("img");
+ const images = document.querySelectorAll("img:not(.full)");
for (image of images) {
image.addEventListener("click", (e) => {
// dim the lights
copy.style.width = `${rect.width}px`;
copy.style.height = `${rect.height}px`;
+ copy.style.objectFit = "contain";
copy.style.opacity = 1;
copy.style.transition = `
opacity 0.3s,
dim.after(copy);
setTimeout(function () {
- copy.style.objectFit = "contain";
copy.style.top = "5vh";
copy.style.left = "5vw";
copy.style.width = "90vw";
<li>About me text 10% bigger</li>
<li>Move text from inside the slideshows to below the slideshows</li>
<li>Added memorabilia title to match cotton town</li>
+ <li>Fixed visual glitch when enlarging contain-fitted image</li>
+ <li>Slideshow larger when in full mode</li>
+ <li>Changed slideshow styling on the buttons</li>
</ul>
<p>Still todo:</p>
<ul>
<li>Annotated images</li>
<li>Look into image scaling mechanic</li>
<li>Possibly closed captions on audio</li>
- <li>Slideshow larger when alone on a page</li>
</ul>
</details>`;
}
slideshow.dataset.slideCount = i;
- slideshow.children[0].style.display = "block";
+ slideshow.children[0].style.display = "inline-block";
// add slideshow buttons
var si = s;
const prev = document.createElement("span");
prev.classList.add("prev");
- prev.innerHTML = "◄";
+ prev.innerHTML = "⮜";
prev.addEventListener("click", (e) => {
e.preventDefault();
e.target.parentNode.dataset.slideCurrent = slideCount - 1;
}
document.getElementById(`show${si}slide${e.target.parentNode.dataset.slideCurrent}`)
- .style.display = "block";
+ .style.display = "inline-block";
});
const next = document.createElement("span");
next.classList.add("next");
- next.innerHTML = "►";
+ next.innerHTML = "⮞";
next.addEventListener("click", (e) => {
e.preventDefault();
e.target.parentNode.dataset.slideCurrent = 0;
}
document.getElementById(`show${si}slide${e.target.parentNode.dataset.slideCurrent}`)
- .style.display = "block";
+ .style.display = "inline-block";
});
- slideshow.appendChild(prev);
- slideshow.appendChild(next);
+ slideshow.prepend(prev);
+ slideshow.append(next);
s++;
}
height: calc((55vw - 25px) / 1.5);
}
.slideshow.full {
- margin-right: -3vw;
- width: calc(55vw - 25px + 3vw);
- height: calc((55vw - 25px + 3vw) / 1.5);
+ --full-overhang: 8vw;
+ margin-right: calc(-1 * var(--full-overhang));
+ width: calc(55vw - 25px + var(--full-overhang));
+ height: calc((55vw - 25px + var(--full-overhang)) / 1.5);
}
.slideshow > *:not(span) {
- width: 100%;
+ display: inline-block;
+ width: 99%;
height: 100%;
object-fit: contain;
}
-.slideshow.full > *:not(span) {
- width: 100%;
- height: 100%;
-}
.slideshow > span {
- display: inline-block;
- width: calc(25% - 2.5px);
- height: 25px;
- margin-top: 5px;
- color: var(--darkgray);
- background-color: #DDDDDD;
- text-align: center;
- line-height: 25px;
+ position: relative;
+ display: inline-flex;
+ align-items: center;
+ vertical-align: top;
+ width: 27%;
+ height: 100%;
+ line-height: 100%;
+ z-index: 0;
+ cursor: pointer;
+ color: var(--darkgray)
}
-.slideshow > span:hover {
- color: var(--mediumgray);
- background-color: #CCCCCC;
+.slideshow > span:hover { color: var(--mediumgray); }
+.prev {
+ justify-content: flex-start;
+ margin-left: -2%;
+ margin-right: -25%;
}
-.slideshow > span { cursor: pointer; }
.next {
- text-align: right;
- margin: 0 25% 0 2.5px;
-}
-.prev {
- text-align: left;
- margin: 0 2.5px 0 25%;
+ justify-content: flex-end;
+ margin-left: -25%;
+ margin-right: -2%;
}
+
.slideshow:first-child { margin-top: 0; }
.centering {