1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-12-23 17:40:11 +00:00
jfa-go/site/ts/main.ts

58 lines
2.1 KiB
TypeScript
Raw Normal View History

import { Modal } from "../../ts/modules/modal.js";
import { whichAnimationEvent } from "../../ts/modules/common.js";
import { loadBuilds } from "./repo.js";
interface window extends Window {
animationEvent: string;
}
declare var window: window;
window.animationEvent = whichAnimationEvent();
const debModal = new Modal(document.getElementById("modal-deb"));
const debButton = document.getElementById("download-deb") as HTMLAnchorElement;
debButton.onclick = debModal.toggle;
2021-06-30 17:25:51 +00:00
const debUnstable = document.getElementById("deb-unstable");
const debUnstableButton = document.getElementById("download-deb-unstable") as HTMLAnchorElement;
2021-06-30 17:25:51 +00:00
debUnstableButton.onclick = debModal.toggle;
const stableSect = document.getElementById("sect-stable");
export const unstableSect = document.getElementById("sect-unstable");
const stableButton = document.getElementById("download-stable") as HTMLSpanElement;
const unstableButton = document.getElementById("download-unstable") as HTMLSpanElement;
const dockerUnstable = document.getElementById("docker-unstable");
stableButton.onclick = () => {
2021-06-30 17:25:51 +00:00
debUnstable.classList.add("unfocused");
dockerUnstable.classList.add("unfocused");
stableButton.classList.add("@high");
2022-01-04 21:13:09 +00:00
stableButton.classList.remove("@low");
unstableButton.classList.remove("@high");
stableSect.classList.remove("unfocused");
unstableSect.classList.add("unfocused");
}
unstableButton.onclick = () => {
2021-06-30 17:25:51 +00:00
debUnstable.classList.remove("unfocused");
dockerUnstable.classList.remove("unfocused");
unstableButton.classList.add("@high");
2022-01-04 21:13:09 +00:00
unstableButton.classList.remove("@low");
stableButton.classList.remove("@high");
stableSect.classList.add("unfocused");
unstableSect.classList.remove("unfocused");
}
const dockerModal = new Modal(document.getElementById("modal-docker"));
const dockerButton = document.getElementById("download-docker") as HTMLSpanElement;
const dockerUnstableButton = document.getElementById("download-docker-unstable") as HTMLSpanElement;
dockerButton.onclick = dockerModal.toggle;
dockerUnstableButton.onclick = dockerModal.toggle;
loadBuilds();