update
authorBenjamin Auder <benjamin.auder@somewhere>
Fri, 8 May 2026 23:26:14 +0000 (01:26 +0200)
committerBenjamin Auder <benjamin.auder@somewhere>
Fri, 8 May 2026 23:26:14 +0000 (01:26 +0200)
TODO
bundle.py
favicon.ico [deleted symlink]
index.html
js/app.js
nginx_config.example

diff --git a/TODO b/TODO
index fd12ebe..f49a584 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,5 +1,3 @@
-Smartphone issue --> Play button fails (seekGame à corriger)
-
 Hmm... non ? -->
 Otage, Emergo, Pacosako : fonction "buildPiece(arg1, arg2)" returns HTML element with 2 SVG or SVG + number
 ==> plus simple : deux classes, images superposées.
index f703443..0b3b451 100755 (executable)
--- a/bundle.py
+++ b/bundle.py
@@ -9,7 +9,7 @@ import re
 # --- Configuration ---
 SOURCE_DIR = "."
 DEST_DIR = "dist"
-EXTENSIONS_TO_HASH = [".html", ".js", ".css", ".svg"] #all edited files
+EXTENSIONS_TO_HASH = [".html", ".js", ".css", ".svg", ".ico", ".png", ".jpg"]
 EXTENSIONS_TO_UPDATE = [".html", ".js", ".css"] #.svg don't contain refs
 DYNAMIC_LOAD_EXTENSIONS = (".html", ".js", ".css") #loaded from app.js
 
diff --git a/favicon.ico b/favicon.ico
deleted file mode 120000 (symlink)
index f6ff788..0000000
+++ /dev/null
@@ -1 +0,0 @@
-assets/favicon.ico
\ No newline at end of file
index 5b4c35f..e5e3ded 100644 (file)
@@ -8,6 +8,7 @@
           content="width=device-width, initial-scale=1"/>
     <link id="_common_css"
           rel="stylesheet" href="/css/common.css"/>
+    <link rel="icon" type="image/x-icon" href="/assets/favicon.ico">
     <script type="text/javascript">
       if (/iPad|iPhone|iPod/.test(navigator.userAgent)) {
         // Apple brightness in SVG workaround
index 950d2d3..db16c75 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -609,11 +609,19 @@ async function initializeGame(obj) {
 <path d="M50.5,0.5c-27.614,0-50,22.386-50,50c0,27.614,22.386,50,50,50s50-\
 22.386,50-50C100.5,22.886,78.114,0.5,50.5,0.5z M60.5,85.5h-20v-40h20V85.5z \
 M50.5,35.5c-5.523,0-10-4.477-10-10s4.477-10,10-10c5.522,0,10,4.477,10,\
-10S56.022,35.5,50.5,35.5z"/></svg>`;
+10S56.022,35.5,50.5,35.5z" fill="darkgrey"/></svg>`;
 
   const stopIcon = h('div', { id: 'upRightStop', onclick: confirmStopGame });
-  stopIcon.innerHTML = `<svg viewBox="0 0 533.333 533.333" xmlns="http://www.w3.org/2000/svg">
-<path d="M528.468,428.468 L366.667,266.666 L528.462,104.869 C533.227,100.104 533.227,92.373 528.462,87.608 L445.725,4.871 C440.96,-0.106 433.229,-0.106 428.464,4.871 L266.667,166.668 L104.87,4.871 C100.105,-0.106 92.374,-0.106 87.609,4.871 L4.872,87.608 C-0.105,92.373 -0.105,100.104 4.872,104.869 L166.669,266.666 L4.872,428.463 C-0.105,433.228 -0.105,440.959 4.872,445.724 L87.609,528.461 C92.374,533.226 100.105,533.226 104.87,528.461 L266.667,366.664 L428.464,528.461 C433.229,533.226 440.96,533.226 445.725,528.461 L528.462,445.724 C533.227,440.959 533.227,433.228 528.468,428.468 Z" fill="currentColor"/>
+  stopIcon.innerHTML = `<svg viewBox="0 0 533.333 533.333">\
+<path d="M528.468,428.468 L366.667,266.666 L528.462,104.869 C533.227,\
+100.104 533.227,92.373 528.462,87.608 L445.725,4.871 C440.96,-0.106 433.229,\
+-0.106 428.464,4.871 L266.667,166.668 L104.87,4.871 C100.105,-0.106 92.374,\
+-0.106 87.609,4.871 L4.872,87.608 C-0.105,92.373 -0.105,100.104 4.872,104.869 \
+L166.669,266.666 L4.872,428.463 C-0.105,433.228 -0.105,440.959 4.872,445.724 \
+L87.609,528.461 C92.374,533.226 100.105,533.226 104.87,528.461 L266.667,\
+366.664 L428.464,528.461 C433.229,533.226 440.96,533.226 445.725,528.461 \
+L528.462,445.724 C533.227,440.959 533.227,433.228 528.468,428.468 Z"
+fill="darkgrey"/>
 </svg>`;
 
   const board = h('div', { class: 'chessboard' });
index a798fb0..7d10d8c 100644 (file)
@@ -21,20 +21,25 @@ server {
     error_log /var/log/nginx/xogo_error.log;
     access_log /var/log/nginx/xogo_access.log;
 
-    # 1. Entry point: always check if there was an update
-    location = /index.html {
+    #
+    # Entry point: always revalidate
+    #
+    location ~* ^/(index\.html|manifest\.json)$ {
         add_header Cache-Control "no-cache, must-revalidate";
-        expires 0;
     }
 
-    # 2. Static hashed files (JS, CSS) + assets: agressive caching
-    location / {
-        try_files $uri $uri/ /index.html;
+    #
+    # Static hashed assets
+    #
+    location ~* \.(js|css|html|png|jpg|svg|ico|ttf)$ {
         expires 1y;
         add_header Cache-Control "public, immutable";
+        try_files $uri =404;
     }
 
-    # 3. WebSocket server proxy
+    #
+    # WebSocket server proxy
+    #
     location /ws {
         proxy_pass http://localhost:WS_PORT;
         proxy_http_version 1.1;
@@ -44,6 +49,13 @@ server {
         proxy_buffering off;
     }
 
+    #
+    # SPA fallback
+    #
+    location / {
+        try_files $uri $uri/ /index.html;
+    }
+
     ssl_certificate /etc/letsencrypt/live/my.server.com/fullchain.pem;
     ssl_certificate_key /etc/letsencrypt/live/my.server.com/privkey.pem;
 }