Compare commits

..

7 Commits

Author SHA1 Message Date
Antoine M
388a2e6701 REMOVE unnecessary whitespace in footer template
All checks were successful
continuous-integration/drone/push Build is passing
2026-05-13 18:03:47 +02:00
Antoine M
aa2418b23c FIX problem when missing postGridtoolabr action 2026-05-13 18:03:35 +02:00
Antoine M
fc44dbe333 STYLE Refining sitemap aspect 2026-05-13 18:03:10 +02:00
Antoine M
2025df0a12 STYLE refining Home aspect 2026-05-13 18:02:41 +02:00
Antoine M
30bc1e6954 FEATURE Passing gsap text-split 2026-05-13 18:02:26 +02:00
Antoine M
5dd376b090 FEATURE FIX close submenus when opened when opening this one 2026-05-13 18:02:11 +02:00
Antoine M
2d501df378 FEATURE Introducing animations 2026-05-13 18:01:11 +02:00
10 changed files with 153 additions and 13 deletions

View File

@ -72,6 +72,8 @@ function carhop_enqueue_scripts()
wp_enqueue_script('gsap-js', 'https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/gsap.min.js', array(), false, true); wp_enqueue_script('gsap-js', 'https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/gsap.min.js', array(), false, true);
wp_enqueue_script('gsap-st', 'https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/ScrollTrigger.min.js', array('gsap-js'), false, true); wp_enqueue_script('gsap-st', 'https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/ScrollTrigger.min.js', array('gsap-js'), false, true);
wp_enqueue_script('gsap-split-text', 'https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/SplitText.min.js', array('gsap-js'), false, true);
} }
add_action('wp_enqueue_scripts', 'carhop_enqueue_scripts'); add_action('wp_enqueue_scripts', 'carhop_enqueue_scripts');

View File

@ -79,6 +79,7 @@
@import './pages/single-actualites.css'; @import './pages/single-actualites.css';
@import './pages/page-formulaire-de-depot.css'; @import './pages/page-formulaire-de-depot.css';
@import './pages/archive-fonds-archives.css'; @import './pages/archive-fonds-archives.css';
@import './pages/home.css';
/* ########### BLOCKS ############ */ /* ########### BLOCKS ############ */
@import './blocks/blocks-spacing.css'; @import './blocks/blocks-spacing.css';

View File

@ -1,4 +1,12 @@
.sitemap { .sitemap {
a:hover {
filter: none !important;
}
a[target='_blank']:after,
a[target='_blank']:after {
content: none;
display: hidden;
}
h1.sitemap__title, h1.sitemap__title,
h2, h2,
h3 { h3 {
@ -14,23 +22,68 @@
@apply font-normal uppercase tracking-widest text-4xl; @apply font-normal uppercase tracking-widest text-4xl;
} }
ul,
li {
@apply !list-none;
}
ul { ul {
@apply mt-12 grid md:grid-cols-2 lg:grid-cols-3 gap-12; @apply mt-12 grid md:grid-cols-2 lg:grid-cols-3 gap-12;
li { li {
@apply list-none text-center; @apply list-none;
/* @apply text-center; */
a { a {
@apply flex flex-col items-center justify-center underline underline-offset-4; @apply flex flex-col justify-center no-underline hover:underline underline-offset-4;
/* @apply items-center; */
} }
} }
} }
.item-catalogue a,
.has-page-icon a,
.menu-item__submenu-toggle {
@apply flex flex-col justify-center gap-3 font-medium tracking-wide text-xl;
@apply items-start;
}
.menu-item__submenu-toggle {
@apply items-center;
}
.item-catalogue,
.has-page-icon {
a img,
.menu-item__submenu-toggle img {
transition: transform 0.4s ease-out;
}
a:hover img {
transform: scale(1.3);
}
&:hover {
.menu-item__submenu-toggle img {
transform: scale(1.3);
}
}
}
.sub-menu {
@apply !mt-4 block;
.menu-item__icon-img,
.page_icon,
.page_subtitle {
@apply hidden;
}
.menu-item__title {
@apply pb-0 !mb-0;
}
}
.website-menu-list { .website-menu-list {
@apply mb-32; @apply mb-32;
} }
} }
.sitemap__inner { .sitemap__inner {
@apply container; @apply container px-0;
} }
.sitemap__title { .sitemap__title {

View File

@ -0,0 +1,12 @@
body.home {
h1 {
@screen lg {
font-size: 3.4rem !important;
}
@screen 2xl {
font-size: 3.8rem !important;
}
line-height: 1.2;
@apply max-w-screen-lg mx-auto;
}
}

View File

@ -0,0 +1,38 @@
const tl = gsap.timeline({
defaults: {
duration: 1,
y: -14,
opacity: 0,
ease: 'power4.out',
},
});
function pageHeaderAnimationInit() {
const contentElements = document.querySelectorAll(
'.page-header .page-header__content *',
);
const cover = document.querySelector('.page-header__image');
if (contentElements.length > 0) {
tl.from(contentElements, {}, '<');
}
if (cover) {
tl.from(cover, { delay: 0.2 }, '<');
}
}
function chapterSectionAnimationInit() {
const contentElements = document.querySelectorAll(
'.wp-block-carhop-blocks-chapter-section .chapter-section__content *',
);
const cover = document.querySelector('.chapter-section__cover');
if (contentElements.length > 0) {
tl.from(contentElements, {}, '<');
}
if (cover) {
tl.from(cover, { delay: 0.2 }, '<');
}
}
export { pageHeaderAnimationInit, chapterSectionAnimationInit };

View File

@ -7,6 +7,11 @@ import { searchBarInit } from './search-bar';
import singlesInit from './singles/singles'; import singlesInit from './singles/singles';
import archivesInit from './archives/archives'; import archivesInit from './archives/archives';
import handleCiteButton from './singles/cite-button'; import handleCiteButton from './singles/cite-button';
import titlesInit from './titles';
import {
pageHeaderAnimationInit,
chapterSectionAnimationInit,
} from './animation/animations';
window.addEventListener('load', function () { window.addEventListener('load', function () {
menuInit(); menuInit();
@ -18,4 +23,7 @@ window.addEventListener('load', function () {
singlesInit(); singlesInit();
archivesInit(); archivesInit();
handleCiteButton(); handleCiteButton();
titlesInit();
pageHeaderAnimationInit();
chapterSectionAnimationInit();
}); });

View File

@ -142,10 +142,12 @@ export default function archivesInit() {
} }
handleFilterPostsBy(); handleFilterPostsBy();
if (postGridToolbarActions) {
postGridToolbarActions.addEventListener('click', (e) => { postGridToolbarActions.addEventListener('click', (e) => {
e.preventDefault(); e.preventDefault();
}); });
} }
}
function updatePostCount(count: number) { function updatePostCount(count: number) {
const postCount = document.querySelector('.post-count__count'); const postCount = document.querySelector('.post-count__count');

View File

@ -14,10 +14,10 @@ export default class SearchBar {
constructor(options: SearchBarOptions = {}) { constructor(options: SearchBarOptions = {}) {
this.searchBar = document.querySelector('#search-module') as HTMLDivElement; this.searchBar = document.querySelector('#search-module') as HTMLDivElement;
this.searchButtons = document.querySelectorAll( this.searchButtons = document.querySelectorAll(
'.tools-container .search-button' '.tools-container .search-button',
) as NodeListOf<HTMLButtonElement>; // Il y a 2 boutons de recherche (1 mobile; 1 desktop) ) as NodeListOf<HTMLButtonElement>; // Il y a 2 boutons de recherche (1 mobile; 1 desktop)
this.searchInput = document.querySelector( this.searchInput = document.querySelector(
'.search-module__search-form__input' '.search-module__search-form__input',
) as HTMLInputElement; ) as HTMLInputElement;
this.init(); this.init();
@ -33,7 +33,7 @@ export default class SearchBar {
// Ajouter les event listeners // Ajouter les event listeners
this.searchButtons.forEach((button) => this.searchButtons.forEach((button) =>
button.addEventListener('click', (event) => this.toggle(event)) button.addEventListener('click', (event) => this.toggle(event)),
); );
this.searchBar.addEventListener('transitionend', this.handleTransitionEnd.bind(this)); this.searchBar.addEventListener('transitionend', this.handleTransitionEnd.bind(this));
document.addEventListener('keydown', this.handleKeyDown.bind(this)); document.addEventListener('keydown', this.handleKeyDown.bind(this));
@ -58,7 +58,10 @@ export default class SearchBar {
public open(): void { public open(): void {
if (!this.searchBar) return; if (!this.searchBar) return;
const submenus = document.querySelectorAll('#primary-menu .sub-menu-open');
submenus.forEach((submenu) => {
submenu.classList.remove('sub-menu-open');
});
this.searchBar.removeAttribute('closed'); this.searchBar.removeAttribute('closed');
this.searchBar.setAttribute('opened', ''); this.searchBar.setAttribute('opened', '');
this.isOpen = true; this.isOpen = true;
@ -100,6 +103,10 @@ export default class SearchBar {
this.searchBar.addEventListener('animationend', handleAnimationEnd); this.searchBar.addEventListener('animationend', handleAnimationEnd);
} }
public closeSubmenus(): void {
if (!this.searchBar) return;
}
private handleTransitionEnd(): void { private handleTransitionEnd(): void {
this.updateAriaHidden(); this.updateAriaHidden();
} }
@ -124,7 +131,7 @@ export default class SearchBar {
// Vérifier si le clic est en dehors de la barre de recherche ET des boutons // Vérifier si le clic est en dehors de la barre de recherche ET des boutons
const isClickOutsideSearchBar = !this.searchBar.contains(target); const isClickOutsideSearchBar = !this.searchBar.contains(target);
const isClickOnButton = Array.from(this.searchButtons || []).some((button) => const isClickOnButton = Array.from(this.searchButtons || []).some((button) =>
button.contains(target) button.contains(target),
); );
if (isClickOutsideSearchBar && !isClickOnButton) { if (isClickOutsideSearchBar && !isClickOnButton) {
@ -151,7 +158,10 @@ export default class SearchBar {
// Note: Les event listeners anonymes ne peuvent pas être supprimés facilement // Note: Les event listeners anonymes ne peuvent pas être supprimés facilement
// Dans un vrai projet, il faudrait stocker les références des fonctions // Dans un vrai projet, il faudrait stocker les références des fonctions
this.searchBar.removeEventListener('transitionend', this.handleTransitionEnd.bind(this)); this.searchBar.removeEventListener(
'transitionend',
this.handleTransitionEnd.bind(this),
);
document.removeEventListener('keydown', this.handleKeyDown.bind(this)); document.removeEventListener('keydown', this.handleKeyDown.bind(this));
document.removeEventListener('click', this.handleClickOutside.bind(this)); document.removeEventListener('click', this.handleClickOutside.bind(this));
window.removeEventListener('scroll', this.handleScroll.bind(this)); window.removeEventListener('scroll', this.handleScroll.bind(this));

15
resources/js/titles.js Normal file
View File

@ -0,0 +1,15 @@
// GSAP Text Animations
export default function titlesInit() {
const homeTitle = document.querySelector('body.home h1');
let split = SplitText.create(homeTitle, { type: 'words, lines' });
// now animate the characters in a staggered fashion
gsap.from(split.lines, {
duration: 2,
y: 40, // animate from 100px below
autoAlpha: 0, // fade in from opacity: 0 and visibility: hidden
stagger: 0.2, // 0.05 seconds between each
ease: 'power4.out',
});
}

View File

@ -66,7 +66,6 @@
<li class="belfius"> <li class="belfius">
<h3 class="section-title">Compte bancaire</h3> <h3 class="section-title">Compte bancaire</h3>
<p>Belfius <br/>IBAN BE86 7995 2072 9950 <br/>BIC GKCCBEBB</p> <p>Belfius <br/>IBAN BE86 7995 2072 9950 <br/>BIC GKCCBEBB</p>
</li> </li>
<li class="socials"> <li class="socials">
<?php echo carhop_display_social_links(); ?> <?php echo carhop_display_social_links(); ?>