mirror of
https://github.com/Queer-Lexikon/regenbogenkarte
synced 2024-11-10 06:34:21 +00:00
Add Reset Button
This commit is contained in:
parent
31d09e30fa
commit
0cc7cc15a6
3 changed files with 15 additions and 1 deletions
|
@ -233,6 +233,12 @@
|
|||
<!-- HAMBURGER MENU END -->
|
||||
|
||||
<!-- #region Emergency button -->
|
||||
<button
|
||||
id="reset-button"
|
||||
class="bg-green-800 bottom-0 sticky text-white px-4 py-3 md:absolute md:right-2 md:bottom-20 md:rounded-full"
|
||||
>
|
||||
Reset
|
||||
</button>
|
||||
<button
|
||||
id="emergency-button"
|
||||
class="bg-red-800 bottom-0 sticky text-white px-4 py-3 z-emergencyButton md:absolute md:right-2 md:bottom-6 md:rounded-full"
|
||||
|
|
3
main.ts
3
main.ts
|
@ -4,7 +4,7 @@ import { setupHamburger } from "./ts/hamburger";
|
|||
import { initializeMap } from "./ts/map";
|
||||
import "@fontsource/ubuntu/latin.css";
|
||||
import { setupLegend } from "./ts/legend";
|
||||
import { setupEmergencyButton } from "./ts/emergency-button";
|
||||
import { setupEmergencyButton, setupResetButton } from "./ts/buttons";
|
||||
import { addGoatCounter } from "./ts/goatcounter";
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
|
@ -13,6 +13,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
setupHamburger();
|
||||
setupLegend();
|
||||
setupEmergencyButton();
|
||||
setupResetButton();
|
||||
|
||||
if (import.meta.env.VITE_QUEER_LEXIKON_PRIVATE === "true") {
|
||||
addGoatCounter();
|
||||
|
|
|
@ -9,3 +9,10 @@ export const setupEmergencyButton = () => {
|
|||
location.replace(NAVIGATE_TO_URI);
|
||||
});
|
||||
};
|
||||
|
||||
export const setupResetButton = () => {
|
||||
const btn = <HTMLButtonElement>document.getElementById("reset-button");
|
||||
btn?.addEventListener("click", () => {
|
||||
window.location.reload();
|
||||
});
|
||||
};
|
Loading…
Reference in a new issue