Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,18 @@ ErrorDocument 404 /pages/404.html
# 'unsafe-inline' reste nécessaire : le site est en vanilla JS sans build step, avec des
# <script>/style="" inline sur la plupart des pages — les retirer demanderait d'externaliser
# tous ces scripts, un chantier séparé (voir AMELIORATIONS.md #7).
# Manifeste de l'application installable (PWA, 2026-10-20) : Apache ne connaît pas
# l'extension, et un manifeste servi en text/plain est ignoré par certains navigateurs.
AddType application/manifest+json .webmanifest

# Polices : auto-hébergées depuis le 2026-10-20 (css/fonts.css, font/google/) — la CSP
# n'autorise plus fonts.googleapis.com / fonts.gstatic.com.
<IfModule mod_headers.c>
# Aucune page n'utilise caméra, micro ni géolocalisation : on le dit au navigateur
# (audit du 2026-09-13, AMELIORATIONS.md §4).
Header set Permissions-Policy "camera=(), microphone=(), geolocation=()"
<FilesMatch "\.html$">
Header set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https://pub-39a737fc7a9c44c08b7701bdd4b2de4a.r2.dev; connect-src 'self' https://*.pusher.com wss://*.pusher.com; object-src 'none'; base-uri 'self'; frame-ancestors 'self'"
Header set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline'; font-src 'self'; img-src 'self' data: https://pub-39a737fc7a9c44c08b7701bdd4b2de4a.r2.dev; connect-src 'self' https://*.pusher.com wss://*.pusher.com; object-src 'none'; base-uri 'self'; frame-ancestors 'self'"
</FilesMatch>
</IfModule>

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Le hook de pre-commit lance déjà i18n + tests. Détail :

| Commande | Vérifie |
|---|---|
| `make test` / `npm test` | 1595 tests JS (Vitest) |
| `make test` / `npm test` | 1601 tests JS (Vitest) |
| `make test-php` | 421 méthodes de test PHPUnit dans 25 fichiers (logique + intégration BDD). Tourne **dans le conteneur Docker** (`make up` requis) — pas besoin de PHP installé sur ta machine |
| `npm run lint` | ESLint |
| `npm run data:check` | schéma des données personnages |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
}
})();
</script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=JetBrains+Mono:wght@400;700&family=Montserrat:wght@700;800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../../css/fonts.css" />
<style>
/* ── Theme variables ── */
:root {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
}
})();
</script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=JetBrains+Mono:wght@400;700&family=Montserrat:wght@700;800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../../css/fonts.css" />
<style>
/* ── Theme variables ── */
:root {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
}
})();
</script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=JetBrains+Mono:wght@400;700&family=Montserrat:wght@700;800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../../css/fonts.css" />
<style>
/* ── Theme variables ── */
:root {
Expand Down Expand Up @@ -1829,7 +1827,6 @@ <h2 class="shujin-chars-title">🎓 All-Out Attack — Wonder Shujin</h2>

<hr>


<!-- ═══════════════════════════════════
RETOURS COMMUNAUTÉ — SEPTEMBRE 2026
════════════════════════════════════ -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Découpage en lots — une branche, une PR vers `develop` par ligne :
| 16 | `fix/badge_modal_prod` | Le détail d'un badge reprend la modale de la production |
| 17 | `feat/badge_cafe_leblanc` | Badge secret Ko-fi |
| 18 | `perf/aoa_reencode_hd` | Les 33 animations AOA en 1080p au calibre des autres |
| 22 | `feat/pwa_polices` | Application installable (PWA) + polices auto-hébergées |

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
}
})();
</script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=JetBrains+Mono:wght@400;700&family=Montserrat:wght@700;800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../../css/fonts.css" />
<style>
/* ── Theme variables ── */
:root {
Expand Down Expand Up @@ -1279,7 +1277,6 @@
.kotone-ribbon { animation: none; }
}


/* ═══════════════════════════════════════════════════════════════════
GRILLE DES NOUVEAUX PORTRAITS

Expand Down
45 changes: 45 additions & 0 deletions PersonaDLE_Update_Documentation/PersonaDLE 2.4/DEV_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,48 @@ ce qui était la demande d'origine.
et l'enchaîner trop vite déclenche le rate-limit du `globalSetup` (429, table
`rate_limits`).
---

---

## 2026-10-20 — Application installable et polices sans Google

### PWA

Le service worker existait déjà, mais **aucun manifeste** : impossible d'« ajouter à
l'écran d'accueil » avec une vraie icône. Pour un jeu quotidien joué surtout sur téléphone,
c'est le levier de retour le plus direct.

- `manifest.webmanifest` (racine) : `standalone`, couleur `#e63946`, `start_url`
`./index.html?source=pwa` (repérable plus tard dans les statistiques), raccourcis vers
Classique, Émoji, Musique et le profil (appui long sur l'icône).
- `img/app_icons/` : 192, 512, 512 *maskable* (logo dans la zone sûre de 80 %) et
`apple_touch_icon_180` pour iOS — générées depuis `New_Logo_PersonaDLE.png` sur fond noir
à bande rouge P5. **Provisoires** : à remplacer par une icône dessinée (mêmes noms).
- `<link rel="manifest">`, `theme-color` et `apple-touch-icon` sur les 15 pages du jeu
(pas l'admin ni les pages Nouveautés). `pages/404.html` en chemins absolus, comme le
reste de cette page servie à n'importe quelle URL.
- `.htaccess` : `AddType application/manifest+json .webmanifest`.

### Polices auto-hébergées

Huit familles Google (Cinzel, Oswald, Playfair Display, Abril Fatface, Special Elite,
Inter, JetBrains Mono, Montserrat) venaient de `fonts.googleapis.com` : deux connexions
tierces bloquantes et un changement de police visible au chargement.

- `scripts/fetch_google_fonts.js` télécharge les woff2 (latin + latin-ext, fichiers
variables : 18 fichiers, 592 Ko) dans `font/google/` et génère `css/fonts.css`. Une seule
feuille pour toutes les pages : le navigateur ne télécharge que ce que la page utilise
(vérifié : 0 requête Google, polices `loaded` sur l'accueil, le profil, la FAQ).
- Cache d'un an `immutable` déjà prévu par `.htaccess` pour `font/`.
- CSP : `fonts.googleapis.com` et `fonts.gstatic.com` retirés de `style-src`/`font-src`.
- Les pages Nouveautés 2.0 → 2.2 sont touchées **uniquement** sur leur lien de police :
avec la CSP resserrée, elles seraient sinon retombées sur une police de repli.
- `tests/pwa_fonts.test.js` : aucun lien Google ne revient, chaque fichier de `fonts.css`
existe, la CSP n'autorise plus Google, le manifeste et ses icônes sont valides et liés.

### Angles morts connus

- Pas de bouton « Installer l'app » dans l'interface : on s'appuie sur l'invite du
navigateur (Chrome/Edge/Android) et sur « Partager → Sur l'écran d'accueil » (iOS).
- `sw.js` garde sa branche « Google Fonts → stale-while-revalidate », désormais inutile
mais inoffensive : à retirer au prochain passage sur le service worker.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
}
})();
</script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=JetBrains+Mono:wght@400;700&family=Montserrat:wght@700;800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../../css/fonts.css" />
<style>
/* ── Theme variables ── */
:root {
Expand Down Expand Up @@ -1779,6 +1777,33 @@ <h1>PersonaDLE</h1>
CONTENU — à remplir lot par lot (cf. DEV_CHANGELOG.md)
════════════════════════════════════ -->

<!-- ═══════════════════════════════════
APPLICATION INSTALLABLE
═══════════════════════════════════ -->

<div data-i18n-block="fr"><h1>📲 PersonaDLE sur votre écran d'accueil</h1></div>
<div data-i18n-block="en"><h1>📲 PersonaDLE on your home screen</h1></div>

<div data-i18n-block="fr">
<ul>
<li>Le site s'installe désormais comme une <strong>application</strong> : sur Android
ou ordinateur, acceptez l'invite d'installation ; sur iPhone, « Partager → Sur
l'écran d'accueil ». Il s'ouvre en plein écran, avec son icône, et un appui long
mène directement à un mode.</li>
<li>Les polices sont maintenant servies par PersonaDLE lui-même : les pages
s'affichent plus vite, sans changer de police en cours de chargement.</li>
</ul>
</div>
<div data-i18n-block="en">
<ul>
<li>The site can now be installed as an <strong>app</strong>: on Android or desktop,
accept the install prompt; on iPhone, "Share → Add to Home Screen". It opens
full screen with its own icon, and a long press jumps straight to a mode.</li>
<li>Fonts are now served by PersonaDLE itself: pages show up faster, without
switching fonts mid-load.</li>
</ul>
</div>

</div><!-- /.doc-wrap -->

<script>
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<a href="https://personadle.net"><img src="https://img.shields.io/badge/▶%20Play-personadle.net-E60012?style=for-the-badge" alt="Play at personadle.net"></a>
<a href="https://github.com/CodeByHaamza/personadle/releases"><img src="https://img.shields.io/github/v/release/CodeByHaamza/personadle?style=for-the-badge&label=Release&color=1E3A8A" alt="Latest release"></a>
<a href="https://github.com/CodeByHaamza/personadle/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/CodeByHaamza/personadle/ci.yml?branch=develop&style=for-the-badge&label=CI" alt="CI"></a>
<img src="https://img.shields.io/badge/Tests-1595%20passing-2ECC71?style=for-the-badge&logo=vitest&logoColor=white" alt="Tests">
<img src="https://img.shields.io/badge/Tests-1601%20passing-2ECC71?style=for-the-badge&logo=vitest&logoColor=white" alt="Tests">
<a href="LICENSE.txt"><img src="https://img.shields.io/badge/License-MIT%20(code)-blue?style=for-the-badge" alt="MIT (code only)"></a>
</p>

Expand Down Expand Up @@ -159,7 +159,7 @@ Service worker Cron: leaderboard cache, Discord daily & weekly post
| ------------- | ------------------------------------------------------------------------------------------------- |
| **Front end** | HTML5 · CSS3 (one file per component, dark mode) · Vanilla JavaScript ES6+ |
| **Back end** | PHP 8.2 REST API — `GET/POST/PATCH/DELETE /api/{resource}`, JSON, proper status codes |
| **Database** | MariaDB 10.6+ / MySQL 8.0 — 31-table relational schema, 1595+ unit tests keep the contract honest |
| **Database** | MariaDB 10.6+ / MySQL 8.0 — 31-table relational schema, 1601+ unit tests keep the contract honest |
| **i18n** | EN · FR · ES · DE · IT · PT (1319 keys each), `en.json` is the source of truth |
| **Hosting** | Hostinger, auto-deploy on push to `main`; SQL migrations applied by hand _before_ the merge |

Expand All @@ -168,7 +168,7 @@ Service worker Cron: leaderboard cache, Discord daily & weekly post
Every pull request runs the whole thing; `main` only receives releases from `develop`.

```
Vitest + jsdom → 1595 tests unitaires (logique de jeu, backend, streak, i18n, validation données)
Vitest + jsdom → 1601 tests unitaires (logique de jeu, backend, streak, i18n, validation données)
PHPUnit → tests de logique pure + intégration DB (contrat de schéma)
Playwright → 329 E2E sur la stack Docker complète (smoke, API, Social Link)
PHPStan → analyse statique PHP niveau 5 · Psalm → taint analysis
Expand All @@ -186,7 +186,7 @@ git clone https://github.com/CodeByHaamza/personadle.git && cd personadle
npm install

make up # MariaDB + PHP + phpMyAdmin in Docker, schema and seed loaded → http://localhost:8080
npm test # 1595 unit tests
npm test # 1601 unit tests
make test-php # PHPUnit, inside the container
npm run test:e2e # Playwright against the Docker stack
make check # lint + data + i18n + doc numbers + daily pools
Expand Down
4 changes: 2 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ Nouveau jeu — cas A (roster inédit)
> Synthèse : backend PHP/MariaDB complet (auth, sessions, social, leaderboard, admin, RGPD),
> profil personnalisable (avatars groupés, musique, couleurs, badges, titres, wallpapers),
> Social Link rangs 1-10, défis, streak globale + Jack Frost, FAQ, i18n 6 langues,
> **1595 tests JS · 421 PHPUnit · 329 E2E · PHPStan niveau 5 · CI/CD GitHub Actions**.
> **1601 tests JS · 421 PHPUnit · 329 E2E · PHPStan niveau 5 · CI/CD GitHub Actions**.

### Backend & Infrastructure

Expand Down Expand Up @@ -555,7 +555,7 @@ Nouveau jeu — cas A (roster inédit)

| # | Élément | Notes |
| --- | --------------------------------------------- | ------------------------------------------------- |
| Q1 | Tests : 1595 Vitest · 421 PHPUnit · 329 E2E | `npm test` · `make test-php` · `npm run test:e2e` |
| Q1 | Tests : 1601 Vitest · 421 PHPUnit · 329 E2E | `npm test` · `make test-php` · `npm run test:e2e` |
| Q2 | i18n EN/FR/ES/DE/IT/PT (1319 clés) | `npm run i18n:check` |
| Q3 | PHPStan niveau 5 + ESLint + Prettier | Dans la CI |
| Q4 | Seuils de couverture en CI | `npm run test:coverage` (~77 %) |
Expand Down
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
>
> Chaque section numérotée est dimensionnée pour tenir dans **une seule branche**.
>
> Vérifié le 2026-08-26 : 1595 tests Vitest (90 suites), 421 méthodes PHPUnit, 329 tests E2E,
> Vérifié le 2026-08-26 : 1601 tests Vitest (91 suites), 421 méthodes PHPUnit, 329 tests E2E,
> lint et data/i18n/pools propres.

---
Expand Down
7 changes: 1 addition & 6 deletions admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PersonaDLE Admin</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Oswald:wght@400;700&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="../css/fonts.css" />
<link rel="stylesheet" href="admin.css" />
</head>
<body>
Expand Down
4 changes: 4 additions & 0 deletions allOutAttackMode/allOutAttack.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Application installable (PWA) : manifeste, couleur de barre, icône iOS -->
<link rel="manifest" href="../manifest.webmanifest" />
<meta name="theme-color" content="#e63946" />
<link rel="apple-touch-icon" href="../img/app_icons/apple_touch_icon_180.png" />
<title>Personadle - All Out Attack</title>
<meta
name="description"
Expand Down
4 changes: 4 additions & 0 deletions classiqueMode/classiqueMode.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Application installable (PWA) : manifeste, couleur de barre, icône iOS -->
<link rel="manifest" href="../manifest.webmanifest" />
<meta name="theme-color" content="#e63946" />
<link rel="apple-touch-icon" href="../img/app_icons/apple_touch_icon_180.png" />
<title>Personadle - Classic</title>
<meta
name="description"
Expand Down
Loading
Loading