diff --git a/assets/js/app.js b/assets/js/app.js index f9f548e..974e90a 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -12,13 +12,9 @@ const body = document.body; // SLIDER const homeSection = document.querySelector('.home-section'); -const navLinks = document.querySelectorAll('.navigation__link'); -const socialLinks = document.querySelectorAll('.social__link'); const sliderSection = document.querySelector('.slider-section'); let slider; const slides = document.querySelectorAll('.splide__slide'); -let cursorOrientation; -let cursorColor; // ---------------------------------------------------------------------------- // LOGIC @@ -88,86 +84,6 @@ function changeSlideOnSwipe() { } } -function turnSidebarLinksToWhite() { - if (navLinks) { - for (let i = 0; i < navLinks.length; i++) { - navLinks[i].classList.add('navigation__link--white'); - } - } - if (socialLinks) { - for (let i = 0; i < socialLinks.length; i++) { - socialLinks[i].classList.add('social__link--white'); - } - } -} - -function turnSidebarLinksToBlack() { - if (navLinks) { - for (let i = 0; i < navLinks.length; i++) { - navLinks[i].classList.remove('navigation__link--white'); - } - } - if (socialLinks) { - for (let i = 0; i < socialLinks.length; i++) { - socialLinks[i].classList.remove('social__link--white'); - } - } -} - -function editColorTheme(slide) { - if (slide) { - if (slide.getAttribute('data-text-color') === 'white') { - turnSidebarLinksToWhite(); - cursorColor = 'light'; - } else if (slide.getAttribute('data-text-color') === 'black') { - turnSidebarLinksToBlack(); - cursorColor = 'dark'; - } - if (body && cursorOrientation && cursorColor) { - if (cursorOrientation === 'previous') { - body.style.cursor = `url('/images/cursor-${cursorOrientation}-${cursorColor}.svg') 0 12, auto`; - } else if (cursorOrientation === 'next') { - body.style.cursor = `url('/images/cursor-${cursorOrientation}-${cursorColor}.svg') 24 12, auto`; - } - } - } -} - -function editColorThemeOnSliderMounted() { - if (slider && slides) { - slider.on('mounted', function() { - editColorTheme(slides[0]); - }) - } -} - -function editColorThemeOnSlideActive() { - if (slider) { - slider.on('active', function(e) { - editColorTheme(e.slide); - }); - } -} - -function setCursorOnMove() { - if (body) { - body.addEventListener('mousemove', function(e) { - if (e.clientX >= window.innerWidth / 2) { - cursorOrientation = 'next'; - } else { - cursorOrientation = 'previous'; - } - if (cursorOrientation && cursorColor) { - if (cursorOrientation === 'previous') { - body.style.cursor = `url('/images/cursor-${cursorOrientation}-${cursorColor}.svg') 0 12, auto`; - } else if (cursorOrientation === 'next') { - body.style.cursor = `url('/images/cursor-${cursorOrientation}-${cursorColor}.svg') 24 12, auto`; - } - } - }); - } -} - // ---------------------------------------------------------------------------- // PROGRAM // ---------------------------------------------------------------------------- @@ -179,9 +95,6 @@ enableActivePseudoClass(); // SLIDER setUpSlider(); -editColorThemeOnSliderMounted(); mountSlider(); changeSlideOnClick(); changeSlideOnSwipe(); -editColorThemeOnSlideActive(); -setCursorOnMove(); diff --git a/public/images/cursor-next-dark.svg b/public/images/cursor-next-dark.svg deleted file mode 100644 index d6d4fad..0000000 --- a/public/images/cursor-next-dark.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/public/images/cursor-next-light.svg b/public/images/cursor-next-light.svg deleted file mode 100644 index 0871420..0000000 --- a/public/images/cursor-next-light.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/public/images/cursor-previous-dark.svg b/public/images/cursor-previous-dark.svg deleted file mode 100644 index 7005b19..0000000 --- a/public/images/cursor-previous-dark.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/public/images/cursor-previous-light.svg b/public/images/cursor-previous-light.svg deleted file mode 100644 index 0140631..0000000 --- a/public/images/cursor-previous-light.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/site/blueprints/files/full_screen_image.yml b/site/blueprints/files/full_screen_image.yml deleted file mode 100644 index 621aafe..0000000 --- a/site/blueprints/files/full_screen_image.yml +++ /dev/null @@ -1,29 +0,0 @@ -title: Image -accept: - mime: image/jpeg, image/png -fields: - alt_text: - label: - en: Alternative text - fr: Texte alternatif - type: text - help: - en: "Short description displayed if the image can't be loaded and used by screen readers." - fr: "Courte description affichée si l'image ne peut être chargée et utilisée par les lecteurs d'écran." - text_color: - label: - en: Overlay text color - fr: Couleur du texte superposé - type: select - options: - black: - en: Black - fr: Noir - white: - en: White - fr: Blanc - default: black - help: - en: "Favor a black logo for a light image, and a white logo for a dark image." - fr: "Privilégier le noir pour un texte superposé à une image claire, et le blanc pour un texte superposé à une image sombre." - width: 1/4 diff --git a/site/blueprints/files/gallery_image.yml b/site/blueprints/files/gallery_image.yml new file mode 100644 index 0000000..2181f78 --- /dev/null +++ b/site/blueprints/files/gallery_image.yml @@ -0,0 +1,12 @@ +title: Image +accept: + mime: image/jpeg, image/png +fields: + alt_text: + label: + en: Alternative text + fr: Texte alternatif + type: text + help: + en: "Short description displayed if the image can't be loaded and used by screen readers." + fr: "Courte description affichée si l'image ne peut être chargée et utilisée par les lecteurs d'écran." diff --git a/site/blueprints/sections/site_content_images.yml b/site/blueprints/sections/site_content_images.yml index c68069b..65d561a 100644 --- a/site/blueprints/sections/site_content_images.yml +++ b/site/blueprints/sections/site_content_images.yml @@ -2,10 +2,8 @@ label: en: Image gallery fr: Galerie d'images type: files -template: full_screen_image +template: gallery_image min: 2 layout: cards -size: small -limit: 15 image: ratio: 1/1 diff --git a/site/controllers/home.php b/site/controllers/home.php index be36c71..00f8d28 100644 --- a/site/controllers/home.php +++ b/site/controllers/home.php @@ -3,7 +3,7 @@ return function ($site) { // Get image files section content - $images = $site->files()->template("full_screen_image")->shuffle(); + $images = $site->files()->template("gallery_image")->shuffle(); // Get contact fields content $email = $site->email(); diff --git a/site/templates/home.twig b/site/templates/home.twig index 93adea2..3e7a18c 100644 --- a/site/templates/home.twig +++ b/site/templates/home.twig @@ -90,7 +90,7 @@