-
Notifications
You must be signed in to change notification settings - Fork 0
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 #16 from pierrickmartinet/develop
Feat: Page gallerie, affichage des images en mosaïque ou en colonne #6
- Loading branch information
Showing
13 changed files
with
146 additions
and
20 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,56 @@ | ||
$(document).ready(function () { | ||
console.log('Je peux maintenant écrire du code jQuery'); | ||
|
||
// Menu dropDown | ||
|
||
// Séléction de la div de la classe dropdown | ||
let dropdown = document.querySelector('.dropdown') | ||
|
||
// Au clic si fermé: ouvre sinon ferme | ||
dropdown.addEventListener('click', (e) => { | ||
|
||
if (dropdown.classList.contains('closed')) { | ||
dropdown.classList.remove('closed') | ||
} else { | ||
dropdown.classList.add('closed') | ||
} | ||
|
||
}) | ||
|
||
|
||
// Gallerie d'image | ||
|
||
// La variable iconGalleryMosaic prend pour valeur l'icon inconGalleryMosaic | ||
let iconGalleryMosaic = document.querySelector('.iconGalleryMosaic'); | ||
// La variable iconGalleryColumn prend pour valeur l'icon inconGalleryColumn | ||
let iconGalleryColumn = document.querySelector('.iconGalleryColumn'); | ||
|
||
// La variable imgGallery prend pour valeur un tableau avec les images de la div portant l'id imgGallery | ||
let imgGallery = document.querySelectorAll('#imgGallery img'); | ||
|
||
|
||
// Listener sur l'icon Mosaïque au click de la souris (l'évenement se passe lorsque l'utilisateur clique sur l'icon) | ||
iconGalleryMosaic.addEventListener('click', (e) => { | ||
index = 0; | ||
// Au moment ou l'utilisateur clique sur l'icon, pour chaque image, supression de la classe colonne et ajout de la classe Mosaïque tant qu'il y a des images | ||
while(index < imgGallery.length){ | ||
imgGallery[index].classList.remove("imgGalleryColumn"); | ||
imgGallery[index].classList.add("imgGalleryMosaic"); | ||
index = index + 1; | ||
} | ||
|
||
}) | ||
|
||
// Listener sur l'icon Colonne au click de la souris (l'évenement se passe lorsque l'utilisateur clique sur l'icon) | ||
iconGalleryColumn.addEventListener('click', (e) => { | ||
index = 0; | ||
// Au moment ou l'utilisateur clique sur l'icon, pour chaque image, supression de la classe Mosaïque et ajout de la classe Colonne tant qu'il y a des images | ||
while(index < imgGallery.length){ | ||
imgGallery[index].classList.remove("imgGalleryMosaic"); | ||
imgGallery[index].classList.add("imgGalleryColumn"); | ||
index = index + 1; | ||
} | ||
|
||
}) | ||
|
||
}); |
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