diff --git a/src/static/populate_index.js b/src/static/populate_index.js index 599c768..b6d2ffe 100644 --- a/src/static/populate_index.js +++ b/src/static/populate_index.js @@ -25,7 +25,7 @@ async function FetchData() { // let videos = await get("/data/videos.json"); const Images = document.querySelectorAll( - '[data-type="index__placeholder__image"]' + '[data-type="placeholder__image"]' ); const VisibleImages = []; Images.forEach((placeholder) => { @@ -37,7 +37,7 @@ async function FetchData() { randomElements(images, VisibleImages.length).forEach((image, idx) => { const src = `${config.endpoint}/${config.bucket}/${config.prefix}/${image.src}`; const loader = document.getElementById( - `index__placeholder__image-${idx + 1}-loader` + `placeholder__image-${idx + 1}-loader` ); const blurImg = document.createElement("img"); const Img = document.createElement("img"); diff --git a/src/templates/Components/PlaceHolder.tsx b/src/templates/Components/PlaceHolder.tsx new file mode 100644 index 0000000..59603aa --- /dev/null +++ b/src/templates/Components/PlaceHolder.tsx @@ -0,0 +1,18 @@ +export default function Placeholder(props: { + idx: string | number; + isMobileHidden?: boolean; +}) { + return ( + + + + ); +} diff --git a/src/templates/index.tsx b/src/templates/index.tsx index 18256cc..6fc82ac 100644 --- a/src/templates/index.tsx +++ b/src/templates/index.tsx @@ -1,4 +1,6 @@ import AllLink from "./Components/AllLink"; +import Placeholder from "./Components/PlaceHolder"; + export default function IndexPage() { return (