Compare commits
2 Commits
c1d27dc151
...
869ee77446
Author | SHA1 | Date | |
---|---|---|---|
869ee77446 | |||
5fae03b483 |
@ -107,31 +107,33 @@ declare const Prism: any;
|
|||||||
|
|
||||||
let avatarType = 0;
|
let avatarType = 0;
|
||||||
const headshot = document.getElementById("index-headshot") as HTMLImageElement;
|
const headshot = document.getElementById("index-headshot") as HTMLImageElement;
|
||||||
headshot.addEventListener("click", (ev: MouseEvent) => {
|
if (headshot) {
|
||||||
if (avatarType === 0) {
|
headshot.addEventListener("click", (ev: MouseEvent) => {
|
||||||
headshot.classList.add("headshot-spin", "headshot-spin-start");
|
if (avatarType === 0) {
|
||||||
setTimeout(() => {
|
headshot.classList.add("headshot-spin", "headshot-spin-start");
|
||||||
headshot.classList.remove("headshot-spin-start");
|
|
||||||
headshot.src = "/img/avatar_512x512.jpg"
|
|
||||||
headshot.classList.add("headshot-spin", "headshot-spin-end");
|
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
headshot.classList.remove("headshot-spin", "headshot-spin-end");
|
headshot.classList.remove("headshot-spin-start");
|
||||||
avatarType = 1;
|
headshot.src = "/img/avatar_512x512.jpg"
|
||||||
}, 800);
|
headshot.classList.add("headshot-spin", "headshot-spin-end");
|
||||||
}, 400);
|
|
||||||
} else if (avatarType === 1) {
|
|
||||||
headshot.classList.add("headshot-spin", "headshot-spin-start");
|
|
||||||
setTimeout(() => {
|
|
||||||
headshot.classList.remove("headshot-spin-start");
|
|
||||||
headshot.src = "/img/headshot_512x512_2023.jpg"
|
|
||||||
headshot.classList.add("headshot-spin", "headshot-spin-end");
|
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
headshot.classList.remove("headshot-spin", "headshot-spin-end");
|
||||||
|
avatarType = 1;
|
||||||
|
}, 800);
|
||||||
|
}, 400);
|
||||||
|
} else if (avatarType === 1) {
|
||||||
|
headshot.classList.add("headshot-spin", "headshot-spin-start");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
headshot.classList.remove("headshot-spin", "headshot-spin-end");
|
headshot.classList.remove("headshot-spin-start");
|
||||||
avatarType = 0;
|
headshot.src = "/img/headshot_512x512_2023.jpg"
|
||||||
}, 800);
|
headshot.classList.add("headshot-spin", "headshot-spin-end");
|
||||||
}, 400);
|
|
||||||
}
|
setTimeout(() => {
|
||||||
});
|
headshot.classList.remove("headshot-spin", "headshot-spin-end");
|
||||||
|
avatarType = 0;
|
||||||
|
}, 800);
|
||||||
|
}, 400);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
|
Loading…
Reference in New Issue
Block a user