summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Herman <johannes.herman@gmail.com>2025-12-11 06:49:19 +0100
committerJohannes Herman <johannes.herman@gmail.com>2025-12-11 06:49:19 +0100
commitc14aabfd17c85632bd68db60867edb3fb662c7e7 (patch)
treed3fc7a1c44bba6fa56c39bd77013911151977532
initial commit
-rw-r--r--.gitignore2
-rw-r--r--Makefile68
-rwxr-xr-xbin/copy_demos.sh20
-rwxr-xr-xbin/copy_videos.sh20
-rwxr-xr-xbin/make_archives.sh58
-rwxr-xr-xbin/make_html_archives.sh31
-rwxr-xr-xbin/make_html_index.sh34
-rwxr-xr-xbin/make_html_table.sh89
-rwxr-xr-xbin/make_thumbnails.sh24
-rw-r--r--demos/drunk_pilot.demobin0 -> 190258 bytes
-rw-r--r--demos/stolen_goods.demobin0 -> 202141 bytes
-rw-r--r--demos/trigonometry.demobin0 -> 301951 bytes
-rw-r--r--demos/woomps.demobin0 -> 135360 bytes
-rw-r--r--favicon.pngbin0 -> 6587 bytes
-rw-r--r--style.css27
-rw-r--r--tricks.csv13
-rw-r--r--videos/bing_bong_train.mp4bin0 -> 4265682 bytes
-rw-r--r--videos/drunk_pilot.mp4bin0 -> 6695729 bytes
-rw-r--r--videos/drunk_pilot_train.mp4bin0 -> 4051717 bytes
-rw-r--r--videos/dummy_top_purple_fly_slow_train.mp4bin0 -> 7958967 bytes
-rw-r--r--videos/dummy_top_purple_fly_train.mp4bin0 -> 2878602 bytes
-rw-r--r--videos/morning_stretch_train.mp4bin0 -> 5144551 bytes
-rw-r--r--videos/pass_it_on_train.mp4bin0 -> 2314389 bytes
-rw-r--r--videos/roundabout_train.mp4bin0 -> 3493312 bytes
-rw-r--r--videos/stolen_goods.mp4bin0 -> 7101932 bytes
-rw-r--r--videos/stolen_goods_train.mp4bin0 -> 4887866 bytes
-rw-r--r--videos/swing_around_train.mp4bin0 -> 4486895 bytes
-rw-r--r--videos/take_turns_train.mp4bin0 -> 6071523 bytes
-rw-r--r--videos/trigonometry1.mp4bin0 -> 12980113 bytes
-rw-r--r--videos/trigonometry2.mp4bin0 -> 12517911 bytes
-rw-r--r--videos/trigonometry_train.mp4bin0 -> 4440326 bytes
-rw-r--r--videos/wip_train.mp4bin0 -> 2558969 bytes
-rw-r--r--videos/woomps1.mp4bin0 -> 8343302 bytes
-rw-r--r--videos/woomps2.mp4bin0 -> 9168636 bytes
-rw-r--r--videos/woomps_train.mp4bin0 -> 5792315 bytes
35 files changed, 386 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..47d508c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+public/
+sync
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..8d535e7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,68 @@
+BINDIR := ./bin
+OUTDIR := ./public
+
+HTML_SCRIPTS := \
+ $(BINDIR)/make_html_index.sh \
+ $(BINDIR)/make_html_table.sh \
+ $(BINDIR)/make_html_archives.sh
+
+ARCHIVES_SCRIPT := $(BINDIR)/make_archives.sh
+THUMBNAILS_SCRIPT := $(BINDIR)/make_thumbnails.sh
+VIDEOS_SCRIPT := $(BINDIR)/copy_videos.sh
+DEMOS_SCRIPT := $(BINDIR)/copy_demos.sh
+
+VIDEO_FILES := $(wildcard videos/*)
+DEMO_FILES := $(wildcard demo/*)
+
+TRICKS_CSV := tricks.csv
+STYLE_CSS := style.css
+FAVICON := favicon.png
+
+site: $(OUTDIR)/index.html $(OUTDIR)/style.css $(OUTDIR)/favicon.png $(OUTDIR)/.archives_stamp $(OUTDIR)/.thumbnails_stamp $(OUTDIR)/.videos_stamp $(OUTDIR)/.demos_stamp
+
+index: $(OUTDIR)/index.html
+
+archives: $(OUTDIR)/.archives_stamp
+
+thumbnails: $(OUTDIR)/.thumbnails_stamp
+
+$(OUTDIR):
+ mkdir -p $(OUTDIR)
+
+$(OUTDIR)/index.html: $(OUTDIR)/style.css $(OUTDIR)/favicon.png $(OUTDIR)/.archives_stamp $(HTML_SCRIPTS) $(TRICKS_CSV) | $(OUTDIR)
+ @echo ">> Building index"
+ @$(BINDIR)/make_html_index.sh
+
+$(OUTDIR)/style.css: $(STYLE_CSS) | $(OUTDIR)
+ @echo ">> Copying $(STYLE_CSS)"
+ cp $< $@
+
+$(OUTDIR)/favicon.png: $(FAVICON) | $(OUTDIR)
+ @echo ">> Copying $(FAVICON)"
+ cp $< $@
+
+$(OUTDIR)/.archives_stamp: $(ARCHIVES_SCRIPT) $(TRICKS_CSV) | $(OUTDIR)
+ @echo ">> Generating archives"
+ @$(ARCHIVES_SCRIPT)
+ @touch $@
+
+$(OUTDIR)/.thumbnails_stamp: $(THUMBNAILS_SCRIPT) $(TRICKS_CSV) | $(OUTDIR)
+ @echo ">> Generating thumbnails"
+ @$(THUMBNAILS_SCRIPT)
+ @touch $@
+
+$(OUTDIR)/.videos_stamp: $(VIDEOS_SCRIPT) $(VIDEO_FILES) | $(OUTDIR)
+ @echo ">> Copying videos"
+ @$(VIDEOS_SCRIPT)
+ @touch $@
+
+$(OUTDIR)/.demos_stamp: $(DEMOS_SCRIPT) $(DEMO_FILES) | $(OUTDIR)
+ @echo ">> Copying demos"
+ @$(DEMOS_SCRIPT)
+ @touch $@
+
+clean:
+ @$(RM) -rv $(OUTDIR)
+
+.PHONY: site index archives thumbnails clean
+
diff --git a/bin/copy_demos.sh b/bin/copy_demos.sh
new file mode 100755
index 0000000..dc827e4
--- /dev/null
+++ b/bin/copy_demos.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+SOURCE_DIR="demos"
+DEST_DIR="public/demos"
+
+mkdir -p "$DEST_DIR"
+
+for demo in "$SOURCE_DIR"/*; do
+ [ -f "$demo" ] || continue
+
+ filename=$(basename -- "$demo")
+ dest="$DEST_DIR/$filename"
+
+ [ -f "$dest" ] && continue
+
+ echo " copying demo: $filename"
+
+ cp "$demo" "$dest"
+done
+
diff --git a/bin/copy_videos.sh b/bin/copy_videos.sh
new file mode 100755
index 0000000..d8d1fe6
--- /dev/null
+++ b/bin/copy_videos.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+SOURCE_DIR="videos"
+DEST_DIR="public/videos"
+
+mkdir -p "$DEST_DIR"
+
+for video in "$SOURCE_DIR"/*; do
+ [ -f "$video" ] || continue
+
+ filename=$(basename -- "$video")
+ dest="$DEST_DIR/$filename"
+
+ [ -f "$dest" ] && continue
+
+ echo " copying video: $filename"
+
+ cp "$video" "$dest"
+done
+
diff --git a/bin/make_archives.sh b/bin/make_archives.sh
new file mode 100755
index 0000000..02bec66
--- /dev/null
+++ b/bin/make_archives.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+CSV_FILE="tricks.csv"
+VIDEO_DIR="videos"
+DEMO_DIR="demos"
+ARCHIVE_DIR="public/archives"
+
+mkdir -p "$ARCHIVE_DIR"
+
+declare -A montage_videos
+declare -A montage_demos
+
+while IFS=',' read -r name players train_videos ingame_videos demos montage; do
+ key="$(echo "$montage" | xargs)"
+ videos_raw=$(echo "$ingame_videos" | xargs)
+ demos_raw=$(echo "$demos" | xargs)
+ key="$(echo "$key" | sed 's/ /_/g')"
+
+ videos=""
+ IFS=';' read -ra video_items <<< "$videos_raw"
+ for item in "${video_items[@]}"; do
+ videos+="${VIDEO_DIR}/${item}.mp4 "
+ done
+
+ demos=""
+ IFS=';' read -ra demo_items <<< "$demos_raw"
+ for item in "${demo_items[@]}"; do
+ demos+="${DEMO_DIR}/${item} "
+ done
+
+ if [[ -z "$key" ]]; then
+ key="Unused"
+ fi
+
+ if [[ -n "${montage_videos[$key]}" ]]; then
+ montage_videos[$key]="${montage_videos[$key]} $videos"
+ else
+ montage_videos[$key]="$videos"
+ fi
+
+ if [[ -n "${montage_demos[$key]}" ]]; then
+ montage_demos[$key]="${montage_demos[$key]} $demos"
+ else
+ montage_demos[$key]="$demos"
+ fi
+done < <(tail -n +2 "$CSV_FILE")
+
+for montage in "${!montage_videos[@]}"; do
+ [[ -n "${montage_videos[$montage]}" ]] \
+ && zip -r "${ARCHIVE_DIR}/${montage}_videos.zip" ${montage_videos[$montage]}
+ continue
+done
+
+for montage in "${!montage_demos[@]}"; do
+ [[ -n "${montage_demos[$montage]}" ]] \
+ && zip -r "${ARCHIVE_DIR}/${montage}_demos.zip" ${montage_demos[$montage]}
+done
+
diff --git a/bin/make_html_archives.sh b/bin/make_html_archives.sh
new file mode 100755
index 0000000..239f878
--- /dev/null
+++ b/bin/make_html_archives.sh
@@ -0,0 +1,31 @@
+#/bin/sh
+
+ARCHIVE_DIR="public/archives"
+
+for file in $ARCHIVE_DIR/*_demos.zip $ARCHIVE_DIR/*_videos.zip; do
+ [ -f "$file" ] || continue
+ base="${file%_demos.zip}"
+ base="${base%_videos.zip}"
+ base="${base#$ARCHIVE_DIR/}"
+ bases="$bases
+$base"
+done
+
+[ -n "$bases" ] && printf "\n<h2>Archives</h2>\n\n"
+
+for base in $(echo "$bases" | sort -u); do
+ title=$(echo "$base" | tr '_' ' ')
+
+ line="<p>$title tricks archive:"
+
+ video_archive="$ARCHIVE_DIR/${base}_videos.zip"
+ demo_archive="$ARCHIVE_DIR/${base}_demos.zip"
+
+ [ -f "$video_archive" ] && line="$line <a href=\"archives/${base}_videos.zip\">videos</a>"
+ [ -f "$demo_archive" ] && [ -f "$video_archive" ] && line="$line, "
+ [ -f "$demo_archive" ] && line="$line <a href=\"archives/${base}_demos.zip\">demos</a>"
+
+ echo "$line"
+
+done
+
diff --git a/bin/make_html_index.sh b/bin/make_html_index.sh
new file mode 100755
index 0000000..cba5479
--- /dev/null
+++ b/bin/make_html_index.sh
@@ -0,0 +1,34 @@
+#/bin/sh
+
+DIR="$(dirname "$0")"
+OUTDIR="$DIR/../public"
+
+exec >"$OUTDIR/index.html"
+
+cat <<'EOF'
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>Liber Dolorum</title>
+ <link rel='stylesheet' type='text/css' href="style.css">
+ <link rel="icon" type="image/png" href="favicon.png">
+</head>
+
+<body>
+<h1>Liber Dolorum</h1>
+<p><em>"Another trick in the book"</em></p>
+
+EOF
+
+"$DIR/make_html_table.sh"
+"$DIR/make_html_archives.sh"
+
+cat <<'EOF'
+
+<p>alpha 0.1</p>
+
+</body>
+
+</html>
+EOF
diff --git a/bin/make_html_table.sh b/bin/make_html_table.sh
new file mode 100755
index 0000000..c820f27
--- /dev/null
+++ b/bin/make_html_table.sh
@@ -0,0 +1,89 @@
+#!/bin/bash
+
+CSV_FILE="${1:-tricks.csv}"
+
+make_video_cell() {
+ local field="$1"
+ if [[ -n "$field" ]]; then
+ echo " <td>"
+ IFS=';' read -ra files <<< "$field"
+ for f in "${files[@]}"; do
+ f_trimmed=$(echo "$f" | xargs)
+ echo " <video width=\"256\" controls preload=\"none\" poster=\"thumbnails/$f_trimmed.jpg\">"
+ echo " <source src=\"videos/$f_trimmed.mp4\" type=\"video/mp4\">"
+ echo " Your browser does not support the video tag."
+ echo " </video>"
+ done
+ echo " </td>"
+ else
+ echo " <td></td>"
+ fi
+}
+
+make_demo_cell() {
+ local field="$1"
+ if [[ -n "$field" ]]; then
+ echo " <td>"
+ IFS=';' read -ra files <<< "$field"
+ for f in "${files[@]}"; do
+ f_trimmed=$(echo "$f" | xargs)
+ echo " <a href=\"demos/$f_trimmed\" download>demo</a><br>"
+ done
+ echo " </td>"
+ else
+ echo " <td></td>"
+ fi
+}
+
+make_montage_cell() {
+ local montage="$1"
+
+ if [ -z "$montage" ]; then
+ echo " <td></td>"
+ return
+ fi
+
+ case "$montage" in
+ 'Cowboy Teebop') montage_url='https://www.youtube.com/watch?v=eJgiPbio9BY' ;;
+ 'Tee Jams') montage_url='https://www.youtube.com/watch?v=ReoM0rVXduQ' ;;
+ 'On Noby Street') montage_url='https://www.youtube.com/watch?v=lxVu5XX9Rmk' ;;
+ 'Any Trickers') montage_url='https://www.youtube.com/watch?v=u2CbuvmiXCc' ;;
+ *) echo "ERROR: invalid montage name '$montage'" >&2; exit 1 ;;
+ esac
+ echo " <td><a href=\"$montage_url\" target=\"_blank\" rel=\"noopener\">$montage</a></td>"
+}
+
+cat <<'EOF'
+<table>
+ <tr>
+EOF
+
+IFS=',' read -r -a headers < "$CSV_FILE"
+
+for header in "${headers[@]}"; do
+ echo " <th><strong>$header</strong></th>"
+done
+
+echo " </tr>"
+
+while IFS=',' read -r name players train_videos ingame_videos demos montage; do
+ [[ -z "$name" ]] && continue
+
+ echo " <tr>"
+ echo " <td><strong>$name</strong></td>"
+
+ players_html=$(echo "$players" | sed 's/;/,<br>/g')
+ echo " <td>$players_html</td>"
+
+ make_video_cell "$train_videos"
+ make_video_cell "$ingame_videos"
+ make_demo_cell "$demos"
+ make_montage_cell "$montage"
+
+ echo " </tr>"
+done < <(tail -n +2 "$CSV_FILE")
+
+cat <<'EOF'
+</table>
+EOF
+
diff --git a/bin/make_thumbnails.sh b/bin/make_thumbnails.sh
new file mode 100755
index 0000000..9371d7a
--- /dev/null
+++ b/bin/make_thumbnails.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+WIDTH="${1:-320}"
+
+VIDEO_DIR="videos"
+THUMB_DIR="public/thumbnails"
+
+mkdir -p "$THUMB_DIR"
+
+for video in "$VIDEO_DIR"/*; do
+ [ -f "$video" ] || continue
+
+ filename=$(basename -- "$video")
+ name="${filename%.*}"
+ thumbnail="$THUMB_DIR/$name.jpg"
+
+ [ -f "$thumbnail" ] && continue
+
+ echo " creating image: $thumbnail"
+
+ ffmpeg -i "$video" -ss 00:00:01 -vframes 1 -vf "scale=${WIDTH}:-1" -q:v 7 "$thumbnail" -y >/dev/null 2>&1
+
+done
+
diff --git a/demos/drunk_pilot.demo b/demos/drunk_pilot.demo
new file mode 100644
index 0000000..7602621
--- /dev/null
+++ b/demos/drunk_pilot.demo
Binary files differ
diff --git a/demos/stolen_goods.demo b/demos/stolen_goods.demo
new file mode 100644
index 0000000..4eabc54
--- /dev/null
+++ b/demos/stolen_goods.demo
Binary files differ
diff --git a/demos/trigonometry.demo b/demos/trigonometry.demo
new file mode 100644
index 0000000..e3d0069
--- /dev/null
+++ b/demos/trigonometry.demo
Binary files differ
diff --git a/demos/woomps.demo b/demos/woomps.demo
new file mode 100644
index 0000000..c8d649f
--- /dev/null
+++ b/demos/woomps.demo
Binary files differ
diff --git a/favicon.png b/favicon.png
new file mode 100644
index 0000000..a868fb9
--- /dev/null
+++ b/favicon.png
Binary files differ
diff --git a/style.css b/style.css
new file mode 100644
index 0000000..7b0b8b7
--- /dev/null
+++ b/style.css
@@ -0,0 +1,27 @@
+body {
+ font-family: Georgia, 'Times New Roman', Times, serif;
+ margin: 40px;
+ background-color: #f9f9f9;
+}
+table {
+ width: 100%;
+ border-collapse: collapse;
+ margin-top: 20px;
+}
+th, td {
+ padding: 12px;
+ border: 1px solid #ccc;
+ text-align: left;
+}
+th {
+ background-color: #ddd;
+ font-weight: normal;
+}
+td {
+ background-color: #eee;
+ font-weight: normal;
+}
+a {
+ color: #3366cc;
+ text-decoration: none;
+}
diff --git a/tricks.csv b/tricks.csv
new file mode 100644
index 0000000..183ced1
--- /dev/null
+++ b/tricks.csv
@@ -0,0 +1,13 @@
+Name,Players,Trainfng,In-Game,Demo,Montage
+Drunk Pilot,Faceless tee; New Hero,drunk_pilot_train,drunk_pilot,drunk_pilot.demo,Cowboy Teebop
+Stolen Goods,Faceless tee; New Hero,stolen_goods_train,stolen_goods,stolen_goods.demo,Cowboy Teebop
+Morning Stretch,Faceless tee; Minem,morning_stretch_train,,,
+Trigonometry,Faceless tee; New Hero,trigonometry_train,trigonometry1;trigonometry2,trigonometry.demo,Cowboy Teebop
+Bing Bong,New Hero,bing_bong_train,,,
+WIP,Faceless tee; New Hero,wip_train,,,
+Dummy Top Purple Fly,Faceless tee; New Hero,dummy_top_purple_fly_train;dummy_top_purple_fly_slow_train,,,
+Take Turns,Faceless tee; New Hero; realfail,take_turns_train,,,
+Pass It On,Minem; hextech; New Hero; realfail,pass_it_on_train,,,
+Woomps,New Hero; Ipwnturkeys,woomps_train,woomps1;woomps2,woomps.demo,Cowboy Teebop
+Swing Around,visitOP; New Hero,swing_around_train,,,
+Roundabout,realfail; New Hero; Faceless tee,roundabout_train,,,
diff --git a/videos/bing_bong_train.mp4 b/videos/bing_bong_train.mp4
new file mode 100644
index 0000000..2233aa0
--- /dev/null
+++ b/videos/bing_bong_train.mp4
Binary files differ
diff --git a/videos/drunk_pilot.mp4 b/videos/drunk_pilot.mp4
new file mode 100644
index 0000000..3ed95ba
--- /dev/null
+++ b/videos/drunk_pilot.mp4
Binary files differ
diff --git a/videos/drunk_pilot_train.mp4 b/videos/drunk_pilot_train.mp4
new file mode 100644
index 0000000..32900fe
--- /dev/null
+++ b/videos/drunk_pilot_train.mp4
Binary files differ
diff --git a/videos/dummy_top_purple_fly_slow_train.mp4 b/videos/dummy_top_purple_fly_slow_train.mp4
new file mode 100644
index 0000000..adac75d
--- /dev/null
+++ b/videos/dummy_top_purple_fly_slow_train.mp4
Binary files differ
diff --git a/videos/dummy_top_purple_fly_train.mp4 b/videos/dummy_top_purple_fly_train.mp4
new file mode 100644
index 0000000..00e0191
--- /dev/null
+++ b/videos/dummy_top_purple_fly_train.mp4
Binary files differ
diff --git a/videos/morning_stretch_train.mp4 b/videos/morning_stretch_train.mp4
new file mode 100644
index 0000000..73aef06
--- /dev/null
+++ b/videos/morning_stretch_train.mp4
Binary files differ
diff --git a/videos/pass_it_on_train.mp4 b/videos/pass_it_on_train.mp4
new file mode 100644
index 0000000..1a31146
--- /dev/null
+++ b/videos/pass_it_on_train.mp4
Binary files differ
diff --git a/videos/roundabout_train.mp4 b/videos/roundabout_train.mp4
new file mode 100644
index 0000000..7892ccf
--- /dev/null
+++ b/videos/roundabout_train.mp4
Binary files differ
diff --git a/videos/stolen_goods.mp4 b/videos/stolen_goods.mp4
new file mode 100644
index 0000000..65fdaaf
--- /dev/null
+++ b/videos/stolen_goods.mp4
Binary files differ
diff --git a/videos/stolen_goods_train.mp4 b/videos/stolen_goods_train.mp4
new file mode 100644
index 0000000..4357ff4
--- /dev/null
+++ b/videos/stolen_goods_train.mp4
Binary files differ
diff --git a/videos/swing_around_train.mp4 b/videos/swing_around_train.mp4
new file mode 100644
index 0000000..30da10f
--- /dev/null
+++ b/videos/swing_around_train.mp4
Binary files differ
diff --git a/videos/take_turns_train.mp4 b/videos/take_turns_train.mp4
new file mode 100644
index 0000000..1845c5d
--- /dev/null
+++ b/videos/take_turns_train.mp4
Binary files differ
diff --git a/videos/trigonometry1.mp4 b/videos/trigonometry1.mp4
new file mode 100644
index 0000000..3e9fa61
--- /dev/null
+++ b/videos/trigonometry1.mp4
Binary files differ
diff --git a/videos/trigonometry2.mp4 b/videos/trigonometry2.mp4
new file mode 100644
index 0000000..3996787
--- /dev/null
+++ b/videos/trigonometry2.mp4
Binary files differ
diff --git a/videos/trigonometry_train.mp4 b/videos/trigonometry_train.mp4
new file mode 100644
index 0000000..eb57ba4
--- /dev/null
+++ b/videos/trigonometry_train.mp4
Binary files differ
diff --git a/videos/wip_train.mp4 b/videos/wip_train.mp4
new file mode 100644
index 0000000..ddf1710
--- /dev/null
+++ b/videos/wip_train.mp4
Binary files differ
diff --git a/videos/woomps1.mp4 b/videos/woomps1.mp4
new file mode 100644
index 0000000..2159a3f
--- /dev/null
+++ b/videos/woomps1.mp4
Binary files differ
diff --git a/videos/woomps2.mp4 b/videos/woomps2.mp4
new file mode 100644
index 0000000..ab803a5
--- /dev/null
+++ b/videos/woomps2.mp4
Binary files differ
diff --git a/videos/woomps_train.mp4 b/videos/woomps_train.mp4
new file mode 100644
index 0000000..d27ce7d
--- /dev/null
+++ b/videos/woomps_train.mp4
Binary files differ