Initial commit
This commit is contained in:
23
HTML/FiveM/assets/components/navbar/script.ts
Normal file
23
HTML/FiveM/assets/components/navbar/script.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
const title = document.getElementById("currentSite") as HTMLSpanElement;
|
||||
const site = fivem.getCurrentSite();
|
||||
switch (site) {
|
||||
case "rules":
|
||||
title.innerText = "Regeln";
|
||||
break;
|
||||
case "cars":
|
||||
title.innerText = "Autos";
|
||||
break;
|
||||
case "team":
|
||||
title.innerText = "Team";
|
||||
break;
|
||||
default:
|
||||
title.innerText = "Startseite";
|
||||
break;
|
||||
}
|
||||
|
||||
const header_buttons = document.getElementsByClassName("navigation_button") as HTMLCollectionOf<HTMLInputElement>;
|
||||
for (let button of header_buttons) {
|
||||
button.onclick = () => {
|
||||
location.href = fivem.hostname + button.id.replace("redirect_", "");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user