FEATURE Add alternate picture rotation functionality to enhance image presentation
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
10be87dd38
commit
d3edfad1df
11
resources/js/alternate-pictures.ts
Normal file
11
resources/js/alternate-pictures.ts
Normal 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');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -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();
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user