Fix: theme-color JS-Fallback für Samsung, Wischgesten-Tipp in Settings, _syncThemeColor bei init (SW by-v811)
This commit is contained in:
parent
480a343ec0
commit
1fdd7d4ed0
5 changed files with 25 additions and 14 deletions
|
|
@ -341,7 +341,7 @@ MEDIA_DIR = os.getenv("MEDIA_DIR", "/data/media")
|
|||
os.makedirs(MEDIA_DIR, exist_ok=True)
|
||||
app.mount("/media", StaticFiles(directory=MEDIA_DIR), name="media")
|
||||
|
||||
APP_VER = "810" # muss mit APP_VER in app.js übereinstimmen
|
||||
APP_VER = "811" # muss mit APP_VER in app.js übereinstimmen
|
||||
|
||||
@app.get("/.well-known/assetlinks.json")
|
||||
async def assetlinks():
|
||||
|
|
|
|||
|
|
@ -97,9 +97,9 @@
|
|||
</script>
|
||||
|
||||
<!-- CSS: Reihenfolge ist wichtig — ?v= zwingt Browser zur Neuladung -->
|
||||
<link rel="stylesheet" href="/css/design-system.css?v=810">
|
||||
<link rel="stylesheet" href="/css/layout.css?v=810">
|
||||
<link rel="stylesheet" href="/css/components.css?v=810">
|
||||
<link rel="stylesheet" href="/css/design-system.css?v=811">
|
||||
<link rel="stylesheet" href="/css/layout.css?v=811">
|
||||
<link rel="stylesheet" href="/css/components.css?v=811">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
|
@ -579,10 +579,10 @@
|
|||
<div id="modal-container"></div>
|
||||
|
||||
<!-- JS: Reihenfolge ist wichtig — erst Basis, dann Features -->
|
||||
<script src="/js/api.js?v=810"></script>
|
||||
<script src="/js/ui.js?v=810"></script>
|
||||
<script src="/js/app.js?v=810"></script>
|
||||
<script src="/js/worlds.js?v=810"></script>
|
||||
<script src="/js/api.js?v=811"></script>
|
||||
<script src="/js/ui.js?v=811"></script>
|
||||
<script src="/js/app.js?v=811"></script>
|
||||
<script src="/js/worlds.js?v=811"></script>
|
||||
|
||||
<!-- Feature-Seiten werden lazy geladen -->
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Router, State-Management, Navigation, Initialisierung.
|
||||
============================================================ */
|
||||
|
||||
const APP_VER = '810'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||
const APP_VER = '811'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||
const APP_VERSION = '1.5.0'; // ← semantische Version, wird bei make release gesetzt
|
||||
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
||||
// Cache-Bust-Parameter nach Update-Reload sofort entfernen
|
||||
|
|
@ -612,11 +612,21 @@ const App = (() => {
|
|||
|
||||
function _applyUserTheme(user) {
|
||||
const theme = user?.preferred_theme;
|
||||
if (!theme || theme === 'system') return; // System-Einstellung: nichts tun
|
||||
if (!theme || theme === 'system') { _syncThemeColor(); return; }
|
||||
localStorage.setItem('by_theme', theme);
|
||||
const html = document.documentElement;
|
||||
if (theme === 'dark') html.setAttribute('data-theme', 'dark');
|
||||
else if (theme === 'light') html.setAttribute('data-theme', 'light');
|
||||
_syncThemeColor();
|
||||
}
|
||||
|
||||
function _syncThemeColor() {
|
||||
// Fallback für Browser die media-Queries auf theme-color meta nicht unterstützen (Samsung)
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark'
|
||||
|| (window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||
&& document.documentElement.getAttribute('data-theme') !== 'light');
|
||||
const color = isDark ? '#0f1623' : '#C4843A';
|
||||
document.querySelector('meta[name="theme-color"]')?.setAttribute('content', color);
|
||||
}
|
||||
|
||||
function _showVerifyBanner() {
|
||||
|
|
@ -857,6 +867,7 @@ const App = (() => {
|
|||
// INITIALISIERUNG
|
||||
// ----------------------------------------------------------
|
||||
async function init() {
|
||||
_syncThemeColor(); // Statusleisten-Farbe sofort setzen
|
||||
// Spezielle Hash-Parameter → in App bleiben (kein /info-Redirect)
|
||||
const _rawHash = location.hash.replace('#', '');
|
||||
const _hashQuery = _rawHash.split('?')[1] || '';
|
||||
|
|
|
|||
|
|
@ -334,9 +334,9 @@ window.Page_settings = (() => {
|
|||
background:var(--c-warning-subtle,rgba(245,158,11,0.12));
|
||||
border:1px solid rgba(245,158,11,0.3);
|
||||
font-size:var(--text-xs);color:var(--c-text-secondary);line-height:1.5">
|
||||
<strong style="color:var(--c-warning,#f59e0b)">Samsung Internet Tipp:</strong>
|
||||
Für korrekte Farben im Samsung Browser unter
|
||||
<em>Einstellungen → Webseitenansicht → Dark Mode</em> deaktivieren.
|
||||
<strong style="color:var(--c-warning,#f59e0b)">Samsung Internet Tipps:</strong><br>
|
||||
• Farben: <em>Einstellungen → Webseitenansicht → Dark Mode</em> deaktivieren.<br>
|
||||
• Vollbild: <em>Einstellungen → Display → Navigationsleiste → Wischgesten</em> aktivieren.
|
||||
</div>` : ''}
|
||||
|
||||
<!-- KI-Notiz-Assistent -->
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Offline-Cache + Push Notifications + Tile-Cache
|
||||
============================================================ */
|
||||
|
||||
const CACHE_VERSION = 'by-v810';
|
||||
const CACHE_VERSION = 'by-v811';
|
||||
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
||||
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
||||
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue