summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-03-21 19:30:39 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-03-21 19:30:39 +0100
commitcc119f1cbb0b3bbd0c5453a5b9c5ce4c7f2a5df5 (patch)
treeb6bd9f6f94eda70ba99360524987de677893f5f7
parentfeat(treewide): Commit MVP (diff)
downloadweb-client-cc119f1cbb0b3bbd0c5453a5b9c5ce4c7f2a5df5.zip
build(treewide): Provide a working `manifest.json` file
The previous one had no really working images.
-rw-r--r--.gitignore2
-rw-r--r--Trunk.toml7
-rw-r--r--index.html24
-rw-r--r--nix/package.nix5
-rw-r--r--public/favicon.icobin15406 -> 0 bytes
-rw-r--r--public/input.css (renamed from input.css)0
-rw-r--r--public/logo.svg6
-rw-r--r--public/manifest.json26
-rwxr-xr-xscripts/generate_logo.sh30
9 files changed, 93 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index 8914bee..cefbd74 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,8 @@
 /setup/target
 /dist
 
+/public/favicon.ico
+
 /public/tailwindcss-output.css
 
 /references
diff --git a/Trunk.toml b/Trunk.toml
index c16525c..fc54ece 100644
--- a/Trunk.toml
+++ b/Trunk.toml
@@ -1,7 +1,12 @@
 [[hooks]]
 stage = "pre_build"
 command = "tailwindcss"
-command_arguments = ["-i", "input.css", "-o", "public/tailwindcss-output.css"]
+command_arguments = ["-i", "public/input.css", "-o", "dist/tailwindcss-output.css"]
+
+[[hooks]]
+stage = "pre_build"
+command = "./scripts/generate_logo.sh"
+command_arguments = []
 
 [serve]
 addresses = ["127.0.0.1"]
diff --git a/index.html b/index.html
index 7085f94..3772400 100644
--- a/index.html
+++ b/index.html
@@ -25,7 +25,7 @@
     <link
       data-trunk
       rel="css"
-      href="./public/tailwindcss-output.css"
+      href="./dist/tailwindcss-output.css"
     />
 
    <link
@@ -37,6 +37,28 @@
        rel="copy-file"
        href="./public/manifest.json"
     />
+
+
+    <link
+       data-trunk
+       rel="copy-file"
+       href="./dist/favicon-128.png"
+    />
+    <link
+       data-trunk
+       rel="copy-file"
+       href="./dist/favicon-256.png"
+    />
+    <link
+       data-trunk
+       rel="copy-file"
+       href="./dist/favicon-512.png"
+    />
+    <link
+       data-trunk
+       rel="copy-file"
+       href="./dist/favicon-1024.png"
+    />
   </head>
 
   <body></body>
diff --git a/nix/package.nix b/nix/package.nix
index 1bcc0ae..e692242 100644
--- a/nix/package.nix
+++ b/nix/package.nix
@@ -16,6 +16,7 @@
   tailwindcss,
   wasm-bindgen-cli_0_2_104,
   binaryen,
+  imagemagick,
 }:
 craneLib.buildPackage {
   pname = "rocie-mobile";
@@ -37,7 +38,8 @@ craneLib.buildPackage {
         "input.css"
         "Trunk.toml"
         "manifest.json"
-        "favicon.ico"
+        "logo.svg"
+        "generate_logo.sh"
       ])
       || (lib.strings.hasSuffix ".rs" (builtins.baseNameOf name));
   };
@@ -54,6 +56,7 @@ craneLib.buildPackage {
     tailwindcss
     wasm-bindgen-cli_0_2_104
     binaryen # for wasm-opt
+    imagemagick # needed for the generate_logo.sh command
   ];
 
   buildInputs = [
diff --git a/public/favicon.ico b/public/favicon.ico
deleted file mode 100644
index 2ba8527..0000000
--- a/public/favicon.ico
+++ /dev/null
Binary files differdiff --git a/input.css b/public/input.css
index b5c61c9..b5c61c9 100644
--- a/input.css
+++ b/public/input.css
diff --git a/public/logo.svg b/public/logo.svg
new file mode 100644
index 0000000..93750a7
--- /dev/null
+++ b/public/logo.svg
@@ -0,0 +1,6 @@
+<svg width="512" height="512" viewBox="0 0 512 512">
+    <path d="M448,112s-17.62,0-30.51,1.39c-19,2-42.06,8-59.73,13.22C322.7,137,288.43,150.53,249.91,169.2c-18.62,9.05-26,13.35-48,26.13L197.41,198c-32.95,19-57.09,40-73.79,64.3C105.29,288.89,96,320,96,354.64c0,40.74,15.71,77.1,44.24,102.37C169,482.52,209.06,496,256,496c46.76,0,86.89-14.32,116-41.43,28.35-26.35,44-63.39,44-104.29,0-25-6.19-47-12.17-68.22-12.59-44.69-23.46-83.29,24.71-144.13C432.75,132.62,448,112,448,112Z" />
+    <path d="M219,119.55C168.47,92.08,104.72,80,80,80c0,0,23.23,28.19,29.15,55.4s6.54,48.61,2.91,88.6c17.94-20.48,40.59-37.15,69.32-53.73l4.48-2.6C208,154.8,216.23,150,236,140.41c2.88-1.4,5.74-2.76,8.58-4.11A170.77,170.77,0,0,0,219,119.55Z" />
+    <path d="M345.25,48s-42.53.36-86.12,21.3a280.36,280.36,0,0,0-32.27,18.27q3.73,1.89,7.4,3.88c3.44,1.87,7.09,4,10.9,6.29a189.7,189.7,0,0,1,31.46,24.16c24.57-10.41,73-26.1,90.77-31.28C359.39,71.47,345.25,48,345.25,48Z" />
+    <path d="M176,16c-16,10.83-33.24,41.1-33.24,41.1a494.22,494.22,0,0,1,48.92,15.25l17.65-11.56c8.18-5.35,16.55-10.29,25-14.77C234.31,46,202.59,24.17,176,16Z" />
+</svg>
diff --git a/public/manifest.json b/public/manifest.json
index 5ea8b9d..1c89288 100644
--- a/public/manifest.json
+++ b/public/manifest.json
@@ -1,13 +1,31 @@
 {
   "name": "Rocie",
+  "short_name": "Rocie ",
   "icons": [
     {
-      "src": "favicon.ico",
-      "type": "image/png",
-      "sizes": "512x512"
+      "src": "./favicon-1024.png",
+      "sizes": "1024x1024",
+      "type": "image/png"
+    }
+    {
+      "src": "./favicon-512.png",
+      "sizes": "512x512",
+      "type": "image/png"
+    }
+    {
+      "src": "./favicon-256.png",
+      "sizes": "256x256",
+      "type": "image/png"
+    }
+    {
+      "src": "./favicon-128.png",
+      "sizes": "128x128",
+      "type": "image/png"
     }
   ],
-  "start_url": "/",
+  "start_url": null,
+  "background_color": "#333131",
+  "theme_color": "#333131",
   "display": "standalone",
   "prefer_related_applications": false
 }
diff --git a/scripts/generate_logo.sh b/scripts/generate_logo.sh
new file mode 100755
index 0000000..af89bc8
--- /dev/null
+++ b/scripts/generate_logo.sh
@@ -0,0 +1,30 @@
+#! /bin/sh
+
+if [ -f "./dist/favicon-1024.png" ]; then
+    # Bail out early
+    exit 0
+fi
+
+set -x
+
+magick ./public/logo.svg -resize 1024x1024 -transparent white ./dist/favicon-1024.png
+
+magick ./dist/favicon-1024.png -resize 16x16 ./dist/favicon-16.png
+magick ./dist/favicon-1024.png -resize 32x32 ./dist/favicon-32.png
+magick ./dist/favicon-1024.png -resize 64x64 ./dist/favicon-64.png
+magick ./dist/favicon-1024.png -resize 128x128 ./dist/favicon-128.png
+magick ./dist/favicon-1024.png -resize 256x256 ./dist/favicon-256.png
+magick ./dist/favicon-1024.png -resize 512x512 ./dist/favicon-512.png
+
+magick \
+    ./dist/favicon-16.png \
+    ./dist/favicon-32.png \
+    ./dist/favicon-64.png \
+    ./dist/favicon-128.png \
+    ./dist/favicon-256.png \
+    ./dist/favicon-512.png \
+    ./dist/favicon-1024.png \
+    -colors 256 \
+    ./public/favicon.ico
+
+# vim: ft=sh