Skip to content

Commit

Permalink
Automated holiday hero shenanigans that might break things
Browse files Browse the repository at this point in the history
  • Loading branch information
meldra committed Dec 30, 2024
1 parent bb825bd commit 48a3c04
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 1 deletion.
25 changes: 25 additions & 0 deletions _includes/herolights.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<section class="hero">
<div class="logo">
<picture>
<source media="(prefers-reduced-motion)" type="image/png" srcset="/static/img/libera-lights.png" />
<source type="image/webp" srcset="/static/img/libera-lights.webp" />
<img min-height="60px" alt="" src="/static/img/libera-lights.gif" data-proofer-ignore>
</picture>
<h1>Libera.&ZeroWidthSpace;Chat</h1>
</div>

<div class="tagline">
<p>
Providing a community platform for free and open-source software and peer directed projects.
</p>

<p>
Connect by pointing your IRC client to <a href="{{ site.irc.tls.link }}">{{ site.irc.tls.name }}</a>
</p>
</div>

<div class="cta">
<a role="button" href="/guides/clients">Choosing an IRC client</a>
<a role="button" href="/chanreg">Channel Namespaces</a>
</div>
</section>
25 changes: 25 additions & 0 deletions _includes/heronewyear.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<section class="hero">
<div class="logo">
<picture>
<source media="(prefers-reduced-motion)" type="image/png" srcset="/static/img/libera-newyears.png" />
<source type="image/webp" srcset="/static/img/libera-newyears.webp" />
<img min-height="60px" alt="" src="/static/img/libera-newyears.gif" data-proofer-ignore>
</picture>
<h1 class="newyear">Libera.&ZeroWidthSpace;Chat</h1>
</div>

<div class="tagline">
<p>
Providing a community platform for free and open-source software and peer directed projects.
</p>

<p>
Connect by pointing your IRC client to <a href="{{ site.irc.tls.link }}">{{ site.irc.tls.name }}</a>
</p>
</div>

<div class="cta">
<a role="button" href="/guides/clients">Choosing an IRC client</a>
<a role="button" href="/chanreg">Channel Namespaces</a>
</div>
</section>
21 changes: 21 additions & 0 deletions _includes/heroween.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<section class="hero">
<div class="logo">
<img min-height="60px" alt="" src="/static/img/libera-ween.svg" data-proofer-ignore>
<h1>Libera.&ZeroWidthSpace;Chat</h1>
</div>

<div class="tagline">
<p>
Providing a community platform for free and open-source software and peer directed projects.
</p>

<p>
Connect by pointing your IRC client to <a href="{{ site.irc.tls.link }}">{{ site.irc.tls.name }}</a>
</p>
</div>

<div class="cta">
<a role="button" href="/guides/clients">Choosing an IRC client</a>
<a role="button" href="/chanreg">Channel Namespaces</a>
</div>
</section>
12 changes: 12 additions & 0 deletions _includes/inline-hero-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
width: 50%;
}

.hero .logo picture {
display: flex;
justify-content: center;
}

.hero .logo h1 {
margin: 0;
font-family: Comfortaa, Ubuntu, sans-serif;
Expand All @@ -41,6 +46,10 @@
font-weight: bold;
}

.hero .logo h1.newyear {
margin-block-start: 0rem;
}

.hero .tagline {
grid-area: tagline;
align-self: end;
Expand Down Expand Up @@ -89,6 +98,9 @@
font-size: 3.25rem;
margin-block-start: -2.5rem;
}
.hero .logo h1.newyear {
margin-block-start: -0.5rem;
}
.hero .tagline, .hero .cta {
justify-self: start;
}
Expand Down
22 changes: 21 additions & 1 deletion _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,28 @@

<body>
{%- include nav.html -%}
{%- assign year = "now" | date: "%Y" -%}
{%- assign thisyearts = "-01-01 00:00:00" | prepend: year | date: '%s' -%}
{%- assign nextyearts = thisyearts | plus: 31536000 | date: '%s' -%}
{%- assign startspooky = "-10-01 00:00:00" | prepend: year | date: '%s' -%}
{%- assign endspooky = "-11-01 23:59:59" | prepend: year | date: '%s' -%}
{%- assign startlights = "-12-14 23:59:59" | prepend: year | date: '%s' -%}
{%- assign endlights = "-12-30 23:59:59" | prepend: year | date: '%s'-%}
{%- assign startny = "-12-31 00:00:00" | prepend: year | date: '%s' -%}
{%- assign endny = "-01-02" | prepend: year | date: '%s'-%}
{%- assign today = "now" | date: '%s' -%}

{%- include hero.html -%}
{%- if startspooky <= today and today <= endspooky -%}
{%- include heroween.html -%}
{%- elsif startlights <= today and today <= endlights -%}
{%- include herolights.html -%}
{%- elsif startny <= today and today <= nextyearts -%}
{%- include heronewyear.html -%}
{%- elsif thisyearts <= today and today <= endny -%}
{%- include heronewyear.html -%}
{%- else -%}
{%- include hero.html -%}
{% endif %}

<main id="main">
{%- include article.html article=site.posts.first -%}
Expand Down

0 comments on commit 48a3c04

Please sign in to comment.