Skip to content

Commit

Permalink
neue Termine, register bilder fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiliavir committed Jan 25, 2023
1 parent 6e33366 commit d6092f7
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 32 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
5 changes: 5 additions & 0 deletions assets/scss/register.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
td {
border: 0;
padding-left: 20px;
vertical-align: top;

&:first-child {
padding-left: 0;

figure {
max-width: 768px;
}
}

p {
Expand Down
53 changes: 28 additions & 25 deletions assets/ts/register.ts
Original file line number Diff line number Diff line change
@@ -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;
}
Expand Down
103 changes: 97 additions & 6 deletions data/termine.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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"
}
]
}
1 change: 1 addition & 0 deletions layouts/shortcodes/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
</figure>
</td>
<td>
<h2>{{ . }}</h2>
{{ range (sort (where $register "register" "eq" .) "familyName") }}
<p>{{ .name }} {{ .familyName }}</p>
{{ end }}
Expand Down
Binary file added static/img/register/baritonsaxophon_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/register/oboe_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/register/oboe_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d6092f7

Please sign in to comment.