File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,20 +32,28 @@ const { config } = Astro.props;
3232
3333 {
3434 config .data .heroImages .map ((im , i ) => (
35- <img
36- class = { ` hero-image ${i > 0 ? " hidden" : " " } ` }
37- src = { im .image .src }
38- alt = { im .altText }
39- loading = { i > 0 ? " lazy" : " eager" }
40- />
35+ <div class = { ` relative hero-image-container ${i > 0 ? " hidden" : " " } ` } >
36+ <img
37+ class = { " hero-image" }
38+ src = { im .image .src }
39+ alt = { im .altText }
40+ loading = { i > 0 ? " lazy" : " eager" }
41+ />
42+ <p
43+ aria-hidden
44+ class = { " renderable-alt bg-bg-gray-40 line-clamp-3 absolute top-0 mt-sm mx-sm px-[7.5px] pb-[2.5px] rounded-xl text-body-caption text-ellipsis" }
45+ >
46+ { im .altText }
47+ </p >
48+ </div >
4149 ))
4250 }
4351</div >
4452
4553<script >
4654 document.addEventListener("DOMContentLoaded", (event) => {
4755 // find all hero image elements
48- const images = document.querySelectorAll("img .hero-image");
56+ const images = document.querySelectorAll(".hero-image-container ");
4957 if (images.length > 1) {
5058 const shownImageInd = Math.round(Math.random() * (images.length - 1));
5159 console.log(shownImageInd);
You can’t perform that action at this time.
0 commit comments