From 500e267852f98c1ad0f68adb942e7cf82e54d650 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 13 Jun 2026 13:22:31 +0200 Subject: generalize Makefile --- cockpit/Makefile | 19 +----- cockpit/cockpit.css | 180 --------------------------------------------------- cockpit/cockpit.html | 102 ----------------------------- cockpit/index.css | 180 +++++++++++++++++++++++++++++++++++++++++++++++++++ cockpit/index.html | 102 +++++++++++++++++++++++++++++ common.mk | 18 ++++++ 6 files changed, 301 insertions(+), 300 deletions(-) delete mode 100644 cockpit/cockpit.css delete mode 100644 cockpit/cockpit.html create mode 100644 cockpit/index.css create mode 100644 cockpit/index.html create mode 100644 common.mk diff --git a/cockpit/Makefile b/cockpit/Makefile index ca7194a..23f8a8f 100644 --- a/cockpit/Makefile +++ b/cockpit/Makefile @@ -1,18 +1 @@ -dist/index.html: cockpit.html cockpit.css dist/main.js - echo | pandoc --template cockpit.html --embed-resources --standalone > $@ - -dist/main.js: $(wildcard js/*.js) - $(MAKE) dev - -.PHONY: mock dev prod -mock: - npm run build:mock - $(MAKE) - -dev: - npm run build:dev - $(MAKE) - -prod: - npm run build - $(MAKE) +include ../common.mk diff --git a/cockpit/cockpit.css b/cockpit/cockpit.css deleted file mode 100644 index 810442e..0000000 --- a/cockpit/cockpit.css +++ /dev/null @@ -1,180 +0,0 @@ -#student-selection-container { - margin: 0.2rem; -} - -#student-selection-search-container { - position: relative; -} - -#student-selection { - box-sizing: border-box; - width: 100%; - padding: 0.75rem 2.5rem 0.75rem 1rem; - margin-bottom: 1.5rem; - border: 1px solid #ddd; - border-radius: 5pt; - font-size: 1.5rem; -} - -#student-selection-clear { - position: absolute; - right: 0.75rem; - transform: translateY(-175%); - border: none; - background: transparent; - font-size: 1.875rem; - cursor: pointer; - color: #888; -} - -#student-selection-clear:hover { - color: #333; -} - -#student-selection:focus { - border-color: #0077ff; -} - -#student-selection-list { - list-style: none; -} - -#student-selection-list li { - padding: 0.75rem 1rem; - border-bottom: 1px solid #eee; - cursor: pointer; - transition: background 0.2s; -} - -#student-selection-list li:hover { - background: #f0f8ff; -} - -#student-selection-list li.active { - background: #0077ff; - color: white; -} - -#student-selection-list li > u.student-selection-list-highlight { - font-weight: bold; -} - -#student-selection-noresults { - color: red; - text-align: center; - margin-top: 1rem; -} - -.student-info-banner { - display: flex; -} - -#student-info-icon { - flex: 0 1 20%; - margin: 0.2rem; - max-width: 20%; - clip-path: circle(); -} - -#student-info-name-container { - flex: 50%; - margin: 0.2rem; -} - -#student-info-name { - font-size: 1.2rem; -} - -#student-info-tag { - border-radius: 5pt; - background: gray; - font-size: 0.8rem; - padding: 3pt; - display: none; - width: min-content; -} - -#student-info-coach-container { - margin: 0.2rem; - flex: 0 1 20%; - flex-direction: column; -} - -.student-info-mid-element { - padding: 5pt; - border: black solid 0.2pt; - border-radius: 5pt; - margin: 0.2rem; - text-align: center; - hyphens: auto; - flex: 1; -} - -.student-info-points { - display: block; - font-size: 2rem; - margin-bottom: 5px; -} - -#student-info-green { - color: green; -} - -#student-info-orange { - color: orange; -} - -#student-info-red { - color: red; -} - -#student-info-level { - font-size: 1.2rem; - display: block; -} - -#student-info-point-reason-container { - margin: 0.2rem; -} - -#student-info-point-reason { - box-sizing: border-box; - padding: 10px; - width: 100%; - font-size: 0.8rem; - letter-spacing: 1px; - line-height: 1.5; - border-radius: 5px; - border: 1px solid #cccccc; -} - -#student-info-point-reason-submit { - position: absolute; - right: 0.75rem; - transform: translateY(-175%); - border: none; - background: transparent; - font-size: 1.875rem; - cursor: pointer; - color: #888; -} - -#student-info-stickers-container { - flex: 70%; -} - -#student-info-bonus-container { - flex: 30%; -} - -.student-info-bottom-element { - padding: 5pt; - border: black solid 0.2pt; - border-radius: 5pt; - margin: 0.2rem; - height: 5rem; -} - -#student-info-bonus-amount { - font-size: 2rem; -} diff --git a/cockpit/cockpit.html b/cockpit/cockpit.html deleted file mode 100644 index 909a109..0000000 --- a/cockpit/cockpit.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - Cockpit - - - - - - - - -
-
- - -
- - -
- - - - diff --git a/cockpit/index.css b/cockpit/index.css new file mode 100644 index 0000000..810442e --- /dev/null +++ b/cockpit/index.css @@ -0,0 +1,180 @@ +#student-selection-container { + margin: 0.2rem; +} + +#student-selection-search-container { + position: relative; +} + +#student-selection { + box-sizing: border-box; + width: 100%; + padding: 0.75rem 2.5rem 0.75rem 1rem; + margin-bottom: 1.5rem; + border: 1px solid #ddd; + border-radius: 5pt; + font-size: 1.5rem; +} + +#student-selection-clear { + position: absolute; + right: 0.75rem; + transform: translateY(-175%); + border: none; + background: transparent; + font-size: 1.875rem; + cursor: pointer; + color: #888; +} + +#student-selection-clear:hover { + color: #333; +} + +#student-selection:focus { + border-color: #0077ff; +} + +#student-selection-list { + list-style: none; +} + +#student-selection-list li { + padding: 0.75rem 1rem; + border-bottom: 1px solid #eee; + cursor: pointer; + transition: background 0.2s; +} + +#student-selection-list li:hover { + background: #f0f8ff; +} + +#student-selection-list li.active { + background: #0077ff; + color: white; +} + +#student-selection-list li > u.student-selection-list-highlight { + font-weight: bold; +} + +#student-selection-noresults { + color: red; + text-align: center; + margin-top: 1rem; +} + +.student-info-banner { + display: flex; +} + +#student-info-icon { + flex: 0 1 20%; + margin: 0.2rem; + max-width: 20%; + clip-path: circle(); +} + +#student-info-name-container { + flex: 50%; + margin: 0.2rem; +} + +#student-info-name { + font-size: 1.2rem; +} + +#student-info-tag { + border-radius: 5pt; + background: gray; + font-size: 0.8rem; + padding: 3pt; + display: none; + width: min-content; +} + +#student-info-coach-container { + margin: 0.2rem; + flex: 0 1 20%; + flex-direction: column; +} + +.student-info-mid-element { + padding: 5pt; + border: black solid 0.2pt; + border-radius: 5pt; + margin: 0.2rem; + text-align: center; + hyphens: auto; + flex: 1; +} + +.student-info-points { + display: block; + font-size: 2rem; + margin-bottom: 5px; +} + +#student-info-green { + color: green; +} + +#student-info-orange { + color: orange; +} + +#student-info-red { + color: red; +} + +#student-info-level { + font-size: 1.2rem; + display: block; +} + +#student-info-point-reason-container { + margin: 0.2rem; +} + +#student-info-point-reason { + box-sizing: border-box; + padding: 10px; + width: 100%; + font-size: 0.8rem; + letter-spacing: 1px; + line-height: 1.5; + border-radius: 5px; + border: 1px solid #cccccc; +} + +#student-info-point-reason-submit { + position: absolute; + right: 0.75rem; + transform: translateY(-175%); + border: none; + background: transparent; + font-size: 1.875rem; + cursor: pointer; + color: #888; +} + +#student-info-stickers-container { + flex: 70%; +} + +#student-info-bonus-container { + flex: 30%; +} + +.student-info-bottom-element { + padding: 5pt; + border: black solid 0.2pt; + border-radius: 5pt; + margin: 0.2rem; + height: 5rem; +} + +#student-info-bonus-amount { + font-size: 2rem; +} diff --git a/cockpit/index.html b/cockpit/index.html new file mode 100644 index 0000000..d0bb0c7 --- /dev/null +++ b/cockpit/index.html @@ -0,0 +1,102 @@ + + + + + Cockpit + + + + + + + + +
+
+ + +
+ + +
+ + + + diff --git a/common.mk b/common.mk new file mode 100644 index 0000000..47a3fe9 --- /dev/null +++ b/common.mk @@ -0,0 +1,18 @@ +dist/index.html: index.html index.css dist/main.js + echo | pandoc --template $< --embed-resources --standalone > $@ + +dist/main.js: $(wildcard js/*.js) + npm run build:dev + +.PHONY: mock dev prod +mock: + npm run build:mock + $(MAKE) dist/index.html + +dev: + npm run build:dev + $(MAKE) dist/index.html + +prod: + npm run build + $(MAKE) dist/index.html -- cgit v1.2.3