-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from NabinPaudel001/sfd-2024
gallery_updates
- Loading branch information
Showing
7 changed files
with
333 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[ | ||
{ | ||
"image": "image1.png", | ||
"date": "9 Sep", | ||
"description": "Pre Event Meetup" | ||
}, | ||
{ | ||
"image": "image2.png", | ||
"date": "10 Sep", | ||
"description": "Event Planning" | ||
}, | ||
{ | ||
"image": "path/to/your/image3.png", | ||
"date": "11 Sep", | ||
"description": "Sponsor Outreach" | ||
}, | ||
{ | ||
"image": "path/to/your/image3.png", | ||
"date": "11 Sep", | ||
"description": "Sponsor Outreach" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Fetch the gallery data from the JSON file and insert it into the HTML | ||
fetch("../gallery.json") // Adjusted path to gallery.json | ||
.then((response) => response.json()) | ||
.then((data) => { | ||
const galleryContainer = document.getElementById("gallery"); | ||
data.forEach((item) => { | ||
const galleryItem = document.createElement("div"); | ||
galleryItem.classList.add( | ||
"block", | ||
"bg-white", | ||
"shadow-md", | ||
"rounded-lg", | ||
"overflow-hidden", | ||
); | ||
|
||
galleryItem.innerHTML = ` | ||
<img class="w-full h-64 object-cover" src="${item.image}" alt="${item.description}"> | ||
<div class="p-4"> | ||
<p class="font-semibold text-lg mb-2">${item.date}</p> | ||
<p class="text-gray-600">${item.description}</p> | ||
</div> | ||
`; | ||
|
||
galleryContainer.appendChild(galleryItem); | ||
}); | ||
}) | ||
.catch((error) => console.error("Error loading gallery data:", error)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.