Skip to content

Commit

Permalink
improve scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Zohreh-sa committed Dec 3, 2024
1 parent cac48a6 commit b832dca
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ function renderPhotos(categories) {


// Loop through the selected categories and generate photos
photoDatabase.forEach(([filename, category]) => {
if (categories.includes('all') || categories.includes(category)) {
for (let i=0; i<photoDatabase.length; i++){
const [filename, category]=photoDatabase[i];

if (categories.includes('all') || categories.includes(category)){
// Create a photo container
const photoDiv = document.createElement('div');
photoDiv.className = 'photo';
Expand All @@ -36,7 +38,7 @@ function renderPhotos(categories) {
photoDiv.appendChild(img);
gallery.appendChild(photoDiv);
}
});
};


// Wait for images to load before initializing Masonry
Expand Down

0 comments on commit b832dca

Please sign in to comment.