summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/program_parser.py14
-rw-r--r--src/static/main.css11
-rw-r--r--src/templates/program.html5
3 files changed, 25 insertions, 5 deletions
diff --git a/src/program_parser.py b/src/program_parser.py
index a104ecf..5586765 100755
--- a/src/program_parser.py
+++ b/src/program_parser.py
@@ -21,7 +21,14 @@ class Event:
duration: datetime.timedelta = None
pretty: str = None
progress: float = 0
+ classes: list[str] = dataclasses.field(default_factory=list)
+specials = { # Special programs get an easter with a css class
+ 'rainbow': [ 'hello world', 'hacker jeopardy', 'goodbye world' ],
+ 'radio': ['radio'],
+ 'egg': ['æg'],
+ 'ctf': ['ctf'],
+}
class ProgramParser:
'''
@@ -68,6 +75,13 @@ class ProgramParser:
#print('Start date: ', event["start_date"])
#print("End date: ", event["end_date"])
#print()
+
+ # css classes
+ for css_class, titles in specials.items():
+ for title in titles:
+ if title in event.title.lower():
+ event.classes.append(css_class)
+
program.append(event)
program = sorted(program, key=lambda x: x.start_date)
diff --git a/src/static/main.css b/src/static/main.css
index c0002a1..36739e9 100644
--- a/src/static/main.css
+++ b/src/static/main.css
@@ -32,7 +32,6 @@ hr {
/* Program */
#program {
- white-space-collapse: collapse; /* Allow program template to be spaced legibly */
line-height: var(--line-height);
}
@@ -86,3 +85,13 @@ hr {
content: "🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚🥚";
opacity: 0.33;
}
+
+.radio::after {
+ content: "📻📻📻📻📻📻📻📻📻📻📻📻📻📻📻📻📻📻📻📻📻📻📻📻📻📻📻📻";
+ opacity: 0.33;
+}
+
+.ctf::after {
+ content: "🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩🚩";
+ opacity: 0.33;
+}
diff --git a/src/templates/program.html b/src/templates/program.html
index 67b37c8..0d1ae9c 100644
--- a/src/templates/program.html
+++ b/src/templates/program.html
@@ -6,10 +6,7 @@
<hr>
{% endif %}
<div class="program-entry">
- <div class="program-progress
- {% if 'hacker jeopardy' in event.title | lower %} rainbow
- {% elif 'æg' in event.title | lower %} egg{% endif %}"
- style="width: {{event.progress}}%"></div>
+ <div class="program-progress{% for class in event.classes %} {{ class }} {% endfor %}" style="width: {{event.progress}}%"></div>
<div class="program-text">
<span class="program-title">{{ event.short }}</span>
<span class="program-spacer">{{ event.spacer }} </span>