FEATURE Add alternate picture rotation functionality to enhance image presentation
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Antoine M 2025-12-04 17:03:17 +01:00
parent 10be87dd38
commit d3edfad1df
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,11 @@
export default function alternatePictures() {
const images = document.querySelectorAll('.wp-block-image.is-style-framed');
images.forEach((img, index) => {
if (index % 2 === 0) {
img.classList.add('rotate-left');
} else {
img.classList.add('rotate-right');
}
});
}

View File

@ -2,9 +2,11 @@ import menuInit from './header';
import initFooterShapes from './footer';
import handleScrollTop from './utilities/scroll-top';
import handleInsidePageScrolling from './page-scrolling';
import alternatePictures from './alternate-pictures';
window.addEventListener('load', function () {
menuInit();
initFooterShapes();
handleScrollTop();
handleInsidePageScrolling();
alternatePictures();
});