Browse Source

ghoul font na posledních 7 dní října 2024

pull/62/head
ticvac 1 week ago
parent
commit
592ae29d35
  1. 7
      mamweb/static/css/mamweb.css
  2. BIN
      mamweb/static/fonts/ghoul/ghoul.ttf
  3. BIN
      mamweb/static/fonts/ghoul/ghoulheadline.ttf
  4. 12
      mamweb/templates/base.html
  5. 13
      various/context_processors.py

7
mamweb/static/css/mamweb.css

@ -7,6 +7,13 @@ src: url("../fonts/OpenSans/OpenSans-Regular.ttf");
font-weight: normal; font-weight: normal;
} }
@font-face {
font-family: 'GhoulFace';
src: url("../fonts/ghoul/ghoulheadline.ttf"),
url("../fonts/ghoul/ghoul.woff");
font-weight: normal;
}
p { p {
text-align: justify; text-align: justify;
} }

BIN
mamweb/static/fonts/ghoul/ghoul.ttf

Binary file not shown.

BIN
mamweb/static/fonts/ghoul/ghoulheadline.ttf

Binary file not shown.

12
mamweb/templates/base.html

@ -35,6 +35,18 @@
{# script specifický pro stránku #} {# script specifický pro stránku #}
{% block script %}{% endblock %} {% block script %}{% endblock %}
<!-- Halloween 2024 -->
{% if halloween == 2024 %}
<script>
function printHalloween() {
console.log("Halloween 2024");
body = document.getElementsByTagName('body')[0];
body.style.fontFamily = 'GhoulFace';
}
window.onload = printHalloween;
</script>
{% endif %}
</head> </head>
<body class='{{ LOCAL_TEST_PROD }}web{% if user.is_staff %} org-logged-in{% endif %}'> <body class='{{ LOCAL_TEST_PROD }}web{% if user.is_staff %} org-logged-in{% endif %}'>

13
various/context_processors.py

@ -15,6 +15,19 @@ def april(req):
return {'april': today.year} return {'april': today.year}
return {} return {}
def halloween(req):
if 'X-Halloween' in req.headers:
try:
year = int(req.headers['X-Halloween'])
return {'halloween': year}
except:
pass # Fall-back to regular behaviour
import datetime
today = datetime.date.today()
if today.month == 10 and today.day >= 25:
return {'halloween': today.year}
return {}
def rozliseni(request): def rozliseni(request):
ltp = settings.LOCAL_TEST_PROD ltp = settings.LOCAL_TEST_PROD

Loading…
Cancel
Save