diff --git a/Public/festival/assets/festival.css b/Public/festival/assets/festival.css index 9138968..167ac79 100644 --- a/Public/festival/assets/festival.css +++ b/Public/festival/assets/festival.css @@ -1,3 +1,11 @@ +[lang] { + display: none; +} + +[lang=en] { + display: unset; +} + html { font-family: -apple-system, BlinkMacSystemFont, "SF Hello", "Helvetica Neue", Helvetica, Arial, Verdana, sans-serif; font-weight: 200; diff --git a/Public/festival/assets/festival.js b/Public/festival/assets/festival.js index 1c0ce9d..e762d30 100644 --- a/Public/festival/assets/festival.js +++ b/Public/festival/assets/festival.js @@ -1,5 +1,21 @@ var isPlaying = false; +var currentLang = 'de'; +if (window.navigator.language != 'de') { + currentLang = 'en'; +} +function localize() { + let lang = ':lang(' + currentLang + ')'; + let show = '[lang]' + lang; + document.querySelectorAll(show).forEach(function (node) { + node.style.display = 'unset'; + }); + let hide = '[lang]:not(' + lang + ')'; + document.querySelectorAll(hide).forEach(function (node) { + node.style.display = 'none'; + }); +} + function showRegisterForm() { document.getElementById("text-container").style.top = '2%' document.getElementById("register-button").style.opacity = 0 @@ -7,6 +23,7 @@ function showRegisterForm() { document.getElementById("name-form").style.display = 'inherit' document.getElementById("add-calender-event").style.display = 'none' document.getElementById("guest-name").focus() + document.getElementById("info-button").style.display = 'none'; if (!isPlaying) { playPause(); } @@ -42,6 +59,7 @@ async function participate(isParticipating) { let name = value.trim() document.getElementById("participation-buttons").style.display = 'none' document.getElementById("name-form").style.display = 'none' + document.getElementById("info-button").style.display = 'inherit' console.log("Registering: " + name); if (isParticipating) { let registered = await performRequest(name, "register") @@ -84,6 +102,14 @@ async function performRequest(name, path) { return false; } +function downloadCalender() { + if (currentLang == 'de') { + download('/festival/event.ics') + } else { + download('/festival/event-en.ics') + } +} + function download(file) { window.location = file } diff --git a/Public/festival/festival-en.ics b/Public/festival/event-en.ics similarity index 100% rename from Public/festival/festival-en.ics rename to Public/festival/event-en.ics diff --git a/Public/festival/festival.ics b/Public/festival/event.ics similarity index 100% rename from Public/festival/festival.ics rename to Public/festival/event.ics diff --git a/Public/festival/festival-info.html b/Public/festival/events.html similarity index 100% rename from Public/festival/festival-info.html rename to Public/festival/events.html diff --git a/Public/festival/festival-en.html b/Public/festival/festival-en.html deleted file mode 100644 index dbd3159..0000000 --- a/Public/festival/festival-en.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - CC Festival - - - - - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
CC Festival
-
30 July 2022   |   2 pm
-
Geiselwind, Germany
-
Register
-
- -
-
- Decline - Register -
-
Registration failed
-
Registration successful
-
Invitation declined
-
Add to calendar
-
- -
- - -
Paul Kalkbrenner - Since 77
-
Play music
-
-
-
- - diff --git a/Public/festival/festival.html b/Public/festival/register.html similarity index 62% rename from Public/festival/festival.html rename to Public/festival/register.html index 7fa9e3d..7bb481d 100644 --- a/Public/festival/festival.html +++ b/Public/festival/register.html @@ -12,12 +12,12 @@ CC Festival - - + + - - + +
@@ -42,21 +42,54 @@
CC Festival
-
30.Juli 2022   |   14:00 Uhr
-
Geiselwind
-
Registrieren
+
+ 30. Juli 2022 + 30 July 2022 +    |    + 14:00 Uhr + 2 pm +
+
+ Geiselwind + Geiselwind, Germany +
+
+ Registrieren + Register +
- +
- Ablehnen - Zusagen + + Ablehnen + Decline + + + Zusagen + Register +
-
Registrierung fehlgeschlagen
-
Registrierung erfolgreich
-
Einladung abgelehnt
-
Kalendereintrag
- Mehr Infos +
+ Registrierung fehlgeschlagen + Registration failed +
+
+ Registrierung erfolgreich + Registration successful +
+
+ Einladung abgelehnt + Invitation declined +
+
+ Kalendereintrag + Add to calendar +
+ + Mehr Infos + More info +
+