diff --git a/web/themes/custom/quartiers_de_demain/dist/assets/bundle.js b/web/themes/custom/quartiers_de_demain/dist/assets/bundle.js index ce7e334..2bbd88a 100644 --- a/web/themes/custom/quartiers_de_demain/dist/assets/bundle.js +++ b/web/themes/custom/quartiers_de_demain/dist/assets/bundle.js @@ -26,7 +26,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ \******************************************/ /***/ (function() { -eval("document.addEventListener('scroll', function() {\n const scrolled = window.pageYOffset;\n const background = document.getElementById('background-animated');\n \n // Adjust this value to control the speed of the parallax effect\n const parallaxSpeed = 0.2;\n background.style.transform = 'translateY(' + (scrolled * parallaxSpeed) + 'px)';\n});\n\n\n\n\n //ANimation Pilliers \n// const svg = document.querySelector('#paragraph-id--7 .colone-picto');\n\n// // Configuration de l'observateur d'intersection\n// const observer = new IntersectionObserver(entries => {\n// entries.forEach(entry => {\n// if (entry.isIntersecting) {\n// // Ajoute une classe lorsque l'élément est visible\n// svg.classList.add('visible');\n// } else {\n// // Optionnel : Retirez la classe si nécessaire\n// svg.classList.remove('visible');\n// }\n// });\n// });\n\n// // Observer l'élément SVG\n// observer.observe(svg);\n\n\n//ANimation Pilliers \nconst svg = document.querySelector('#paragraph-id--7 .colone-picto');\n\n// Configuration de l'observateur d'intersection\nconst observer = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n // Ajoute une classe lorsque l'élément est visible\n // svg.classList.remove('invisible');\n svg.classList.add('visible');\n } \n // else {\n // // Optionnel : Retirez la classe si nécessaire\n // svg.classList.remove('visible');\n // svg.classList.add('invisible');\n\n // }\n });\n});\n\n// Observer l'élément SVG\nobserver.observe(svg);\n\n\n//# sourceURL=webpack://quartiers_de_demain/./src/assets/js/animated_formes.js?"); +eval("document.addEventListener('scroll', function() {\n const scrolled = window.pageYOffset;\n const background = document.getElementById('background-animated');\n \n // Adjust this value to control the speed of the parallax effect\n const parallaxSpeed = 0.2;\n background.style.transform = 'translateY(' + (scrolled * parallaxSpeed) + 'px)';\n});\n\n\n\n\n //ANimation Pilliers \n// const svg = document.querySelector('#paragraph-id--7 .colone-picto');\n\n// // Configuration de l'observateur d'intersection\n// const observer = new IntersectionObserver(entries => {\n// entries.forEach(entry => {\n// if (entry.isIntersecting) {\n// // Ajoute une classe lorsque l'élément est visible\n// svg.classList.add('visible');\n// } else {\n// // Optionnel : Retirez la classe si nécessaire\n// svg.classList.remove('visible');\n// }\n// });\n// });\n\n// // Observer l'élément SVG\n// observer.observe(svg);\n\n//////////////////////////////////////////////////\n\n//ANimation Pilliers \nconst svg = document.querySelector('#paragraph-id--7 .colone-picto');\n\n// Configuration de l'observateur d'intersection\nconst observer = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n // Ajoute une classe lorsque l'élément est visible\n // svg.classList.remove('invisible');\n svg.classList.add('visible');\n } \n else {\n // Optionnel : Retirez la classe si nécessaire\n svg.classList.remove('visible');\n\n }\n });\n});\n\n// Observer l'élément SVG\nobserver.observe(svg);\n\n\n//# sourceURL=webpack://quartiers_de_demain/./src/assets/js/animated_formes.js?"); /***/ }), @@ -36,7 +36,7 @@ eval("document.addEventListener('scroll', function() {\n const scrolled = win \**********************************************/ /***/ (function() { -eval("/**\n * @file\n * quartiers_de_demain behaviors.\n */\n (function (Drupal) {\n\n 'use strict';\n \n Drupal.behaviors.quartiers_de_demain = {\n attach: function (context, settings) {\n console.log('It works!');\n }\n };\n } (Drupal));\n\n \n // jQuery(document).ready(function($){\n\n // $('.open-block').click(function(){\n // $(this).toggleClass('opened');\n\n // $('.header_nav_container').toggleClass('display-nav-opened');\n \n // if(mobile == true){\n // $(\"body\").css(\"overflow\",\"hidden\");\n // }\n\n // });\n \n // // Hide the header_nav_container when a link inside it is clicked\n // $('.header_nav_container li').click(function() {\n // $('.header_nav_container').fadeOut();\n // });\n\n\n\n\n // });\n\n //////// start header ////////////\n document.addEventListener('DOMContentLoaded', function() {\n\n const header = document.querySelector('header');\n const logo = document.querySelector('#block-quartiers-de-demain-logoquartiersdedemain > div:nth-child(1) > div:nth-child(1) > a:nth-child(1) > svg:nth-child(1)');\n const headerNavContainer = document.querySelector('.header_nav_container');\n const isFirstLoad = !performance.getEntriesByType(\"navigation\")[0].type.includes('back_forward');\n const isTargetPath = window.location.pathname === '/';\n\n // Fonction pour démarrer l'animation du logo SVG\n function startLogoAnimation() {\n logo.classList.add('animated');\n }\n \n // Fonction pour arrêter l'animation du logo SVG\n function stopLogoAnimation() {\n logo.classList.remove('animated');\n }\n \n // Vérifier si le header a la classe header--collapse\n function checkHeaderCollapse() {\n if (header.classList.contains('header--collapsed')) {\n stopLogoAnimation();\n } else if (header.classList.contains('header--collapsed-already')) {\n stopLogoAnimation();\n } else {\n startLogoAnimation();\n }\n\n }\n \n // Appeler la fonction au chargement initial\n checkHeaderCollapse();\n \n // Observer les changements de classe sur le header\n const observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(mutation) {\n if (mutation.attributeName === 'class') {\n checkHeaderCollapse();\n }\n });\n });\n observer.observe(header, { attributes: true });\n \n\n // Si ce n'est pas la première charge ou si le chemin n'est pas le chemin cible, ajouter la classe immédiatement\n if (!isFirstLoad || !isTargetPath) {\n header.classList.add('header--collapsed-already');\n // logo.classList.remove('animated');\n stopLogoAnimation();\n } else {\n // Sinon, appliquer la transition après un délai\n setTimeout(() => {\n header.classList.add('header--collapsed');\n }, 5000);\n }\n\n ////////////// \n\n let lastScrollTop = 0;\n let threshold = 100; // Change this value as needed\n let isHidden = false;\n \n function slideOut() {\n headerNavContainer.animate([\n { transform: 'translateX(0)' },\n { transform: 'translateX(-100%)' }\n ], {\n duration: 300,\n fill: 'forwards'\n });\n isHidden = true;\n }\n \n function slideIn() {\n headerNavContainer.animate([\n { transform: 'translateX(-100%)' },\n { transform: 'translateX(0)' }\n ], {\n duration: 300,\n fill: 'forwards'\n });\n isHidden = false;\n }\n \n function slideDown() {\n // headerNavContainer.style.display = 'block';\n headerNavContainer.animate([\n { transform: 'translateY(0%)' },\n { transform: 'translateY(+100%)' }\n ], {\n duration: 300,\n fill: 'forwards'\n });\n isHidden = false;\n }\n \n function slideUp() {\n headerNavContainer.animate([\n { transform: 'translateY(100%)' },\n { transform: 'translateY(0%)' }\n ], {\n duration: 300,\n fill: 'forwards'\n }).onfinish = function() {\n // headerNavContainer.style.display = 'none';\n };\n isHidden = true;\n }\n // Fonction pour ajuster la hauteur du header lors du défilement\n function adjustHeaderHeight() {\n if (window.scrollY > 0) {\n header.classList.add('shrink');\n } else {\n header.classList.remove('shrink');\n }\n }\n\n function handleScroll() {\n let scrollTop = window.pageYOffset || document.documentElement.scrollTop;\n const isMobile = window.innerWidth < 811;\n\n if (scrollTop > threshold && !isHidden) {\n if (isMobile) {\n slideUp();\n } else {\n slideOut();\n }\n } else if (scrollTop <= threshold && isHidden) {\n if (isMobile) {\n slideDown();\n } else {\n slideIn();\n }\n }\n \n \n lastScrollTop = scrollTop <= 0 ? 0 : scrollTop; // For Mobile or negative scrolling\n }\n \n function handleTouchAndMouseEnter() {\n if (isHidden) {\n if (window.innerWidth < 811) {\n slideDown();\n } else {\n slideIn();\n }\n }\n }\n \n function handleTouchAndMouseLeave() {\n if (lastScrollTop > threshold && !isHidden) {\n if (window.innerWidth < 811) {\n slideUp();\n } else {\n slideOut();\n }\n }\n }\n \n window.addEventListener('scroll', handleScroll);\n window.addEventListener('scroll', adjustHeaderHeight);\n \n // Mouse events for desktop\n header.addEventListener('mouseenter', handleTouchAndMouseEnter);\n header.addEventListener('mouseleave', handleTouchAndMouseLeave);\n \n // Touch events for tablets and mobile devices\n header.addEventListener('touchstart', handleTouchAndMouseEnter);\n header.addEventListener('touchend', handleTouchAndMouseLeave);\n \n // Initial check to see if we're at the top of the page\n if (window.pageYOffset <= threshold) {\n if (window.innerWidth < 811) {\n slideDown();\n } else { \n slideIn();\n } \n } else {\n if (window.innerWidth < 811) {\n slideUp();\n } else {\n slideIn();\n }\n }\n \n });\n\n //////// end header ////////////\n \n\n\n//// ancre dans texte au click parragraphe correspondant arrive en dessous du header \n\n\n(function($, window) {\n var adjustAnchor = function() {\n var $anchor = $('.sidebar_first_container'),\n fixedElementHeight = 500;\n if ($anchor.length > 0) {\n $('html, body').stop().animate({scrollTop: $anchor.offset().top - fixedElementHeight }, 0);\n }\n };\n\n $(window).on('hashchange', function() {\n adjustAnchor();\n });\n\n\n //////////////////////// start script smooth apparition des textes /////////////////\n\n function scrollReaveal(){\n\n const nodes = {\n logo : document.querySelectorAll('#logo-animated-container'),\n chapeau : document.querySelectorAll('.field_body'),\n paragraph: document.querySelectorAll('.field_field_textes .paragraph--type--static-parts'),\n enjeux : document.querySelectorAll('.field_field_textes .paragraph--type--static-parts .enjeux'),\n }\n\n const showUp = {\n origin: 'bottom',\n delay: 100,\n duration: 1000,\n distance: '50px',\n easing: 'cubic-bezier(0.5, 0, 0, 1)'\n }\n\n const Show = {\n delay: 100,\n duration: 600,\n easing: 'cubic-bezier(0.5, 0, 0, 1)'\n }\n\n console.log(nodes);\n\n ScrollReveal().reveal(nodes.logo, Show);\n ScrollReveal().reveal(nodes.chapeau, showUp);\n ScrollReveal().reveal(nodes.paragraph, showUp);\n ScrollReveal().reveal(nodes.enjeux, showUp);\n }\n\n\n $( document ).ready(function() {\n scrollReaveal();\n });\n\n //////////////////////// end script smooth apparition des textes /////////////////\n\n //////////////////// start Timeline script ///////////////////////\n\n\n document.addEventListener('DOMContentLoaded', function() {\n let currentSlide = 0;\n\n //// responsive ///\n function getVisibleSlides() {\n if (window.innerWidth <= 600) {\n return 1; // Show 1 slide on small screens\n } else if (window.innerWidth <= 900) {\n return 2; // Show 2 slides on medium screens\n } else {\n return 3; // Show 3 slides on large screens\n }\n }\n\n function showSlides(index) {\n const slides = document.querySelectorAll('.paragraph--type--phase-deroulement');\n const totalSlides = slides.length;\n const visibleSlides = getVisibleSlides();\n const maxSlide = totalSlides - visibleSlides + 1;\n\n // Adjust the index to ensure it stays within bounds\n currentSlide = Math.max(0.6, Math.min(index, maxSlide));\n\n // Calculate the offset for the transform\n const offset = currentSlide * -70 / visibleSlides;\n const offsetmobile = currentSlide * -100 / visibleSlides;\n if (window.innerWidth <= 600){\n document.querySelector('.__timeline-content').style.transform = `translateX(${offsetmobile}%)`;\n } else {\n document.querySelector('.__timeline-content').style.transform = `translateX(${offset}%)`;\n }\n \n\n // Enable/disable arrows based on the current slide\n document.getElementById('arrowPrev').disabled = currentSlide === 0;\n document.getElementById('arrowNext').disabled = currentSlide === maxSlide;\n }\n\n function prevSlide() {\n showSlides(currentSlide - 1);\n }\n\n function nextSlide() {\n showSlides(currentSlide + 1);\n }\n\n // Attach event listeners\n document.getElementById('arrowPrev').addEventListener('click', prevSlide);\n document.getElementById('arrowNext').addEventListener('click', nextSlide);\n\n // Update month field to only show the first 3 letters\n document.querySelectorAll('.paragraph--type--phase-deroulement').forEach(function(paragraph) {\n const monthField = paragraph.querySelector('.field_field_date_de_moi div:nth-of-type(2)');\n if (monthField) {\n const monthText = monthField.textContent.trim();\n if (monthText === \"juillet\") {\n monthField.textContent = monthText.slice(0, 4);\n monthField.classList.add('after');\n } else if (monthText.length > 3) {\n monthField.textContent = monthText.slice(0, 3);\n monthField.classList.add('after');\n }\n }\n });\n\n // for each .date element add or remove ::before \n document.querySelectorAll('.date').forEach(function(dateElement) {\n const date2Element = dateElement.querySelector('.date2');\n const yearElement = dateElement.querySelector('.field_field_date_de_annee');\n\n // Check if the .date2 element is empty\n if (date2Element && !date2Element.textContent.trim()) {\n // Add the .only class to the year element\n yearElement.classList.add('only');\n }\n });\n\n // Handle window resize\n window.addEventListener('resize', function() {\n showSlides(currentSlide); // Recalculate the slides on resize\n });\n // });\n\n\n // Initialize\n showSlides(currentSlide);\n });\n\n\n //////////////////////// end Timeline script /////////////////////////////////////////////\n\n /////////////////// caracteres body actus/////////////////////////\n\n document.addEventListener('DOMContentLoaded', function() {\n // Maximum number of characters to display\n const maxChars = 140; // Adjust this value as needed\n \n document.querySelectorAll('#actus-caroussel .node-type-actualite .field_body p').forEach(function(paragraph) {\n let text = paragraph.textContent.trim();\n if (text.length > maxChars) {\n let truncatedText = text.slice(0, maxChars) + '...';\n paragraph.textContent = truncatedText;\n }\n });\n });\n \n\n //////////// slideshow home ////////////////////////// \n\n $(document).ready(function(){\n $('.content-actus .view').slick({\n slidesToShow: 3,\n // slidesToScroll: 1,\n dots: false,\n arrows: true,\n centerMode: true,\n adaptiveHeight: true,\n // centerPadding: '100px',\n responsive: [\n {\n breakpoint: 810,\n settings: {\n slidesToShow: 1,\n adaptiveHeight: false,\n arrows: true,\n draggable: true,\n centerMode: true,\n }\n }]\n });\n console.log('salut slick home');\n\n });\n\n})(jQuery, window);\n\n\n\n\n//# sourceURL=webpack://quartiers_de_demain/./src/assets/js/quartiers_de_demain.js?"); +eval("/**\n * @file\n * quartiers_de_demain behaviors.\n */\n (function (Drupal) {\n\n 'use strict';\n \n Drupal.behaviors.quartiers_de_demain = {\n attach: function (context, settings) {\n console.log('It works!');\n }\n };\n } (Drupal));\n\n \n // jQuery(document).ready(function($){\n\n // $('.open-block').click(function(){\n // $(this).toggleClass('opened');\n\n // $('.header_nav_container').toggleClass('display-nav-opened');\n \n // if(mobile == true){\n // $(\"body\").css(\"overflow\",\"hidden\");\n // }\n\n // });\n \n // // Hide the header_nav_container when a link inside it is clicked\n // $('.header_nav_container li').click(function() {\n // $('.header_nav_container').fadeOut();\n // });\n\n\n\n\n // });\n\n //////// start header ////////////\n document.addEventListener('DOMContentLoaded', function() {\n\n const header = document.querySelector('header');\n const logo = document.querySelector('#block-quartiers-de-demain-logoquartiersdedemain > div:nth-child(1) > div:nth-child(1) > a:nth-child(1) > svg:nth-child(1)');\n const headerNavContainer = document.querySelector('.header_nav_container');\n const isFirstLoad = !performance.getEntriesByType(\"navigation\")[0].type.includes('back_forward');\n const isTargetPath = window.location.pathname === '/';\n\n // Fonction pour démarrer l'animation du logo SVG\n function startLogoAnimation() {\n logo.classList.add('animated');\n }\n \n // Fonction pour arrêter l'animation du logo SVG\n function stopLogoAnimation() {\n logo.classList.remove('animated');\n }\n \n // Vérifier si le header a la classe header--collapse\n function checkHeaderCollapse() {\n if (header.classList.contains('header--collapsed')) {\n stopLogoAnimation();\n } else if (header.classList.contains('header--collapsed-already')) {\n stopLogoAnimation();\n } else {\n startLogoAnimation();\n }\n\n }\n \n // Appeler la fonction au chargement initial\n checkHeaderCollapse();\n \n // Observer les changements de classe sur le header\n const observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(mutation) {\n if (mutation.attributeName === 'class') {\n checkHeaderCollapse();\n }\n });\n });\n observer.observe(header, { attributes: true });\n \n\n // Si ce n'est pas la première charge ou si le chemin n'est pas le chemin cible, ajouter la classe immédiatement\n if (!isFirstLoad || !isTargetPath) {\n header.classList.add('header--collapsed-already');\n // logo.classList.remove('animated');\n stopLogoAnimation();\n } else {\n // Sinon, appliquer la transition après un délai\n setTimeout(() => {\n header.classList.add('header--collapsed');\n }, 5000);\n }\n\n ////////////// \n\n let lastScrollTop = 0;\n let threshold = 100; // Change this value as needed\n let isHidden = false;\n \n function slideOut() {\n headerNavContainer.animate([\n { transform: 'translateX(0)' },\n { transform: 'translateX(-100%)' }\n ], {\n duration: 300,\n fill: 'forwards'\n });\n isHidden = true;\n }\n \n function slideIn() {\n headerNavContainer.animate([\n { transform: 'translateX(-100%)' },\n { transform: 'translateX(0)' }\n ], {\n duration: 300,\n fill: 'forwards'\n });\n isHidden = false;\n }\n \n function slideDown() {\n // headerNavContainer.style.display = 'block';\n headerNavContainer.animate([\n { transform: 'translateY(0%)' },\n { transform: 'translateY(+100%)' }\n ], {\n duration: 300,\n fill: 'forwards'\n });\n isHidden = false;\n }\n \n function slideUp() {\n headerNavContainer.animate([\n { transform: 'translateY(100%)' },\n { transform: 'translateY(0%)' }\n ], {\n duration: 300,\n fill: 'forwards'\n }).onfinish = function() {\n // headerNavContainer.style.display = 'none';\n };\n isHidden = true;\n }\n // Fonction pour ajuster la hauteur du header lors du défilement\n function adjustHeaderHeight() {\n if (window.scrollY > 0) {\n header.classList.add('shrink');\n } else {\n header.classList.remove('shrink');\n }\n }\n\n function handleScroll() {\n let scrollTop = window.pageYOffset || document.documentElement.scrollTop;\n const isMobile = window.innerWidth < 811;\n\n if (scrollTop > threshold && !isHidden) {\n if (isMobile) {\n slideUp();\n } else {\n slideOut();\n }\n } else if (scrollTop <= threshold && isHidden) {\n if (isMobile) {\n slideDown();\n } else {\n slideIn();\n }\n }\n \n \n lastScrollTop = scrollTop <= 0 ? 0 : scrollTop; // For Mobile or negative scrolling\n }\n \n function handleTouchAndMouseEnter() {\n if (isHidden) {\n if (window.innerWidth < 811) {\n slideDown();\n } else {\n slideIn();\n }\n }\n }\n \n function handleTouchAndMouseLeave() {\n if (lastScrollTop > threshold && !isHidden) {\n if (window.innerWidth < 811) {\n slideUp();\n } else {\n slideOut();\n }\n }\n }\n \n window.addEventListener('scroll', handleScroll);\n window.addEventListener('scroll', adjustHeaderHeight);\n \n // Mouse events for desktop\n header.addEventListener('mouseenter', handleTouchAndMouseEnter);\n header.addEventListener('mouseleave', handleTouchAndMouseLeave);\n \n // Touch events for tablets and mobile devices\n header.addEventListener('touchstart', handleTouchAndMouseEnter);\n header.addEventListener('touchend', handleTouchAndMouseLeave);\n \n // Initial check to see if we're at the top of the page\n if (window.pageYOffset <= threshold) {\n if (window.innerWidth < 811) {\n slideDown();\n } else { \n slideIn();\n } \n } else {\n if (window.innerWidth < 811) {\n slideUp();\n } else {\n slideIn();\n }\n }\n \n });\n\n //////// end header ////////////\n \n\n\n//// ancre dans texte au click parragraphe correspondant arrive en dessous du header \n\n\n(function($, window) {\n var adjustAnchor = function() {\n var $anchor = $('.sidebar_first_container'),\n fixedElementHeight = 500;\n if ($anchor.length > 0) {\n $('html, body').stop().animate({scrollTop: $anchor.offset().top - fixedElementHeight }, 0);\n }\n };\n\n $(window).on('hashchange', function() {\n adjustAnchor();\n });\n\n\n //////////////////////// start script smooth apparition des textes /////////////////\n\n function scrollReaveal(){\n\n const nodes = {\n logo : document.querySelectorAll('#logo-animated-container'),\n chapeau : document.querySelectorAll('.field_body'),\n paragraph: document.querySelectorAll('.field_field_textes .paragraph--type--static-parts'),\n enjeux : document.querySelectorAll('.field_field_textes .paragraph--type--static-parts .enjeux'),\n }\n\n const showUp = {\n origin: 'bottom',\n delay: 100,\n duration: 1000,\n distance: '50px',\n easing: 'cubic-bezier(0.5, 0, 0, 1)'\n }\n\n const Show = {\n delay: 100,\n duration: 600,\n easing: 'cubic-bezier(0.5, 0, 0, 1)'\n }\n\n console.log(nodes);\n\n ScrollReveal().reveal(nodes.logo, Show);\n ScrollReveal().reveal(nodes.chapeau, showUp);\n ScrollReveal().reveal(nodes.paragraph, showUp);\n ScrollReveal().reveal(nodes.enjeux, showUp);\n }\n\n\n $( document ).ready(function() {\n scrollReaveal();\n });\n\n //////////////////////// end script smooth apparition des textes /////////////////\n\n //////////////////// start Timeline script ///////////////////////\n\n\n document.addEventListener('DOMContentLoaded', function() {\n let currentSlide = 0;\n\n //// responsive ///\n function getVisibleSlides() {\n if (window.innerWidth <= 600) {\n return 1; // Show 1 slide on small screens\n } else if (window.innerWidth <= 900) {\n return 2; // Show 2 slides on medium screens\n } else {\n return 3; // Show 3 slides on large screens\n }\n }\n\n function showSlides(index) {\n const slides = document.querySelectorAll('.paragraph--type--phase-deroulement');\n const totalSlides = slides.length;\n const visibleSlides = getVisibleSlides();\n const maxSlide = totalSlides - visibleSlides + 1;\n\n // Adjust the index to ensure it stays within bounds\n currentSlide = Math.max(0.6, Math.min(index, maxSlide));\n\n // Calculate the offset for the transform\n const offset = currentSlide * -70 / visibleSlides;\n const offsetmobile = currentSlide * -100 / visibleSlides;\n if (window.innerWidth <= 600){\n document.querySelector('.__timeline-content').style.transform = `translateX(${offsetmobile}%)`;\n } else {\n document.querySelector('.__timeline-content').style.transform = `translateX(${offset}%)`;\n }\n \n\n // Enable/disable arrows based on the current slide\n document.getElementById('arrowPrev').disabled = currentSlide === 0;\n document.getElementById('arrowNext').disabled = currentSlide === maxSlide;\n }\n\n function prevSlide() {\n showSlides(currentSlide - 1);\n }\n\n function nextSlide() {\n showSlides(currentSlide + 1);\n }\n\n // Attach event listeners\n document.getElementById('arrowPrev').addEventListener('click', prevSlide);\n document.getElementById('arrowNext').addEventListener('click', nextSlide);\n\n // Update month field to only show the first 3 letters\n document.querySelectorAll('.paragraph--type--phase-deroulement').forEach(function(paragraph) {\n const monthField = paragraph.querySelector('.field_field_date_de_moi div:nth-of-type(2)');\n if (monthField) {\n const monthText = monthField.textContent.trim();\n if (monthText === \"juillet\") {\n monthField.textContent = monthText.slice(0, 4);\n monthField.classList.add('after');\n } else if (monthText === \"juin\") {\n monthField.textContent = monthText.slice(0, 4);\n } else if (monthText.length > 3) {\n monthField.textContent = monthText.slice(0, 3);\n monthField.classList.add('after');\n }\n }\n });\n\n // for each .date element add or remove ::before \n document.querySelectorAll('.date').forEach(function(dateElement) {\n const date2Element = dateElement.querySelector('.date2');\n const yearElement = dateElement.querySelector('.field_field_date_de_annee');\n\n // Check if the .date2 element is empty\n if (date2Element && !date2Element.textContent.trim()) {\n // Add the .only class to the year element\n yearElement.classList.add('only');\n }\n });\n\n // Handle window resize\n window.addEventListener('resize', function() {\n showSlides(currentSlide); // Recalculate the slides on resize\n });\n // });\n\n\n // Initialize\n showSlides(currentSlide);\n });\n\n\n //////////////////////// end Timeline script /////////////////////////////////////////////\n\n /////////////////// caracteres body actus/////////////////////////\n\n document.addEventListener('DOMContentLoaded', function() {\n // Maximum number of characters to display\n const maxChars = 140; // Adjust this value as needed\n \n document.querySelectorAll('#actus-caroussel .node-type-actualite .field_body p').forEach(function(paragraph) {\n let text = paragraph.textContent.trim();\n if (text.length > maxChars) {\n let truncatedText = text.slice(0, maxChars) + '...';\n paragraph.textContent = truncatedText;\n }\n });\n });\n \n\n //////////// slideshow home ////////////////////////// \n\n $(document).ready(function(){\n $('.content-actus .view').slick({\n slidesToShow: 3,\n // slidesToScroll: 1,\n dots: false,\n arrows: true,\n centerMode: true,\n adaptiveHeight: true,\n // centerPadding: '100px',\n responsive: [\n {\n breakpoint: 810,\n settings: {\n slidesToShow: 1,\n adaptiveHeight: false,\n arrows: true,\n draggable: true,\n centerMode: true,\n }\n }]\n });\n console.log('salut slick home');\n\n });\n\n})(jQuery, window);\n\n\n\n\n//# sourceURL=webpack://quartiers_de_demain/./src/assets/js/quartiers_de_demain.js?"); /***/ }) diff --git a/web/themes/custom/quartiers_de_demain/dist/assets/css/bundle.css b/web/themes/custom/quartiers_de_demain/dist/assets/css/bundle.css index 9ed19d2..e1e4c18 100644 --- a/web/themes/custom/quartiers_de_demain/dist/assets/css/bundle.css +++ b/web/themes/custom/quartiers_de_demain/dist/assets/css/bundle.css @@ -1122,7 +1122,7 @@ footer { } #home .timeline .__timeline-content .__paragraphs { position: relative; - display: inline-block; + display: inline-flex; width: 500px; height: 1px; background: black; @@ -1503,50 +1503,45 @@ header #block-quartiers-de-demain-logoquartiersdedemain .field_field_logo .qdd-h position: relative; } -#home .visible h5:nth-of-type(1) { - animation-delay: 1s; - animation-name: Appear; - animation-duration: 1s; +#home #paragraph-id--7 .colone-picto h5, +#home #paragraph-id--7 .colone-picto p, +#home #paragraph-id--7 .colone-picto svg #pillier-1-path365, +#home #paragraph-id--7 .colone-picto svg #pillier-2-path367, +#home #paragraph-id--7 .colone-picto svg #pillier-3-path369 { + opacity: 0; } -#home .visible svg:nth-of-type(1) { - animation-delay: 2s; /* Start after h5 (1s) + h5 duration (1s) */ - animation-name: Appear; - animation-duration: 5s; /* Assuming svg animation is 5s */ +#home .visible h5:nth-of-type(1) { + animation: Appear 1s 0.2s forwards; +} +#home .visible svg #pillier-1-path365 { + stroke-dasharray: 1000; /* Longueur totale du chemin */ + stroke-dashoffset: 1000; /* Décalage initial pour cacher le chemin */ + animation: Appear 1s 1.5s forwards, fillAnimation 3s 1.5s ease-in-out forwards; /* Animation de remplissage sur 2 secondes */ } #home .visible p:nth-of-type(1) { - animation-delay: 7s; /* Start after svg (2s) + svg duration (5s) */ - animation-name: Appear; - animation-duration: 1s; + animation: Appear 1.5s 3s forwards; } #home .visible h5:nth-of-type(2) { - animation-delay: 8s; /* Start after p (7s) + p duration (1s) */ - animation-name: Appear; - animation-duration: 1s; + animation: Appear 1s 4s forwards; } -#home .visible svg:nth-of-type(2) { - animation-delay: 9s; /* Start after h5 (8s) + h5 duration (1s) */ - animation-name: Appear; - animation-duration: 5s; /* Assuming svg animation is 5s */ +#home .visible svg #pillier-2-path367 { + stroke-dasharray: 1000; /* Longueur totale du chemin */ + stroke-dashoffset: 1000; /* Décalage initial pour cacher le chemin */ + animation: Appear 1s 5s forwards, fillAnimation 3s 5s ease-in-out forwards; /* Animation de remplissage sur 2 secondes */ } #home .visible p:nth-of-type(2) { - animation-delay: 14s; /* Start after svg (9s) + svg duration (5s) */ - animation-name: Appear; - animation-duration: 1s; + animation: Appear 1.5s 6s forwards; } #home .visible h5:nth-of-type(3) { - animation-delay: 15s; /* Start after p (14s) + p duration (1s) */ - animation-name: Appear; - animation-duration: 1s; + animation: Appear 1s 7s forwards; } -#home .visible svg:nth-of-type(3) { - animation-delay: 16s; /* Start after h5 (15s) + h5 duration (1s) */ - animation-name: Appear; - animation-duration: 5s; /* Assuming svg animation is 5s */ +#home .visible svg #pillier-3-path369 { + stroke-dasharray: 1000; /* Longueur totale du chemin */ + stroke-dashoffset: 1000; /* Décalage initial pour cacher le chemin */ + animation: Appear 1s 8s forwards, fillAnimation 3s 8s ease-in-out forwards; /* Animation de remplissage sur 2 secondes */ } #home .visible p:nth-of-type(3) { - animation-delay: 21s; /* Start after svg (16s) + svg duration (5s) */ - animation-name: Appear; - animation-duration: 1s; + animation: Appear 1.5s 9s forwards; } @keyframes Appear { 0% { @@ -1556,24 +1551,6 @@ header #block-quartiers-de-demain-logoquartiersdedemain .field_field_logo .qdd-h opacity: 1; } } -#home #paragraph-id--7 .colone-picto svg #pillier-1-path365 { - stroke-dasharray: 1000; /* Longueur totale du chemin */ - stroke-dashoffset: 1000; /* Décalage initial pour cacher le chemin */ - animation: fillAnimation 5s ease-in-out forwards; /* Animation de remplissage sur 2 secondes */ - animation-delay: 5s; -} -#home #paragraph-id--7 .colone-picto svg #pillier-2-path367 { - stroke-dasharray: 0; /* Longueur totale du chemin */ - stroke-dashoffset: 1000; /* Décalage initial pour cacher le chemin */ - animation: fillAnimation 5s ease-in-out forwards; /* Animation de remplissage sur 2 secondes */ - animation-delay: 5s; -} -#home #paragraph-id--7 .colone-picto svg #pillier-3-path369 { - stroke-dasharray: 1000; /* Longueur totale du chemin */ - stroke-dashoffset: 1000; /* Décalage initial pour cacher le chemin */ - animation: fillAnimation 5s ease-in-out forwards; /* Animation de remplissage sur 2 secondes */ - animation-delay: 5s; -} @keyframes fillAnimation { from { stroke-dashoffset: 1000; /* Début du chemin de décalage complet */ @@ -2031,7 +2008,7 @@ header #block-quartiers-de-demain-logoquartiersdedemain .field_field_logo .qdd-h grid-row: 2; grid-column: 3; position: relative; - top: -70px; + top: -50px; } @media (max-width: 820px) { #home article.node-type-static #paragraph-id--7 .field_field_texte .colone-picto h5:nth-of-type(2) { diff --git a/web/themes/custom/quartiers_de_demain/src/assets/js/animated_formes.js b/web/themes/custom/quartiers_de_demain/src/assets/js/animated_formes.js index fa9f27b..6ce5f69 100644 --- a/web/themes/custom/quartiers_de_demain/src/assets/js/animated_formes.js +++ b/web/themes/custom/quartiers_de_demain/src/assets/js/animated_formes.js @@ -29,6 +29,7 @@ document.addEventListener('scroll', function() { // // Observer l'élément SVG // observer.observe(svg); +////////////////////////////////////////////////// //ANimation Pilliers const svg = document.querySelector('#paragraph-id--7 .colone-picto'); @@ -41,12 +42,11 @@ const observer = new IntersectionObserver(entries => { // svg.classList.remove('invisible'); svg.classList.add('visible'); } - // else { - // // Optionnel : Retirez la classe si nécessaire - // svg.classList.remove('visible'); - // svg.classList.add('invisible'); + else { + // Optionnel : Retirez la classe si nécessaire + svg.classList.remove('visible'); - // } + } }); }); diff --git a/web/themes/custom/quartiers_de_demain/src/assets/js/quartiers_de_demain.js b/web/themes/custom/quartiers_de_demain/src/assets/js/quartiers_de_demain.js index 05cdc8c..885f56d 100644 --- a/web/themes/custom/quartiers_de_demain/src/assets/js/quartiers_de_demain.js +++ b/web/themes/custom/quartiers_de_demain/src/assets/js/quartiers_de_demain.js @@ -347,6 +347,8 @@ if (monthText === "juillet") { monthField.textContent = monthText.slice(0, 4); monthField.classList.add('after'); + } else if (monthText === "juin") { + monthField.textContent = monthText.slice(0, 4); } else if (monthText.length > 3) { monthField.textContent = monthText.slice(0, 3); monthField.classList.add('after'); diff --git a/web/themes/custom/quartiers_de_demain/src/assets/scss/pages/home.scss b/web/themes/custom/quartiers_de_demain/src/assets/scss/pages/home.scss index 2e31dd5..9a7e4dd 100644 --- a/web/themes/custom/quartiers_de_demain/src/assets/scss/pages/home.scss +++ b/web/themes/custom/quartiers_de_demain/src/assets/scss/pages/home.scss @@ -428,7 +428,7 @@ grid-row: 2; grid-column: 3; position: relative; - top: -70px; + top: -50px; @media(max-width: 820px){ grid-row: 4; grid-column: 2; diff --git a/web/themes/custom/quartiers_de_demain/src/assets/scss/partials/animation-pilliers.scss b/web/themes/custom/quartiers_de_demain/src/assets/scss/partials/animation-pilliers.scss index 01ff10f..6692069 100644 --- a/web/themes/custom/quartiers_de_demain/src/assets/scss/partials/animation-pilliers.scss +++ b/web/themes/custom/quartiers_de_demain/src/assets/scss/partials/animation-pilliers.scss @@ -2,55 +2,53 @@ #home{ /////////////////animation pilliers ////////////// - + #paragraph-id--7 .colone-picto h5, + #paragraph-id--7 .colone-picto p, + #paragraph-id--7 .colone-picto svg #pillier-1-path365, + #paragraph-id--7 .colone-picto svg #pillier-2-path367, + #paragraph-id--7 .colone-picto svg #pillier-3-path369{ + opacity: 0; + } .visible{ h5:nth-of-type(1) { - animation-delay: 1s; - animation-name: Appear; - animation-duration: 1s; + animation: Appear 1s 0.2s forwards; } - svg:nth-of-type(1) { - animation-delay: 2s; /* Start after h5 (1s) + h5 duration (1s) */ - animation-name: Appear; - animation-duration: 5s; /* Assuming svg animation is 5s */ + svg #pillier-1-path365 { + stroke-dasharray: 1000; /* Longueur totale du chemin */ + stroke-dashoffset: 1000; /* Décalage initial pour cacher le chemin */ + animation: Appear 1s 1.5s forwards, fillAnimation 3s 1.5s ease-in-out forwards; /* Animation de remplissage sur 2 secondes */ } p:nth-of-type(1) { - animation-delay: 7s; /* Start after svg (2s) + svg duration (5s) */ - animation-name: Appear; - animation-duration: 1s; + animation: Appear 1.5s 3s forwards; } + + h5:nth-of-type(2) { - animation-delay: 8s; /* Start after p (7s) + p duration (1s) */ - animation-name: Appear; - animation-duration: 1s; + animation: Appear 1s 4s forwards; + } - svg:nth-of-type(2) { - animation-delay: 9s; /* Start after h5 (8s) + h5 duration (1s) */ - animation-name: Appear; - animation-duration: 5s; /* Assuming svg animation is 5s */ + svg #pillier-2-path367 { + stroke-dasharray: 1000; /* Longueur totale du chemin */ + stroke-dashoffset: 1000; /* Décalage initial pour cacher le chemin */ + animation: Appear 1s 5s forwards, fillAnimation 3s 5s ease-in-out forwards; /* Animation de remplissage sur 2 secondes */ } p:nth-of-type(2) { - animation-delay: 14s; /* Start after svg (9s) + svg duration (5s) */ - animation-name: Appear; - animation-duration: 1s; + animation: Appear 1.5s 6s forwards; } h5:nth-of-type(3) { - animation-delay: 15s; /* Start after p (14s) + p duration (1s) */ - animation-name: Appear; - animation-duration: 1s; + animation: Appear 1s 7s forwards; } - svg:nth-of-type(3) { - animation-delay: 16s; /* Start after h5 (15s) + h5 duration (1s) */ - animation-name: Appear; - animation-duration: 5s; /* Assuming svg animation is 5s */ + svg #pillier-3-path369 { + stroke-dasharray: 1000; /* Longueur totale du chemin */ + stroke-dashoffset: 1000; /* Décalage initial pour cacher le chemin */ + animation: Appear 1s 8s forwards, fillAnimation 3s 8s ease-in-out forwards; /* Animation de remplissage sur 2 secondes */ } p:nth-of-type(3) { - animation-delay: 21s; /* Start after svg (16s) + svg duration (5s) */ - animation-name: Appear; - animation-duration: 1s; + animation: Appear 1.5s 9s forwards; } + @keyframes Appear { 0%{ opacity: 0; @@ -59,41 +57,42 @@ opacity: 1; } } - } - #paragraph-id--7 .colone-picto svg #pillier-1-path365{ - stroke-dasharray: 1000; /* Longueur totale du chemin */ - stroke-dashoffset: 1000; /* Décalage initial pour cacher le chemin */ - animation: fillAnimation 5s ease-in-out forwards; /* Animation de remplissage sur 2 secondes */ - animation-delay: 5s; - // animation-direction: alternate; /* Animation en aller-retour */ - - - } - #paragraph-id--7 .colone-picto svg #pillier-2-path367{ - stroke-dasharray: 0; /* Longueur totale du chemin */ - stroke-dashoffset: 1000; /* Décalage initial pour cacher le chemin */ - animation: fillAnimation 5s ease-in-out forwards; /* Animation de remplissage sur 2 secondes */ - animation-delay: 5s; - // animation-direction: alternate; /* Animation en aller-retour */ - - } - #paragraph-id--7 .colone-picto svg #pillier-3-path369{ - stroke-dasharray: 1000; /* Longueur totale du chemin */ - stroke-dashoffset: 1000; /* Décalage initial pour cacher le chemin */ - animation: fillAnimation 5s ease-in-out forwards; /* Animation de remplissage sur 2 secondes */ - animation-delay: 5s; - // animation-direction: alternate; /* Animation en aller-retour */ - - } - - @keyframes fillAnimation { - from { - stroke-dashoffset: 1000; /* Début du chemin de décalage complet */ - } - to { - stroke-dashoffset: 0; /* Aucun décalage, le chemin est complètement visible */ + @keyframes fillAnimation { + from { + stroke-dashoffset: 1000; /* Début du chemin de décalage complet */ + } + to { + stroke-dashoffset: 0; /* Aucun décalage, le chemin est complètement visible */ + } } } + // #paragraph-id--7 .colone-picto svg #pillier-1-path365{ + // stroke-dasharray: 1000; /* Longueur totale du chemin */ + // stroke-dashoffset: 1000; /* Décalage initial pour cacher le chemin */ + // animation: fillAnimation 5s ease-in-out forwards; /* Animation de remplissage sur 2 secondes */ + // animation-delay: 5s; + // animation-direction: alternate; /* Animation en aller-retour */ + + + // } + // #paragraph-id--7 .colone-picto svg #pillier-2-path367{ + // stroke-dasharray: 0; /* Longueur totale du chemin */ + // stroke-dashoffset: 1000; /* Décalage initial pour cacher le chemin */ + // animation: fillAnimation 5s ease-in-out forwards; /* Animation de remplissage sur 2 secondes */ + // animation-delay: 5s; + // // animation-direction: alternate; /* Animation en aller-retour */ + + // } + // #paragraph-id--7 .colone-picto svg #pillier-3-path369{ + // stroke-dasharray: 1000; /* Longueur totale du chemin */ + // stroke-dashoffset: 1000; /* Décalage initial pour cacher le chemin */ + // animation: fillAnimation 5s ease-in-out forwards; /* Animation de remplissage sur 2 secondes */ + // animation-delay: 5s; + // // animation-direction: alternate; /* Animation en aller-retour */ + + // } + + } \ No newline at end of file diff --git a/web/themes/custom/quartiers_de_demain/src/assets/scss/partials/timeline.scss b/web/themes/custom/quartiers_de_demain/src/assets/scss/partials/timeline.scss index f3e297c..c53bc0a 100644 --- a/web/themes/custom/quartiers_de_demain/src/assets/scss/partials/timeline.scss +++ b/web/themes/custom/quartiers_de_demain/src/assets/scss/partials/timeline.scss @@ -64,7 +64,7 @@ transition: all 1s; .__paragraphs{ position: relative; - display: inline-block; + display: inline-flex; width: 500px; height: 1px; background: black;