From 3fac0ac4d815816592ac404a838d1a1366501377 Mon Sep 17 00:00:00 2001 From: tvluke <tvluke@chaotikum.org> Date: Tue, 30 May 2023 10:28:00 +0200 Subject: [PATCH] preview nicer --- _includes/nav-header.html | 6 ++++-- _includes/space-status-mobile.html | 2 +- _includes/space-status.html | 18 +++++++++--------- _sass/_normalize.scss | 14 ++++++++++++++ 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/_includes/nav-header.html b/_includes/nav-header.html index 766532e0..4e49b330 100644 --- a/_includes/nav-header.html +++ b/_includes/nav-header.html @@ -72,12 +72,14 @@ function spaceopen() { function nextevent() { if($("#nextevent").text().trim().length) { - $("#event_soon").css( "border", "3px solid orange"); + $("#event_soon").css( "border", "3px solid #E94E1B"); + $("#event_soon").append("<div style='text-align: right;'><a href='https://chaotikum.org/events/' target='_blank' style='color: #EAEAEA;'>Kalender</a></div>"); } else { $("event_soon").hide(); } if($("#nextevent_mobile").text().trim().length) { - $("#event_soon_mobile").css( "border", "3px solid orange"); + $("#event_soon_mobile").css( "border", "3px solid #E94E1B"); + $("#event_soon_mobile").append("<div style='text-align: right;'><a href='https://chaotikum.org/events/' target='_blank' style='color: #EAEAEA;'>Kalender</a></div>"); } else { $("event_soon_mobile").hide(); } diff --git a/_includes/space-status-mobile.html b/_includes/space-status-mobile.html index efcd9ce5..d4e82fc8 100644 --- a/_includes/space-status-mobile.html +++ b/_includes/space-status-mobile.html @@ -5,7 +5,7 @@ {% capture nowunix %}{{'now' | date: '%s'}}{% endcapture -%} <b>Demnächst:</b> {% for e in site.events -%} - {% capture event_start_plus %}{{e.eventdate | date: '%s' | minus: 86400 }}{% endcapture -%} + {% capture event_start_plus %}{{e.eventdate | date: '%s' | minus: 259200 }}{% endcapture -%} {% capture event_start %}{{e.eventdate | date: '%s' }}{% endcapture -%} {% if event_start_plus < nowunix and event_start > nowunix -%} <p id="nextevent_mobile"> {{ e.eventdate | date: "%d.%m.%Y %H:%M" }}: {{e.title}}</p> diff --git a/_includes/space-status.html b/_includes/space-status.html index bbd3c107..c5adf11e 100644 --- a/_includes/space-status.html +++ b/_includes/space-status.html @@ -1,13 +1,13 @@ <div id="event_soon" style="margin-top: 5px;"> -{% capture nowunix %}{{'now' | date: '%s'}}{% endcapture -%} -<b>Demnächst:</b> -{% for e in site.events -%} - {% capture event_start_plus %}{{e.eventdate | date: '%s' | minus: 86400 }}{% endcapture -%} - {% capture event_start %}{{e.eventdate | date: '%s' }}{% endcapture -%} - {% if event_start_plus < nowunix and event_start > nowunix -%} - <p id="nextevent"> {{ e.eventdate | date: "%d.%m.%Y %H:%M" }}: {{e.title}}</p> - {% endif -%} -{% endfor -%} +{%- capture nowunix %}{{'now' | date: '%s'}}{% endcapture -%} +{%- assign show_event = 2 -%} +{%- for e in site.events -%} + {%- capture event_start_plus %}{{e.eventdate | date: '%s' | minus: 259200 }}{% endcapture -%} + {%- capture event_start %}{{e.eventdate | date: '%s' }}{% endcapture -%} + {%- if event_start_plus < nowunix and event_start > nowunix and show_event > 1 -%} + <b>Demnächst:</b> + {%- assign show_event = 0 - %}<p id="nextevent"> {{ e.eventdate | date: "%d.%m.%Y %H:%M" }}: {{e.title}}</p>{% endif -%} +{%- endfor -%} </div> <div id="spaceopen" class="chaotikum-about"> Ob der Nobreakspace offen ist siehst du <a href='https://status.nobreakspace.org' target='_blank'>hier</a><p>Oder aktiviere Javascript</p> diff --git a/_sass/_normalize.scss b/_sass/_normalize.scss index c0df485a..b54eadd8 100644 --- a/_sass/_normalize.scss +++ b/_sass/_normalize.scss @@ -192,6 +192,20 @@ figcaption { text-align: center; } +#event_soon_mobile { + background-color: #fafafa; + padding: 2%; + text-align: center; + margin-top: 2px; +} + +#event_soon { + background-color: #fafafa; + padding: 2%; + text-align: center; + margin-top: 2px; +} + #spaceopen:a { background-color: #ff0000; text-align: left; -- GitLab