feat(mobile,pwa): implement responsive viewport, mobile drawer and pwa support
Deploy Development / deploy (push) Successful in 20s
Deploy Development / deploy (push) Successful in 20s
This commit is contained in:
1 parent
83177f31f8
commit
5c99ce6f22
11 files changed
+367
-12
No files matched your search
@@ -22,6 +22,8 @@ COPY config/php-uploads.ini /usr/local/etc/php/conf.d/zz-karate-uploads.ini
|
||||
|
||||
# Vereins-Logos & Favicon ins Image kopieren
|
||||
COPY assets/ /var/www/html/resources/assets/
|
||||
COPY assets/manifest.webmanifest /var/www/html/manifest.webmanifest
|
||||
COPY assets/sw.js /var/www/html/sw.js
|
||||
|
||||
# DB-Initialisierungshilfe & Tag-Migration fuer Deployments
|
||||
COPY scripts/ensure-db-schema.php /usr/local/bin/ensure-db-schema.php
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-300 11 290 290" width="512" height="512">
|
||||
<circle cx="-155" cy="156" r="142" fill="#1a1a1a"/>
|
||||
<circle cx="-155" cy="156" r="138" fill="none" stroke="#e41b1b" stroke-width="4"/>
|
||||
<g id="emblem">
|
||||
<path transform="matrix(2.7597,0,0,2.7597,-2559.1,-2310.8)" d="m889.8 927.81c3.2706-0.29307 6.868-1.2628 8.5108-4.3952 1.5107-1.2233-0.1487-4.5881 1.6857-4.8747 2.8031-0.14022 6.4278-0.48065 7.2812-3.7317 2.0351-4.9446 1.281-10.41 1.1584-15.609-0.59189-3.4897-1.6954-6.9124-1.4546-10.503 0.0597-3.6618-0.42792-7.9533-3.8957-10.026-2.8973-1.6072-6.4295-1.3778-9.6372-1.856-10.748-0.28444-16.077 0.68551-26.801 0.80615-3.5946-0.26156-12.703-0.77348-16.212-1.681-0.73019-2.9195-0.22814-6.1528-0.44946-9.193 0.49707-2.3022-0.51587-4.3898-2.9962-3.6834-2.7194 0.0629-5.4778-0.16957-8.1648 0.16713-1.2576 2.9302-0.28643 6.6583-0.6021 9.9069 0.0247 14.302-0.0775 28.605 0.0661 42.906 1.7992 2.5699 6.539 0.56903 9.5046 1.1919 3.9347 0.13346 1.4074-5.5572 2.1676-7.9772l0.0408-6.8157c3.1586 0.22789 3.7244 3.9363 5.2334 6.1008 0.89381 2.1894 3.2953 3.1175 4.7256 4.9118 3.559 2.0851 7.602 3.2912 11.244 5.2657 3.1422 1.5946 5.9347 3.7305 8.8507 5.6984 2.798 2.1026 6.0572 4.2709 9.7444 3.3923z" fill="#e41b1b" style="paint-order:normal"/>
|
||||
<path transform="matrix(2.7597,0,0,2.7597,-2582,-2319.5)" d="m898.11 930.96c3.2706-0.29307 6.868-1.2628 8.5108-4.3952 1.5107-1.2233-0.1487-4.5881 1.6857-4.8747 2.8031-0.14022 6.4278-0.48065 7.2812-3.7317 2.0351-4.9446 1.281-10.41 1.1584-15.609-0.59189-3.4897-1.6954-6.9124-1.4546-10.503 0.0597-3.6618-0.42792-7.9533-3.8957-10.026-2.8973-1.6072-6.4295-1.3778-9.6372-1.856-10.748-0.28444-16.077 0.68551-26.801 0.80615-3.5946-0.26156-12.703-0.77348-16.212-1.681-0.73019-2.9195-0.22814-6.1528-0.44946-9.193 0.49707-2.3022-0.51587-4.3898-2.9962-3.6834-2.7194 0.0629-5.4778-0.16957-8.1648 0.16713-1.2576 2.9302-0.28643 6.6583-0.6021 9.9069 0.0247 14.302-0.0775 28.605 0.0661 42.906 1.7992 2.5699 6.539 0.56903 9.5046 1.1919 3.9347 0.13346 1.4074-5.5572 2.1676-7.9772l0.0408-6.8157c3.1586 0.22789 3.7244 3.9363 5.2334 6.1008 0.89381 2.1894 3.2953 3.1175 4.7256 4.9118 3.559 2.0851 7.602 3.2912 11.244 5.2657 3.1422 1.5946 5.9347 3.7305 8.8507 5.6984 2.798 2.1026 6.0572 4.2709 9.7444 3.3923zm-4.2356-1.1075c-6.1238-2.6618-10.776-7.879-17.029-10.342-3.3417-1.392-5.7739-4.363-7.4412-7.4762-0.12545-1.2216-2.6781-5.7328-1.6073-2.0842 0.13833 2.1363 3.8761 5.7534 2.8197 6.831-2.5954-1.8107-5.408-3.7328-6.8081-6.6769-1.0133-2.5808-3.026-5.0697-5.5385-5.8434 0.0373-7.9015-0.0964-15.81 0.1078-23.706 7.5871 0.52138 15.028 1.5741 22.637 1.0397 8.4716-0.28456 17.161-1.1725 25.603-0.19474 2.9478 1.5673 4.155 5.3727 4.5621 8.5191 0.42706 7.133 1.1136 14.248 1.5932 21.376-0.3776 3.052 0.0234 7.9851-3.5213 9.057-1.8582 0.56377-3.4512-0.34482-5.0606-1.139-3.1474-1.1229-4.99-4.1978-7.2183-6.5083-0.58141-2.7425 1.9306-8.3926 4.5485-3.8126 0.14185 1.5896 3.7394 4.4858 2.1623 1.474-1.8492-2.5477-5.1467-5.637-3.1247-9.0141 1.0089-1.1572 3.1787-4.8696 0.35391-2.1259-2.6275 2.3217-6.9524-2.2485-4.5886-4.9414 0.25618-2.1959 3.7667-4.6121 3.4507-5.88-3.8156 1.5369-4.4773 5.9064-5.8983 9.2696-1.181 2.3121-1.8917 6.6449-3.8085 7.4723-0.88908-2.9678-0.64528-6.6367 1.0723-9.2898-0.50237-1.4173-3.1342 3.0579-2.8025 4.6344-0.67883 3.6991 1.635 6.853 4.1813 9.2403 2.6764 2.704 5.5864 5.4115 7.2321 8.8928-0.6237 1.9981-1.9586 4.5212-3.561 6.289-0.6896 0.89153-5.4004 4.48-1.9289 3.0074 2.4506-2.3167 4.9343-4.9218 5.8274-8.2414 0.98835 1.9414-0.0101 4.7647-0.71895 6.7867-0.97499 1.8456-3.1835 4.253-5.4964 3.3868zm2.9477-2.4335c1.3108-0.62375 3.5229-5.3532 0.96738-2.2975-0.72209 0.57619-3.5452 4.2067-0.96738 2.2975zm-12.164-4.9867c0.7369-2.9859 4.6779-2.8278 5.953-4.5216-2.6496-0.62817-7.766 2.7859-6.232 4.8665l0.27901-0.34488zm-5.1683-8.0926c0.18168-1.2358-1.3431-6.0456-1.3562-2.4478-0.18619 0.63534 0.91989 3.617 1.3562 2.4478zm2.8664-1.005c-1.041-1.5403 0.653-5.126-1.3116-5.1416-0.0494 1.4093-0.28059 5.3596 1.3116 5.1416zm6.5275-4.8398c-1.151-3.1035-1.99-6.3402-1.5867-9.6813-0.41496-2.5596 3.4546-5.5987 2.4808-7.4394-1.3363 0.34849-1.407 2.7405-2.2703 3.79-1.5876 3.2213-1.5408 7.0081-0.92116 10.456 0.41994 0.95697 0.83025 3.4502 2.2973 2.8743zm11.291-12.913c2.4566-2.2219 5.474-3.6566 7.9841-5.7513-2.0612 0.49018-5.61 2.1098-6.9641 4.0794-0.30561 0.33908-3.4938 2.462-1.02 1.6719zm-12.575-5.906c1.9614-2.2746 6.3902-2.8328 6.5289-6.3096-1.4836 2.2769-4.7065 3.4644-6.8512 5.4077-0.63275 0.28215-0.47734 1.5645 0.32223 0.90191zm11.684 40.038c0.32173-2.3899 2.732-6.4175 6.065-5.3006 2.0299 1.2505-2.014 5.6854-4.4188 5.25-0.54121 0.0647-1.1032 0.17422-1.6462 0.0506zm6.5901-6.6346c-1.6849-0.51716-5.2397 1.463-4.3067-1.5296-0.72901-3.464 3.5286-0.17472 4.9274 0.86822 0.11182 0.50575-0.0412 0.72503-0.62074 0.66133zm6.5789-3.2288c0.76509-3.0028 1.6914-6.1805 1.3417-9.3945-0.49588-5.1357-1.185-10.255-1.2778-15.425-0.35345-4.1456-0.22847-8.5594-2.2274-12.313 2.3552 0.36785 4.1547 3.9783 3.8482 6.5985-0.0954 3.8323 0.51278 7.5895 1.4682 11.289 0.90285 5.591 1.0886 11.514-0.56693 16.984-0.45032 0.93047-1.3162 2.6846-2.586 2.2606zm-64.881-0.50035c-0.47742-1.0484-0.0709-2.4628-0.20588-3.6531v-48.234c0.79529-0.86037 2.2166-0.20927 3.2844-0.41174h6.3687c0.8604 0.79526 0.20927 2.2166 0.41175 3.2844v48.809c-0.79528 0.86037-2.2166 0.20927-3.2844 0.41174h-6.3687l-0.13542-0.13542zm47.422-8.9154c-2.9342-1.6629-4.0207-5.1716-2.3101-8.1348 0.97121-5.1904 4.7965-0.18259 4.6889 2.6626 0.79363 1.556-0.85481 6.2062-2.3788 5.4721z" fill="#ffffff" style="paint-order:normal"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.4 KiB |
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "Goju-Kai Dojo – Karate-Wiki",
|
||||
"short_name": "Karate-Wiki",
|
||||
"description": "Internes Vereins-Wiki & Technik-Videothek des Goju-Kai Dojo Heilbronn e.V.",
|
||||
"start_url": "/index.php?title=Hauptseite",
|
||||
"scope": "/",
|
||||
"display": "standalone",
|
||||
"orientation": "any",
|
||||
"background_color": "#121314",
|
||||
"theme_color": "#1a1a1a",
|
||||
"lang": "de",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/resources/assets/icon.svg",
|
||||
"sizes": "any",
|
||||
"type": "image/svg+xml",
|
||||
"purpose": "any maskable"
|
||||
},
|
||||
{
|
||||
"src": "/resources/assets/favicon-32x32.png",
|
||||
"sizes": "32x32",
|
||||
"type": "image/png"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
// Karate-Wiki Service Worker (PWA Offline-Cache & App Lifecycle)
|
||||
const CACHE_NAME = 'karatewiki-cache-v1';
|
||||
const PRECACHE_ASSETS = [
|
||||
'/resources/assets/icon.svg',
|
||||
'/resources/assets/favicon-32x32.png',
|
||||
'/resources/assets/logo.svg',
|
||||
'/resources/assets/logo-light.svg',
|
||||
'/manifest.webmanifest'
|
||||
];
|
||||
|
||||
self.addEventListener('install', (event) => {
|
||||
self.skipWaiting();
|
||||
event.waitUntil(
|
||||
caches.open(CACHE_NAME).then((cache) => {
|
||||
return cache.addAll(PRECACHE_ASSETS).catch(() => {});
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener('activate', (event) => {
|
||||
event.waitUntil(
|
||||
Promise.all([
|
||||
self.clients.claim(),
|
||||
caches.keys().then((keys) => {
|
||||
return Promise.all(
|
||||
keys.map((key) => {
|
||||
if (key !== CACHE_NAME) {
|
||||
return caches.delete(key);
|
||||
}
|
||||
})
|
||||
);
|
||||
})
|
||||
])
|
||||
);
|
||||
});
|
||||
|
||||
// Network-first Strategie fuer dynamische Wiki-Inhalte
|
||||
self.addEventListener('fetch', (event) => {
|
||||
const request = event.request;
|
||||
if (request.method !== 'GET') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Fuer statische Assets (Icons, SVGs) Cache mit Fallback
|
||||
const url = new URL(request.url);
|
||||
if (url.pathname.startsWith('/resources/assets/') || url.pathname.endsWith('.webmanifest')) {
|
||||
event.respondWith(
|
||||
caches.match(request).then((cached) => {
|
||||
return (
|
||||
cached ||
|
||||
fetch(request).then((response) => {
|
||||
if (response && response.status === 200) {
|
||||
const clone = response.clone();
|
||||
caches.open(CACHE_NAME).then((cache) => cache.put(request, clone));
|
||||
}
|
||||
return response;
|
||||
})
|
||||
);
|
||||
})
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Fuer alle Wiki-Seiten: Direkt ueber Netzwerk
|
||||
event.respondWith(
|
||||
fetch(request).catch(() => {
|
||||
return caches.match(request);
|
||||
})
|
||||
);
|
||||
});
|
||||
@@ -211,11 +211,12 @@ foreach ( $karateOptionalExtensions as $extName ) {
|
||||
}
|
||||
}
|
||||
|
||||
// WikiEditor Standard-Optionen
|
||||
// WikiEditor Standard-Optionen & Responsive Skin
|
||||
$wgDefaultUserOptions['usebetatoolbar'] = 1;
|
||||
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;
|
||||
$wgDefaultUserOptions['wikieditor-preview'] = 1;
|
||||
$wgDefaultUserOptions['wikieditor-publish'] = 1;
|
||||
$wgDefaultUserOptions['skin-responsive'] = 1;
|
||||
|
||||
// CookieWarning & EditUser Berechtigungen
|
||||
$wgCookieWarningEnabled = true;
|
||||
|
||||
@@ -43,8 +43,11 @@ services:
|
||||
- ./config/php-uploads.ini:/usr/local/etc/php/conf.d/zz-karate-uploads.ini:ro
|
||||
- ./assets/logo.svg:/var/www/html/resources/assets/logo.svg:ro
|
||||
- ./assets/logo-light.svg:/var/www/html/resources/assets/logo-light.svg:ro
|
||||
- ./assets/icon.svg:/var/www/html/resources/assets/icon.svg:ro
|
||||
- ./assets/favicon-32x32.png:/var/www/html/resources/assets/favicon-32x32.png:ro
|
||||
- ./assets/logo_goju-kai_Bleistift.png:/var/www/html/resources/assets/logo_goju-kai_Bleistift.png:ro
|
||||
- ./assets/manifest.webmanifest:/var/www/html/manifest.webmanifest:ro
|
||||
- ./assets/sw.js:/var/www/html/sw.js:ro
|
||||
- ./extensions-custom/KarateMedia:/var/www/html/extensions/KarateMedia:ro
|
||||
- dev-karatewiki-images:/var/www/html/images
|
||||
ports:
|
||||
|
||||
@@ -45,8 +45,11 @@ services:
|
||||
- ./config/php-uploads.ini:/usr/local/etc/php/conf.d/zz-karate-uploads.ini:ro
|
||||
- ./assets/logo.svg:/var/www/html/resources/assets/logo.svg:ro
|
||||
- ./assets/logo-light.svg:/var/www/html/resources/assets/logo-light.svg:ro
|
||||
- ./assets/icon.svg:/var/www/html/resources/assets/icon.svg:ro
|
||||
- ./assets/favicon-32x32.png:/var/www/html/resources/assets/favicon-32x32.png:ro
|
||||
- ./assets/logo_goju-kai_Bleistift.png:/var/www/html/resources/assets/logo_goju-kai_Bleistift.png:ro
|
||||
- ./assets/manifest.webmanifest:/var/www/html/manifest.webmanifest:ro
|
||||
- ./assets/sw.js:/var/www/html/sw.js:ro
|
||||
- ./extensions-custom/KarateMedia:/var/www/html/extensions/KarateMedia:ro
|
||||
- karatewiki-shared-images:/var/www/html/images
|
||||
ports:
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
# Karatewiki (Goju-Kai Dojo) – Feature-Backlog & Roadmap
|
||||
|
||||
Dieses Dokument sammelt alle geplanten und diskutierten Funktionserweiterungen, Optimierungen und Ideen für das Karate-Wiki des Goju-Kai Dojo Heilbronn e.V.
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Priorität 1: Mobile-Optimierung & PWA (Aktuell in Arbeit)
|
||||
|
||||
- [ ] **Echtes Mobile Viewport (Kein 1120px Desktop-Zoom mehr):**
|
||||
- **Problem:** Vector (Legacy) setzt standardmäßig `<meta name="viewport" content="width=1120">`, weshalb Smartphones die Seite auf 1120px Breite herauszoomen (Schrift & Buttons briefmarkengroß).
|
||||
- **Lösung:** Entfernen/Überschreiben des 1120px-Viewports, sodass echte mobile Skalierung (`width=device-width, initial-scale=1.0, maximum-scale=5.0`) greift.
|
||||
- **Schriftgrößen & Touch-Ziele:** Mindestschriftgröße 16px auf Mobilgeräten (verhindert auch iOS-Autozoom bei Formularfeldern), Buttons und Links mit mind. 44x44px Touch-Fläche.
|
||||
- **Flüssige Tabellen & Kacheln:** Gürtelkarten und Thementabellen passen sich flexibel der Handybreite an (1- bis 2-spaltig statt gequetschter Desktop-Raster).
|
||||
- [ ] **PWA (Progressive Web App):**
|
||||
- `manifest.webmanifest` / `manifest.json` mit App-Namen ("Karate Dojo", "Karate-Wiki"), Start-URL, App-Icons (192x192, 512x512, maskable) und `theme_color` (`#1a1a1a`), `background_color` (`#1a1a1a`).
|
||||
- `display: standalone` (beim Öffnen vom Smartphone-Homescreen entfällt die Browser-URL-Leiste, wirkt wie eine native App).
|
||||
- Apple-Touch-Icons & Safari PWA-Meta-Tags (`apple-mobile-web-app-capable`, `apple-mobile-web-app-status-bar-style: black-translucent`).
|
||||
- Schneller Service-Worker zum Cachen von App-Shell (CSS, JS, Logos, Favicon) für blitzschnellen Start auch bei schwachem Hallen-WLAN.
|
||||
|
||||
---
|
||||
|
||||
## 🥋 Priorität 2: Video- & Technik-Features (Dojo-Videothek)
|
||||
|
||||
- [ ] **Spiegelmodus (`🪞 Spiegeln`):**
|
||||
- Button an jedem Video-Player, der das Video horizontal spiegelt (`transform: scaleX(-1)`).
|
||||
- Ermöglicht es Karateka, das Tablet/Handy vor sich aufzustellen und Katas synchron "wie im Spiegel" mitzulaufen, ohne links und rechts im Kopf umdenken zu müssen.
|
||||
- [ ] **Einzelbild-Schaltung (Frame-by-Frame):**
|
||||
- Buttons `< Frame` und `Frame >` (+ Shortcut Tasten `,` und `.`), um Techniken im Bruchteil einer Sekunde anzuhalten und Schritt für Schritt zu analysieren (Treffmoment, Faustdrehung, Hüftstellung).
|
||||
- [ ] **Video-Kapitel & Sprungmarken:**
|
||||
- Klickbare Zeitstempel im Text (z.B. `[0:45] Osae-Uke`, `[1:20] Wendung`), die das Video direkt an die entsprechende Sekunde springen lassen.
|
||||
- [ ] **Side-by-Side Videovergleich:**
|
||||
- Zwei Videos nebeneinander abspielen (z.B. Kata von vorne vs. von der Seite, oder Schüler vs. Sensei) mit synchronisiertem Play/Pause.
|
||||
|
||||
---
|
||||
|
||||
## 📋 Priorität 3: Prüfungsvorbereitung & Interaktives Lernen
|
||||
|
||||
- [ ] **Persönliche Prüfungs-Checkliste ("Ich kann das!"):**
|
||||
- Interaktive Checkboxen auf den Kyu-Seiten (9. bis 1. Kyu).
|
||||
- Speichert den individuellen Fortschritt lokal im Browser (`localStorage`), ohne die Datenbank zu belasten.
|
||||
- Zeigt einen prozentualen Fortschrittsbalken ("75 % für 8. Kyu Gelbgurt bereit").
|
||||
- [ ] **Zufallstrainer / Prüfungs-Simulator (Flashcards):**
|
||||
- Button z.B. auf den Kyu-Seiten: "Zufällige Technik abfragen" (zeigt eine Technik wie "Mae-Geri aus Zenkutsu-Dachi"), Karateka führt sie aus, klickt auf "Video-Lösung anzeigen" und vergleicht sich.
|
||||
|
||||
---
|
||||
|
||||
## 📖 Priorität 4: Inhalte & Dojo-Praxis
|
||||
|
||||
- [ ] **Audio-Aussprache im Karate-Wörterbuch:**
|
||||
- Lautsprecher-Icon 🔊 neben japanischen Fachbegriffen (*Hikite*, *Mawashi-Geri*, *Tensho*, *Dojokun*) für korrekte Audio-Aussprache.
|
||||
- [ ] **Kata-Spickzettel (Druckansicht für die Sporttasche):**
|
||||
- Spezielles Print-CSS (`@media print`), das Kata-Abläufe und Prüfungsinhalte kompakt auf 1-2 DIN-A4-Seiten ohne Menüleisten und Footer formatiert.
|
||||
@@ -709,47 +709,156 @@ body.mediawiki:not(.mw-special-Userlogin) .mw-body-content h3 {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
body.mediawiki.km-sidebar-open:not(.mw-special-Userlogin)::before {
|
||||
content: '';
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.65);
|
||||
backdrop-filter: blur(2px);
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
body.mediawiki:not(.mw-special-Userlogin) #mw-panel {
|
||||
position: fixed !important;
|
||||
left: -13em !important;
|
||||
left: -14em !important;
|
||||
top: 0 !important;
|
||||
bottom: 0 !important;
|
||||
width: 12.2em !important;
|
||||
width: 13em !important;
|
||||
overflow-y: auto !important;
|
||||
transition: left 0.22s ease !important;
|
||||
transition: left 0.24s cubic-bezier(0.4, 0, 0.2, 1) !important;
|
||||
z-index: 1000 !important;
|
||||
box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3) !important;
|
||||
}
|
||||
|
||||
body.mediawiki.km-sidebar-open:not(.mw-special-Userlogin) #mw-panel {
|
||||
left: 0 !important;
|
||||
}
|
||||
|
||||
body.mediawiki:not(.mw-special-Userlogin) #content.mw-body,
|
||||
body.mediawiki:not(.mw-special-Userlogin) #mw-head-base {
|
||||
margin-left: 0 !important;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
body.mediawiki:not(.mw-special-Userlogin) #mw-head {
|
||||
position: relative !important;
|
||||
width: 100% !important;
|
||||
box-sizing: border-box !important;
|
||||
padding: 6px 12px !important;
|
||||
background: #ffffff !important;
|
||||
border-bottom: 1px solid #e5e7eb !important;
|
||||
}
|
||||
|
||||
body.mediawiki:not(.mw-special-Userlogin) #left-navigation,
|
||||
body.mediawiki:not(.mw-special-Userlogin) #right-navigation {
|
||||
float: none !important;
|
||||
margin-left: 0 !important;
|
||||
margin-right: 0 !important;
|
||||
display: flex !important;
|
||||
flex-wrap: wrap !important;
|
||||
align-items: center !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
body.mediawiki:not(.mw-special-Userlogin) #p-personal {
|
||||
position: relative !important;
|
||||
top: auto !important;
|
||||
right: auto !important;
|
||||
float: none !important;
|
||||
margin: 4px 0 8px 0 !important;
|
||||
}
|
||||
|
||||
body.mediawiki:not(.mw-special-Userlogin) #p-personal ul {
|
||||
display: flex !important;
|
||||
flex-wrap: wrap !important;
|
||||
gap: 6px 12px !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
body.mediawiki:not(.mw-special-Userlogin) #p-search {
|
||||
float: none !important;
|
||||
margin: 6px 0 !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
body.mediawiki:not(.mw-special-Userlogin) #p-search form {
|
||||
display: flex !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
body.mediawiki:not(.mw-special-Userlogin) #searchInput {
|
||||
width: 100% !important;
|
||||
box-sizing: border-box !important;
|
||||
height: 38px !important;
|
||||
font-size: 16px !important;
|
||||
}
|
||||
|
||||
body.mediawiki:not(.mw-special-Userlogin) #content.mw-body,
|
||||
body.mediawiki:not(.mw-special-Userlogin) #footer {
|
||||
margin-left: 0.6em !important;
|
||||
margin-right: 0.6em !important;
|
||||
margin-left: 0.5rem !important;
|
||||
margin-right: 0.5rem !important;
|
||||
}
|
||||
|
||||
body.mediawiki:not(.mw-special-Userlogin) #content.mw-body {
|
||||
padding: 1.1em 1.1em 1.8em 1.1em !important;
|
||||
padding: 1rem 1rem 1.6rem 1rem !important;
|
||||
border-radius: 10px !important;
|
||||
}
|
||||
|
||||
body.mediawiki:not(.mw-special-Userlogin) .mw-body-content {
|
||||
font-size: 1.02rem !important;
|
||||
line-height: 1.7 !important;
|
||||
}
|
||||
|
||||
body.mediawiki:not(.mw-special-Userlogin) h1.firstHeading {
|
||||
font-size: 1.55rem !important;
|
||||
}
|
||||
|
||||
.kd-hero {
|
||||
padding: 20px 18px;
|
||||
padding: 18px 16px;
|
||||
}
|
||||
|
||||
.kd-hero-title {
|
||||
font-size: 1.35rem !important;
|
||||
font-size: 1.3rem !important;
|
||||
}
|
||||
|
||||
.kd-hero-search {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.kd-hero-search-btn {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.kd-belt-grid {
|
||||
grid-template-columns: repeat(2, 1fr) !important;
|
||||
gap: 8px !important;
|
||||
}
|
||||
|
||||
.kd-cards-grid {
|
||||
grid-template-columns: 1fr !important;
|
||||
gap: 14px !important;
|
||||
}
|
||||
|
||||
#mw-content-text table {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
overflow-x: auto !important;
|
||||
-webkit-overflow-scrolling: touch !important;
|
||||
}
|
||||
|
||||
.karate-media-wrapper {
|
||||
width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
}
|
||||
|
||||
.karate-video-player {
|
||||
width: 100% !important;
|
||||
height: auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,4 +66,11 @@
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
// 3. PWA Service Worker Registrierung
|
||||
if ( 'serviceWorker' in navigator && ( window.location.protocol === 'https:' || window.location.hostname === 'localhost' || window.location.hostname === '192.168.2.49' ) ) {
|
||||
window.addEventListener( 'load', function () {
|
||||
navigator.serviceWorker.register( '/sw.js' ).catch( function () {} );
|
||||
} );
|
||||
}
|
||||
}() );
|
||||
@@ -133,8 +133,83 @@ class KarateMediaHooks {
|
||||
public static function onBeforePageDisplay( $out, $skin ): void {
|
||||
$out->addModules( [ 'ext.karateMedia' ] );
|
||||
|
||||
// Wichtig fuer moderne Smartphone- & Tablet-Darstellung
|
||||
$out->addMeta( 'viewport', 'width=device-width, initial-scale=1.0' );
|
||||
// 1. Skin als responsive kennzeichnen, damit MediaWiki den Standard-Viewport (width=device-width)
|
||||
// akzeptiert und das veraltete Desktop-width=1120 unterlaesst:
|
||||
try {
|
||||
$skinRefl = new \ReflectionClass( $skin );
|
||||
if ( $skinRefl->hasProperty( 'options' ) ) {
|
||||
$optProp = $skinRefl->getProperty( 'options' );
|
||||
$optProp->setAccessible( true );
|
||||
$opts = $optProp->getValue( $skin ) ?: [];
|
||||
$opts['responsive'] = true;
|
||||
$optProp->setValue( $skin, $opts );
|
||||
}
|
||||
} catch ( \Throwable $e ) {
|
||||
$bindSkin = \Closure::bind( function () {
|
||||
$this->options['responsive'] = true;
|
||||
}, $skin, $skin );
|
||||
if ( $bindSkin ) {
|
||||
$bindSkin();
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Etwaige alte oder doppelte Viewport-Tags (insbesondere width=1120) aus mMetatags entfernen
|
||||
try {
|
||||
$outRefl = new \ReflectionClass( $out );
|
||||
if ( $outRefl->hasProperty( 'mMetatags' ) ) {
|
||||
$metaProp = $outRefl->getProperty( 'mMetatags' );
|
||||
$metaProp->setAccessible( true );
|
||||
$tags = $metaProp->getValue( $out ) ?: [];
|
||||
$cleaned = [];
|
||||
foreach ( $tags as $t ) {
|
||||
if ( isset( $t[0] ) && strtolower( $t[0] ) === 'viewport' ) {
|
||||
continue;
|
||||
}
|
||||
$cleaned[] = $t;
|
||||
}
|
||||
$metaProp->setValue( $out, $cleaned );
|
||||
}
|
||||
} catch ( \Throwable $e ) {
|
||||
$bindOut = \Closure::bind( function () {
|
||||
$this->mMetatags = array_values( array_filter(
|
||||
$this->mMetatags,
|
||||
static fn( $t ) => !( isset( $t[0] ) && strtolower( $t[0] ) === 'viewport' )
|
||||
) );
|
||||
}, $out, $out );
|
||||
if ( $bindOut ) {
|
||||
$bindOut();
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Garantierter, fluessiger mobiler Viewport fuer alle Smartphones & Tablets
|
||||
$out->addMeta( 'viewport', 'width=device-width, initial-scale=1.0, maximum-scale=5.0' );
|
||||
|
||||
// 4. PWA Web App Manifest, App-Icons & Mobile-Fullscreen-Metatags
|
||||
$pwaHead = implode( "\n", [
|
||||
'<link rel="manifest" href="/manifest.webmanifest">',
|
||||
'<link rel="icon" type="image/svg+xml" href="/resources/assets/icon.svg">',
|
||||
'<link rel="apple-touch-icon" href="/resources/assets/icon.svg">',
|
||||
'<meta name="theme-color" content="#1a1a1a">',
|
||||
'<meta name="apple-mobile-web-app-capable" content="yes">',
|
||||
'<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">',
|
||||
'<meta name="apple-mobile-web-app-title" content="Karate-Wiki">',
|
||||
'<meta name="mobile-web-app-capable" content="yes">'
|
||||
] );
|
||||
$out->addHeadItem( 'karate-pwa-meta', $pwaHead );
|
||||
|
||||
// 5. Client-seitige Absicherung: Falls die Skin nachtraeglich noch width=1120 einfuegt,
|
||||
// wird dies sofort beim Head-Parsing entfernt, bevor der Browser skaliert:
|
||||
$inlineGuard = '<script>(function(){' .
|
||||
'var metas=document.querySelectorAll(\'meta[name="viewport"]\');' .
|
||||
'if(metas.length>1){' .
|
||||
'for(var i=0;i<metas.length;i++){' .
|
||||
'if((metas[i].getAttribute(\'content\')||\'\').indexOf(\'1120\')!==-1){' .
|
||||
'metas[i].remove();' .
|
||||
'}' .
|
||||
'}' .
|
||||
'}' .
|
||||
'})();</script>';
|
||||
$out->addHeadItem( 'karate-viewport-guard', $inlineGuard );
|
||||
|
||||
$title = $out->getTitle();
|
||||
$user = $out->getUser();
|
||||
|
||||
Reference in new issue
Block a user