header icon: add event extension point

pull/79/head
justcool393 2022-12-15 20:34:53 -06:00 committed by geese_suck
parent 060aa2052c
commit b7f07ff53a
Signed by: geese_suck
GPG Key ID: 4D09E4B0A7264746
8 changed files with 12 additions and 23 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -4,12 +4,6 @@ EVENT_JINJA_CONST = {
"EVENT_STYLES": "blizzard.css",
"EVENT_AWARDS": True,
"EVENT_MUSIC": "music.html",
"EVENT_HEADER_ICONS": [
"/e/marseypartyxmas.webp?v=1",
"/e/marseysanta3.webp?v=1",
"/e/marseychristmaself2.webp?v=1",
"/e/marseysnowman.webp",
],
"EVENT_VISITORS_HERE_FLAVOR": [
' santa enjoyers kissing under a misletoe',
' bringing up family drama at Christmas dinner',

View File

@ -1,18 +1,6 @@
{# <script src="{{'js/event/neko.js'|asset}}"></script> #}
<script src="{{'js/event/snow.js'|asset}}"></script>
{% set banner_img = EVENT_HEADER_ICONS | random %}
<style>
img#header--icon {
background-image: url({{banner_img}});
background-size: contain;
width: 44px;
padding-left: 44px;
background-repeat: no-repeat;
}
</style> {# there's gotta be a better way than this but whatever -jc #}
<a rel="nofollow noopener noreferrer" href="https://www.youtube.com/watch?v=BuKft9LpL_0" style="text-decoration: none !important">
<link rel="stylesheet" href="{{'css/event/banner.css' | asset}}">
{% include "event/banner_house2.svg" %}

View File

@ -62,11 +62,14 @@
<div class="navbar navbar-expand-md navbar-light" id="navbar">
<div class="container-fluid" style="padding:0;">
<a href="/" class="navbar-brand mr-auto {% if not has_logo and not sub %}flex-grow-1{% endif %}">
{% if SITE_NAME == 'WPD' %}{# Temporary event code, 2022-12-11 #}
<img id="header--icon" alt="header icon" src="{{'icons-event/2022-christmas.webp' | asset_siteimg}}">
{% if SITE_NAME == 'WPD' %} {# Temporary event code, 2022-12-11 #}
{% set icon_url = 'icons-event/2022-christmas.webp' | asset_siteimg %}
{% elif HOLIDAY_EVENT %}
{% set icon_url = random_image('events/icon') %}
{% else %}
<img id="header--icon" alt="header icon" {% if sub %}src="{{sub.marsey_url}}"{% else %}src="{{'headericon.webp' | asset_siteimg}}"{% endif %}>
{% set icon_url = 'headericon.webp' | asset_siteimg %}
{% endif %}
<img id="header--icon" alt="header icon" {% if sub %}src="{{sub.marsey_url}}"{% else %}src="{{icon_url}}"{% endif %}>
</a>
{% if sub %}

View File

@ -21,8 +21,12 @@
{% endif %}
{%- endmacro -%}
{%- macro random_image(assetdir) -%}
{% set path = "assets/images/" ~ SITE_NAME ~ "/" ~ assetdir -%}
{%- macro random_image(assetdir, include_site_name=true) -%}
{% if include_site_name %}
{% set path = "assets/images/" ~ SITE_NAME ~ "/" ~ assetdir %}
{% else %}
{% set path = "assets/images/" ~ assetdir %}
{% endif %}
{{- "/" ~ path ~ "/" ~ listdir('files/' ~ path)|random() ~ '?v=45' }}
{%- endmacro -%}