diff --git a/README.md b/README.md index 9fdaa29..1fd39ef 100644 --- a/README.md +++ b/README.md @@ -25,5 +25,5 @@ $RECAPTCHA_SECRET_KEY = ""; ### Add images To reduce image size, and to get rid of exif info ```bash -$ mogrify -strip -auto-orient -resize 2000x2000 **/*.jpg +$ mogrify -strip -auto-orient -resize 2000x2000 -quality 80 **/*.jpg ``` diff --git a/assets/scss/register.scss b/assets/scss/register.scss index 149cb89..7f74024 100644 --- a/assets/scss/register.scss +++ b/assets/scss/register.scss @@ -6,9 +6,14 @@ td { border: 0; padding-left: 20px; + vertical-align: top; &:first-child { padding-left: 0; + + figure { + max-width: 768px; + } } p { diff --git a/assets/ts/register.ts b/assets/ts/register.ts index bf4bfe3..ff7a6e3 100644 --- a/assets/ts/register.ts +++ b/assets/ts/register.ts @@ -1,32 +1,35 @@ class Register { - public static tryReplaceImage($images: JQuery): boolean { - const register: { [id: string]: string[] } = { - "Altsaxophon": ["altsaxophon_1.jpg", "altsaxophon_2.jpg", "altsaxophon_3.jpg", "altsaxophon_4.jpg", "altsaxophon_5.jpg", "saxophon_1.jpg", "saxophon_2.jpg", "saxophon_3.jpg", "saxophon_4.jpg", "saxophon_5.jpg"], - "Baritonsaxophon": ["saxophon_1.jpg", "saxophon_2.jpg", "saxophon_3.jpg", "saxophon_4.jpg", "saxophon_5.jpg"], - "Euphonium": ["euphonium_1.jpg", "euphonium_2.jpg"], - "Fagott": ["fagott_1.jpg", "fagott_2.jpg"], - "Gitarre": ["gitarre_1.jpg", "gitarre_2.jpg"], - "Horn": ["horn_1.jpg", "horn_2.jpg", "horn_3.jpg"], - "Klarinette": ["klarinette_1.jpg"], - "Klavier": ["klavier_1.jpg", "klavier_2.jpg"], - "Posaune": ["posaune_1.jpg", "posaune_2.jpg"], - "Querflöte": ["querfloete_1.jpg", "querfloete_2.jpg"], - "Schlagzeug": ["schlagzeug_1.jpg", "schlagzeug_2.jpg"], - "Tenorsaxophon": ["tenorsaxophon_1.jpg", "tenorsaxophon_2.jpg", "saxophon_1.jpg", "saxophon_2.jpg", "saxophon_3.jpg", "saxophon_4.jpg", "saxophon_5.jpg"], - "Trompete": ["trompete_1.jpg", "trompete_2.jpg"], - "Tuba": ["tuba_1.jpg", "tuba_2.jpg"] - }; + private static register: { [id: string]: string[] } = { + "Altsaxophon": ["altsaxophon_1.jpg", "altsaxophon_2.jpg", "altsaxophon_3.jpg", "altsaxophon_4.jpg", "altsaxophon_5.jpg", "saxophon_1.jpg", "saxophon_2.jpg", "saxophon_3.jpg", "saxophon_4.jpg", "saxophon_5.jpg"], + "Baritonsaxophon": ["baritonsaxophon_1.jpg", "saxophon_1.jpg", "saxophon_2.jpg", "saxophon_3.jpg", "saxophon_4.jpg", "saxophon_5.jpg"], + "Euphonium": ["euphonium_1.jpg", "euphonium_2.jpg"], + "Fagott": ["fagott_1.jpg", "fagott_2.jpg"], + "Gitarre": ["gitarre_1.jpg", "gitarre_2.jpg"], + "Horn": ["horn_1.jpg", "horn_2.jpg", "horn_3.jpg"], + "Klarinette": ["klarinette_1.jpg"], + "Klavier": ["klavier_1.jpg", "klavier_2.jpg"], + "Oboe": [], + "Posaune": ["posaune_1.jpg", "posaune_2.jpg"], + "Querflöte": ["querfloete_1.jpg", "querfloete_2.jpg"], + "Schlagzeug": ["schlagzeug_1.jpg", "schlagzeug_2.jpg"], + "Tenorsaxophon": ["tenorsaxophon_1.jpg", "tenorsaxophon_2.jpg", "saxophon_1.jpg", "saxophon_2.jpg", "saxophon_3.jpg", "saxophon_4.jpg", "saxophon_5.jpg"], + "Trompete": ["trompete_1.jpg", "trompete_2.jpg"], + "Tuba": ["tuba_1.jpg", "tuba_2.jpg"] + }; + public static tryReplaceImage($images: JQuery): boolean { const $image: JQuery = $($images[Math.floor(Math.random() * $images.length)]); if (Register.isElementInViewport($image[0])) { - const registerImageUrls = register[$image.attr("title")].filter((url: string): boolean => { - return !Register.endsWith($image.attr("src"), url); - }); - $image.fadeOut("fast", (): void => { - $image.attr("src", "/img/register/" + registerImageUrls[Math.floor(Math.random() * registerImageUrls.length)]); - $image.fadeIn("slow"); - }); - return true; + const remainingRegImageUrls = Register.register[$image.attr("title")] + .filter(url => !Register.endsWith("/" + $image.attr("src"), url)); + if (remainingRegImageUrls.length > 0) { + $image.fadeOut("fast", (): void => { + const nexIndex = Math.floor(Math.random() * remainingRegImageUrls.length); + $image.attr("src", "/img/register/" + remainingRegImageUrls[nexIndex]); + $image.fadeIn("slow"); + }); + return true; + } } return false; } diff --git a/data/termine.json b/data/termine.json index d6e0fc6..cd70ed3 100644 --- a/data/termine.json +++ b/data/termine.json @@ -5,18 +5,44 @@ "name": "Kandertalhalle", "address": "Wollbach" }, - "starttime": "2023-01-06T19:00:00Z", - "endtime": "2023-01-06T21:00:00Z", - "title": "Neujahrsempfang" + "starttime": "2023-01-26", + "endtime": "2023-01-28", + "title": "Jahreskonzert" }, { "location": { "name": "Kandertalhalle", "address": "Wollbach" }, - "starttime": "2023-01-26", - "endtime": "2023-01-28", - "title": "Jahreskonzert" + "starttime": "2023-02-09T19:00:00Z", + "endtime": "2023-02-09T21:00:00Z", + "title": "Generalversammlung" + }, + { + "location": { + "name": "Rebhüsli", + "address": "Wollbach" + }, + "starttime": "2023-03-04T18:00:00Z", + "endtime": "2023-03-04T23:00:00Z", + "title": "Fastnachtsfeuer" + }, + { + "location": { + "name": "Kandertalhalle", + "address": "Wollbach" + }, + "starttime": "2023-05-13T19:00:00Z", + "title": "Jugendkonzert" + }, + { + "location": { + "name": "Kandertalhalle", + "address": "Wollbach" + }, + "starttime": "2023-06-18T11:30:00Z", + "endtime": "2023-06-18T13:30:00Z", + "title": "Jubiläumsfest DRK Wollbach" }, { "location": { @@ -25,6 +51,71 @@ "starttime": "2023-06-30", "endtime": "2023-07-01", "title": "Open Air" + }, + { + "location": { + "name": "Kirche", + "address": "Wollbach" + }, + "starttime": "2023-07-23", + "endtime": "2023-07-23", + "title": "Kirchhofgottesdienst" + }, + { + "location": { + "address": "Wollbach" + }, + "starttime": "2023-10-07", + "title": "Sauserbummel" + }, + { + "location": { + "address": "Wollbach" + }, + "starttime": "2023-10-08", + "title": "Herbstfest" + }, + { + "location": { + "address": "Wollbach" + }, + "starttime": "2023-12-01T18:00:00Z", + "title": "Adventszauber" + }, + { + "location": { + "name": "Kandertalhalle", + "address": "Wollbach" + }, + "starttime": "2023-12-03T18:00:00Z", + "title": "Frühschoppen am Wartburgfest" + }, + { + "location": { + "name": "Kirche", + "address": "Jugendvorspiel" + }, + "starttime": "2023-12-10T17:00:00Z", + "title": "Jugendvorspiel" + } + ], + "2024": [ + { + "location": { + "name": "Kandertalhalle", + "address": "Wollbach" + }, + "starttime": "2024-01-06", + "title": "Neujahrsempfang" + }, + { + "location": { + "name": "Kandertalhalle", + "address": "Wollbach" + }, + "starttime": "2024-01-26", + "endtime": "2024-01-27", + "title": "Jahreskonzert" } ] } diff --git a/layouts/shortcodes/register.html b/layouts/shortcodes/register.html index 53756a5..8d9a310 100644 --- a/layouts/shortcodes/register.html +++ b/layouts/shortcodes/register.html @@ -18,6 +18,7 @@ +

{{ . }}

{{ range (sort (where $register "register" "eq" .) "familyName") }}

{{ .name }} {{ .familyName }}

{{ end }} diff --git a/static/img/register/baritonsaxophon_1.jpg b/static/img/register/baritonsaxophon_1.jpg new file mode 100644 index 0000000..a4ac8e7 Binary files /dev/null and b/static/img/register/baritonsaxophon_1.jpg differ diff --git a/static/img/register/oboe_1.jpg b/static/img/register/oboe_1.jpg new file mode 100644 index 0000000..561d69b Binary files /dev/null and b/static/img/register/oboe_1.jpg differ diff --git a/static/img/register/oboe_2.jpg b/static/img/register/oboe_2.jpg new file mode 100644 index 0000000..5b12f9e Binary files /dev/null and b/static/img/register/oboe_2.jpg differ