Progressive Web App + icon
This commit is contained in:
@@ -200,5 +200,15 @@ def refresh():
|
|||||||
update_all_data()
|
update_all_data()
|
||||||
return redirect(url_for('index'))
|
return redirect(url_for('index'))
|
||||||
|
|
||||||
|
from flask import send_from_directory
|
||||||
|
|
||||||
|
@app.route('/manifest.json')
|
||||||
|
def serve_manifest():
|
||||||
|
return send_from_directory('static', 'manifest.json')
|
||||||
|
|
||||||
|
@app.route('/static/sw.js')
|
||||||
|
def serve_sw():
|
||||||
|
return send_from_directory('static', 'sw.js')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(host='0.0.0.0', port=5000)
|
app.run(host='0.0.0.0', port=5000)
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 117 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 674 KiB |
@@ -0,0 +1,4 @@
|
|||||||
|
// Service Worker minimal pour permettre l'installation PWA
|
||||||
|
self.addEventListener('fetch', function(event) {
|
||||||
|
// On laisse les requêtes passer normalement
|
||||||
|
});
|
||||||
@@ -7,6 +7,26 @@
|
|||||||
<title>Ciné Toulouse</title>
|
<title>Ciné Toulouse</title>
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||||
|
<!-- Lien vers le Manifest -->
|
||||||
|
<link rel="manifest" href="/static/manifest.json">
|
||||||
|
<!-- Couleur de la barre d'adresse Android -->
|
||||||
|
<meta name="theme-color" content="#0a0a0a">
|
||||||
|
<!-- Optimisation pour iOS/Safari (Optionnel) -->
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Enregistrement du Service Worker
|
||||||
|
if ('serviceWorker' in navigator) {
|
||||||
|
window.addEventListener('load', function() {
|
||||||
|
navigator.serviceWorker.register('/static/sw.js').then(function(reg) {
|
||||||
|
console.log('Service Worker enregistré !', reg.scope);
|
||||||
|
}).catch(function(err) {
|
||||||
|
console.log('Échec enregistrement SW:', err);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
body { background-color: #0a0a0a; color: #fff; font-family: 'Segoe UI', system-ui, sans-serif; }
|
body { background-color: #0a0a0a; color: #fff; font-family: 'Segoe UI', system-ui, sans-serif; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user