2020-06-28 15:44:59 +00:00
|
|
|
import { nextAnimationFrame } from "../../utils";
|
|
|
|
|
2020-07-02 10:26:08 +00:00
|
|
|
function expandPage(root: HTMLElement) {
|
|
|
|
// Show all sections
|
|
|
|
root.querySelectorAll<HTMLElement>("div.hidden").forEach((div) => {
|
|
|
|
div.style.display = "block";
|
|
|
|
div.style.opacity = "1";
|
|
|
|
});
|
|
|
|
|
|
|
|
// Hide buttons
|
|
|
|
root.querySelector<HTMLElement>(".action_buttons").style.display = "none";
|
|
|
|
|
|
|
|
// Remove vertical centering
|
|
|
|
root.classList.remove("center");
|
|
|
|
}
|
|
|
|
|
2020-06-28 15:44:59 +00:00
|
|
|
export function welcomeScript(root: HTMLElement): void {
|
|
|
|
const expandLink = document.getElementById("welcome_expand");
|
|
|
|
expandLink.addEventListener("click", async () => {
|
2020-07-02 10:26:08 +00:00
|
|
|
expandPage(root);
|
2020-06-28 15:44:59 +00:00
|
|
|
const featureDiv = root.querySelector<HTMLDivElement>(".features");
|
|
|
|
await nextAnimationFrame();
|
|
|
|
featureDiv.scrollIntoView({
|
|
|
|
block: "start",
|
|
|
|
inline: "nearest",
|
|
|
|
behavior: "smooth",
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export default { welcomeScript };
|