Browse Source

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

pull/62/head
ticvac 2 months ago
parent
commit
592ae29d35
  1. 13
      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

13
mamweb/static/css/mamweb.css

@ -2,9 +2,16 @@
@import url("rozliseni.css");
@font-face {
font-family: 'OpenSans';
src: url("../fonts/OpenSans/OpenSans-Regular.ttf");
font-weight: normal;
font-family: 'OpenSans';
src: url("../fonts/OpenSans/OpenSans-Regular.ttf");
font-weight: normal;
}
@font-face {
font-family: 'GhoulFace';
src: url("../fonts/ghoul/ghoulheadline.ttf"),
url("../fonts/ghoul/ghoul.woff");
font-weight: normal;
}
p {

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 #}
{% 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>
<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 {}
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):
ltp = settings.LOCAL_TEST_PROD

Loading…
Cancel
Save