feat: PWA support with hockey puck icon
Adds full PWA compliance: web app manifest, service worker with cache-first static / network-first scoreboard strategy, and a generated hockey puck icon (512, 192, 180, 32px) on the app's dark navy background. Includes all required meta tags for iOS standalone mode and a /favicon.ico route. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,12 +1,32 @@
|
||||
import json
|
||||
|
||||
from flask import render_template, jsonify
|
||||
from flask import render_template, jsonify, send_from_directory
|
||||
|
||||
from app import app
|
||||
from app.config import SCOREBOARD_DATA_FILE
|
||||
from app.games import parse_games
|
||||
|
||||
|
||||
@app.route("/manifest.json")
|
||||
def manifest():
|
||||
return send_from_directory(app.static_folder, "manifest.json")
|
||||
|
||||
|
||||
@app.route("/sw.js")
|
||||
def service_worker():
|
||||
response = send_from_directory(app.static_folder, "sw.js")
|
||||
response.headers["Service-Worker-Allowed"] = "/"
|
||||
response.headers["Cache-Control"] = "no-cache"
|
||||
return response
|
||||
|
||||
|
||||
@app.route("/favicon.ico")
|
||||
def favicon():
|
||||
return send_from_directory(
|
||||
app.static_folder, "icon-32x32.png", mimetype="image/png"
|
||||
)
|
||||
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
return render_template("index.html")
|
||||
|
||||
Reference in New Issue
Block a user