Browse Source

Merge pull request 'ghoul_font' (!63) from ghoul_font into master

Reviewed-on: #63
pull/52/head^2
ticvac 1 week ago
parent
commit
622b632773
  1. 1
      mamweb/settings_common.py
  2. 7
      mamweb/static/css/base.css
  3. BIN
      mamweb/static/fonts/ghoul/ghoul.ttf
  4. BIN
      mamweb/static/fonts/ghoul/ghoulheadline.ttf
  5. 13
      mamweb/templates/april.html
  6. 13
      various/context_processors.py

1
mamweb/settings_common.py

@ -87,6 +87,7 @@ TEMPLATES = [
'header_fotky.context_processors.vzhled',
'various.context_processors.rozliseni',
'various.context_processors.april',
'various.context_processors.halloween',
)
},
},

7
mamweb/static/css/base.css

@ -8,6 +8,13 @@
font-weight: normal;
}
@font-face {
font-family: 'GhoulFace';
src: url("../fonts/ghoul/ghoulheadline.ttf"),
url("../fonts/ghoul/ghoul.woff");
font-weight: normal;
}
body {
font-size: 14px;
font-family: 'OpenSans';

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

Binary file not shown.

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

Binary file not shown.

13
mamweb/templates/april.html

@ -78,3 +78,16 @@
walkText(document.body);
</script>
{% endif %}
{% if halloween == 2024 %}
<script>
function printHalloween() {
console.log("Halloween 2024");
body = document.getElementsByTagName('body')[0];
body.style.fontFamily = 'GhoulFace';
}
window.onload = printHalloween;
</script>
{% 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