Skip to content

Commit

Permalink
see if this works
Browse files Browse the repository at this point in the history
  • Loading branch information
dannybunschoten committed Aug 28, 2024
1 parent f18be68 commit 3ac316e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,16 @@ export default function Home() {
rollWheelItems: newRollWheelItems,
rollWheelOffsets: initializeRollWheelOffsets(),
});

const preloadImages = async () => {
const imagePaths = ITEMS.map((item) => `/${item}.png`);
for (const path of imagePaths) {
const img = new Image();
img.src = path;
await img.decode(); // Ensures the image is fully loaded
}
};
preloadImages();
}, []);

const handleClick = () => {
Expand Down

0 comments on commit 3ac316e

Please sign in to comment.