blob: b4933376d4e934428a0d297e6f2467b3a6b4e66b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
export default function initLogoAnimation() {
window.addEventListener('beforeunload', () => {
document.querySelector('.tanuki-logo')?.classList.add('animate');
});
}
export function initPortraitLogoDetection() {
const image = document.querySelector('.js-portrait-logo-detection');
image?.addEventListener(
'load',
({ currentTarget: img }) => {
const isPortrait = img.height > img.width;
if (isPortrait) {
// Limit the width when the logo has portrait format
img.classList.replace('gl-h-10', 'gl-w-10');
}
img.classList.remove('gl-visibility-hidden');
},
{ once: true },
);
}
|