2023-08-10 13:19:11 +00:00
|
|
|
import UI from "./UI";
|
2023-08-10 21:47:28 +00:00
|
|
|
import Input from "./Input";
|
2024-05-04 12:11:49 +00:00
|
|
|
import Callout from "./Callout";
|
2023-08-10 03:56:12 +00:00
|
|
|
|
2023-08-10 13:36:51 +00:00
|
|
|
declare const Handlebars: any;
|
2023-08-10 22:28:23 +00:00
|
|
|
declare const Prism: any;
|
2024-05-03 22:31:47 +00:00
|
|
|
declare const lucide: any;
|
2023-08-04 11:55:16 +00:00
|
|
|
|
|
|
|
(() => {
|
2024-05-04 12:11:49 +00:00
|
|
|
Callout.foldAll();
|
2024-05-03 22:31:47 +00:00
|
|
|
lucide.createIcons();
|
|
|
|
|
2023-08-10 22:28:23 +00:00
|
|
|
Prism.languages.extend('markup', {});
|
2023-08-13 23:58:32 +00:00
|
|
|
Prism.languages.hex = {
|
|
|
|
'number': {
|
2023-08-16 14:17:05 +00:00
|
|
|
pattern: /(?:[a-fA-F0-9]{3}){1,2}\b/i,
|
2023-08-13 23:58:32 +00:00
|
|
|
lookbehind: true
|
|
|
|
}
|
|
|
|
};
|
|
|
|
Prism.languages.binary = {
|
|
|
|
'number': {
|
|
|
|
pattern: /[10]+/i,
|
|
|
|
lookbehind: true
|
|
|
|
}
|
|
|
|
};
|
2023-08-10 22:28:23 +00:00
|
|
|
Prism.languages.insertBefore('custom', 'tag', {
|
|
|
|
'mark': {
|
|
|
|
pattern: /<\/?mark(?:\s+\w+(?:=(?:"[^"]*"|'[^']*'|[^\s'">=]+))?\s*|\s*)\/?>/,
|
|
|
|
greedy: true
|
|
|
|
}
|
|
|
|
});
|
2023-08-11 01:08:48 +00:00
|
|
|
|
2023-09-24 16:15:40 +00:00
|
|
|
Handlebars.registerHelper("urlEncode", encodeURIComponent);
|
|
|
|
|
2023-08-10 21:47:28 +00:00
|
|
|
Input.registerShortcut(Input.KONAMI_CODE, () => {
|
|
|
|
window.open("https://www.youtube.com/watch?v=dQw4w9WgXcQ", "_blank");
|
|
|
|
});
|
|
|
|
|
2023-08-10 14:15:06 +00:00
|
|
|
UI.updateUI();
|
2024-02-19 22:44:28 +00:00
|
|
|
|
2024-02-28 19:07:42 +00:00
|
|
|
let avatarType = 0;
|
|
|
|
const headshot = document.getElementById("index-headshot") as HTMLImageElement;
|
2024-03-02 05:32:27 +00:00
|
|
|
if (headshot) {
|
|
|
|
headshot.addEventListener("click", (ev: MouseEvent) => {
|
|
|
|
if (avatarType === 0) {
|
|
|
|
headshot.classList.add("headshot-spin", "headshot-spin-start");
|
2024-02-28 19:07:42 +00:00
|
|
|
setTimeout(() => {
|
2024-03-02 05:32:27 +00:00
|
|
|
headshot.classList.remove("headshot-spin-start");
|
|
|
|
headshot.src = "/img/avatar_512x512.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");
|
2024-02-28 19:07:42 +00:00
|
|
|
setTimeout(() => {
|
2024-03-02 05:32:27 +00:00
|
|
|
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 = 0;
|
|
|
|
}, 800);
|
|
|
|
}, 400);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2023-08-04 11:55:16 +00:00
|
|
|
})();
|