Skip to content

Commit

Permalink
use fetch instead of import (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulaingate authored Apr 4, 2024
1 parent accdfa3 commit d79aa90
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import images from "./assets/images.json" assert { type: "json" };

const leftArrow = document.getElementById("left-arrow");
const rightArrow = document.getElementById("right-arrow");
const carouselImg = document.getElementById("carousel-img");
const carouselTitle = document.getElementById("carousel-title");

const response = await fetch('/assets/images.json');
const images = await response.json();

let currentImgIndex = 0;
const totalImages = images.length;

Expand Down

0 comments on commit d79aa90

Please sign in to comment.