2022-01-30 11:18:16 +01:00
|
|
|
class notFoundButtons extends HTMLElement {
|
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
|
|
|
|
this.windowResized = false;
|
|
|
|
|
|
|
|
const redButton = document.createElement("div");
|
|
|
|
redButton.classList.add("button");
|
|
|
|
redButton.classList.add("red");
|
|
|
|
this.appendChild(redButton);
|
|
|
|
|
|
|
|
const yellowButton = document.createElement("div");
|
|
|
|
yellowButton.classList.add("button");
|
|
|
|
yellowButton.classList.add("yellow");
|
|
|
|
this.appendChild(yellowButton);
|
|
|
|
|
|
|
|
const greenButton = document.createElement("div");
|
|
|
|
greenButton.classList.add("button");
|
|
|
|
greenButton.classList.add("green");
|
|
|
|
this.appendChild(greenButton);
|
|
|
|
|
|
|
|
greenButton.onclick
|
|
|
|
|
|
|
|
greenButton.onclick = () => {
|
|
|
|
const terminal = document.querySelector(".terminal-window");
|
|
|
|
if (!this.windowResized) {
|
|
|
|
terminal.style.width = "95%";
|
|
|
|
terminal.style.height = "95%";
|
|
|
|
terminal.style.top = "2%";
|
|
|
|
this.windowResized = true;
|
|
|
|
} else {
|
|
|
|
terminal.style.width = "37.5rem";
|
|
|
|
terminal.style.height = "22.5rem";
|
|
|
|
terminal.style.top = "10.5rem";
|
2022-02-11 10:24:39 +01:00
|
|
|
this.windowResized = false;
|
2022-01-30 11:18:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
redButton.onclick = () => {
|
|
|
|
location.href = "https://jonasled.de";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
getWidth() {
|
|
|
|
return Math.max(
|
|
|
|
document.body.scrollWidth,
|
|
|
|
document.documentElement.scrollWidth,
|
|
|
|
document.body.offsetWidth,
|
|
|
|
document.documentElement.offsetWidth,
|
|
|
|
document.documentElement.clientWidth
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
getHeight() {
|
|
|
|
return Math.max(
|
|
|
|
document.body.scrollHeight,
|
|
|
|
document.documentElement.scrollHeight,
|
|
|
|
document.body.offsetHeight,
|
|
|
|
document.documentElement.offsetHeight,
|
|
|
|
document.documentElement.clientHeight
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-11 10:24:39 +01:00
|
|
|
customElements.define("jl-404_buttons", notFoundButtons);
|