LE-Website/lethal-extended/js/locations.js

31 lines
1000 B
JavaScript

const europeButton = document.getElementById("eu-button");
const usButton = document.getElementById("us-button");
const europeSection = document.getElementById("eu")
const usSection = document.getElementById("us")
europeButton.onclick = ev => {
if (!europeButton.classList.contains("bg-gray-700"))
europeButton.classList.add("bg-gray-700");
if (usButton.classList.contains("bg-gray-700"))
usButton.classList.remove("bg-gray-700")
if (europeSection.classList.contains("hidden")) {
europeSection.classList.remove("hidden")
usSection.classList.add("hidden")
}
};
usButton.onclick = ev => {
if (!usButton.classList.contains("bg-gray-700"))
usButton.classList.add("bg-gray-700")
if (europeButton.classList.contains("bg-gray-700"))
europeButton.classList.remove("bg-gray-700");
if (usSection.classList.contains("hidden")) {
europeSection.classList.add("hidden")
usSection.classList.remove("hidden")
}
};