This commit is contained in:
Orionis committed 2026-11-05 23:47:14 +01:00
commit 28b36e6954
26 files changed
+9123

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
node_modules/
dist/
.angular/
out-tsc/
server/*.db
npm-debug.log*
.DS_Store
+87
View File
@@ -0,0 +1,87 @@
# Orbit
Quiz de géographie et d'espace (drapeaux, capitales, villes, lieux sur carte, planètes,
étoiles, galaxies, trous noirs) avec comptes locaux, boutique et boosters.
Conversion du fichier unique `Orbit.html` en projet **Angular + TypeScript** utilisant le
builder d'application **Vite** (`@angular/build:application`), sans modification du contenu
d'origine.
## Lancer le projet
Le back de comptes (API Node + SQLite) et le front Angular fonctionnent ensemble :
```bash
npm install
# Terminal 1 : API des comptes (http://127.0.0.1:8787, base server/orbit.db)
npm run api
# Terminal 2 : front en dev (http://localhost:4200, /api proxifié vers l'API)
npm start
```
Pour la préproduction : `npm run preview` (build puis service du front ET de l'API
sur http://127.0.0.1:8787).
## Structure
```
Orbit.html # fichier d'origine (conservé, inchangé)
├── package.json / angular.json / tsconfig*.json / proxy.conf.json
├── server/
│ └── server.mjs # API comptes : Node pur, SQLite via node:sqlite
└── src/
├── index.html # head d'origine (Tailwind CDN + config, Leaflet CDN)
├── styles.css # CSS d'origine (<style> du fichier HTML)
├── typings.d.ts # compléments de typage DOM pour le moteur JS d'origine
├── main.ts # bootstrap Angular standalone
└── app/
├── app.component.html # <header id="hd"> et <main id="app"> d'origine
├── app.component.ts # charge le moteur une fois la vue prête
├── orbit/
│ └── orbit.ts # logique complète du jeu (verbatim)
└── data/
├── geo.ts # pays, lieux, codes (C, PL, CODE)
├── flags.ts # drapeaux SVG (FL)
├── world.ts # fonds de carte GeoJSON (WORLD)
├── items.ts # boutique/boosters (I, RC, BOOST)
├── planet-textures.ts # textures des astres (PLTEX)
└── space-quiz.ts # données du quiz espace (SPD)
```
## Gestion des comptes (backend)
Les comptes ne sont plus stockés dans le navigateur (localStorage) mais dans une base
SQLite côté serveur, gérée par l'API `server/server.mjs` (aucune dépendance, Node 22+) :
| Endpoint | Rôle |
|-------------------------|-------------------------------------------------------------|
| `POST /api/register` | Création de compte (sel + hash PBKDF2 calculés côté client) |
| `GET /api/user/:key` | Récupération d'un compte (permet le recalcul du hash au login) |
| `PUT /api/state/:key` | Sauvegarde de la progression (points, niveaux, objets) |
| `POST /api/import` | Migration des anciens comptes localStorage |
| `GET /api/stats` | Nombre de comptes |
Le mécanisme de mots de passe est inchangé (PBKDF2 100 000 itérations, SHA-256) :
le serveur ne stocke aucun mot de passe en clair. Une session reste mémorisée sur
l'appareil, mais le compte et la progression vivent désormais côté serveur : ils sont
partagés entre navigateurs et ne disparaissent plus au changement de port/origine.
Au premier chargement, les éventuels anciens comptes localStorage sont importés
automatiquement.
## Notes sur la conversion
- Tout le contenu (textes, données, styles, comportement) est repris à l'identique.
Le JS d'origine est découpé en modules TypeScript ; seuls les marqueurs `export` ont été
ajoutés, plus deux paramètres optionnels (`add(..., ex?)`, `LS(k, v?)`) pour satisfaire
le typage sans changer le comportement.
- Le moteur du jeu continue de générer l'interface dans `#hd` / `#app` ; Angular charge
ce module en lazy après le rendu du composant racine (`ngAfterViewInit`).
- Tailwind (CDN + config inline) et Leaflet sont chargés depuis `index.html` exactement
comme dans le fichier d'origine. Une connexion internet est donc nécessaire au
chargement, comme pour le fichier d'origine.
- `src/images/` contient les icônes CSS référencées par Leaflet (elas étaient inexistantes
et renvoyaient une 404 silencieuse dans le fichier d'origine).
+74
View File
@@ -0,0 +1,74 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"orbit": {
"projectType": "application",
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular/build:application",
"options": {
"outputPath": "dist/orbit",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"assets": [
{
"glob": "**/*",
"input": "src/images",
"output": "/images"
}
],
"styles": ["src/styles.css"]
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "4MB",
"maximumError": "10MB"
},
{
"type": "anyComponentStyle",
"maximumWarning": "8kB",
"maximumError": "16kB"
}
],
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular/build:dev-server",
"options": {
"proxyConfig": "proxy.conf.json"
},
"configurations": {
"production": {
"buildTarget": "orbit:build:production"
},
"development": {
"buildTarget": "orbit:build:development"
}
},
"defaultConfiguration": "development"
}
}
}
},
"cli": {
"analytics": false
}
}
+7710
View File
File diff suppressed because it is too large. Load diff
+28
View File
@@ -0,0 +1,28 @@
{
"name": "orbit",
"version": "1.0.0",
"private": true,
"scripts": {
"ng": "ng",
"api": "node server/server.mjs",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"preview": "ng build && node server/server.mjs"
},
"dependencies": {
"@angular/common": "^19.2.0",
"@angular/compiler": "^19.2.0",
"@angular/core": "^19.2.0",
"@angular/platform-browser": "^19.2.0",
"rxjs": "~7.8.0",
"tslib": "^2.8.0",
"zone.js": "~0.15.0"
},
"devDependencies": {
"@angular/build": "^19.2.0",
"@angular/cli": "^19.2.0",
"@angular/compiler-cli": "^19.2.0",
"typescript": "~5.6.3"
}
}
+6
View File
@@ -0,0 +1,6 @@
{
"/api": {
"target": "http://127.0.0.1:8787",
"secure": false
}
}
+154
View File
@@ -0,0 +1,154 @@
// API de gestion des comptes d'Orbit.
// S'exécute avec Node uniquement (aucune dépendance) : HTTP + SQLite (node:sqlite).
// Au chargement du front, les anciens comptes stockés en localStorage sont
// importés automatiquement via POST /api/import afin de ne rien perdre.
import { createServer } from 'node:http';
import { DatabaseSync } from 'node:sqlite';
import { readFile, stat } from 'node:fs/promises';
import { extname, join, normalize } from 'node:path';
import { fileURLToPath } from 'node:url';
const PORT = Number(process.env.PORT) || 8787;
const HERE = fileURLToPath(new URL('.', import.meta.url));
const DB_PATH = process.env.ORBIT_DB || join(HERE, 'orbit.db');
const DIST_DIR = join(HERE, '..', 'dist', 'orbit', 'browser');
const db = new DatabaseSync(DB_PATH);
db.exec(`CREATE TABLE IF NOT EXISTS users (
key TEXT PRIMARY KEY,
name TEXT NOT NULL,
salt TEXT NOT NULL,
hash TEXT NOT NULL,
state TEXT NOT NULL DEFAULT '{}'
)`);
const KEY_RE = /^[a-z0-9_-]{3,16}$/;
const HASH_RE = /^[A-Za-z0-9+/=]+$/;
function readBody(req) {
return new Promise((resolve) => {
let data = '';
req.on('data', (c) => {
data += c;
if (data.length > 1_000_000) { resolve(null); req.destroy(); }
});
req.on('end', () => {
try { resolve(data ? JSON.parse(data) : null); } catch { resolve(null); }
});
req.on('error', () => resolve(null));
});
}
function send(res, status, obj) {
res.writeHead(status, { 'Content-Type': 'application/json; charset=utf-8' });
res.end(JSON.stringify(obj));
}
function validUserPayload(b) {
return !!b
&& typeof b.name === 'string' && b.name.length > 0 && b.name.length <= 16
&& typeof b.salt === 'string' && b.salt.length > 0
&& typeof b.hash === 'string' && HASH_RE.test(b.hash)
&& (b.state === undefined || (typeof b.state === 'object' && b.state !== null));
}
const insertUser = db.prepare('INSERT INTO users (key, name, salt, hash, state) VALUES (?, ?, ?, ?, ?)');
const getUser = db.prepare('SELECT key, name, salt, hash, state FROM users WHERE key = ?');
const setState = db.prepare('UPDATE users SET state = ? WHERE key = ?');
const countUsers = db.prepare('SELECT COUNT(*) AS n FROM users');
const listAll = db.prepare('SELECT key, name, salt, hash, state FROM users');
const server = createServer(async (req, res) => {
const url = new URL(req.url, `http://${req.headers.host || 'localhost'}`);
const parts = url.pathname.split('/').filter(Boolean);
try {
if (parts[0] === 'api') {
// Création d'un compte (sel + hash PBKDF2 calculés côté client, comme à l'origine).
if (req.method === 'POST' && parts[1] === 'register') {
const b = await readBody(req);
if (!b || typeof b.key !== 'string' || !KEY_RE.test(b.key) || !validUserPayload(b)) {
return send(res, 400, { error: 'invalid' });
}
try {
insertUser.run(b.key, b.name, b.salt, b.hash, JSON.stringify(b.state ?? {}));
return send(res, 201, { ok: true });
} catch {
return send(res, 200, { taken: true });
}
}
// Récupération d'un compte (nécéssaire au login : le sel sert à recalculer le hash).
if (req.method === 'GET' && parts[1] === 'user' && parts[2]) {
const key = decodeURIComponent(parts[2]).toLowerCase();
if (!KEY_RE.test(key)) return send(res, 200, { missing: true });
const row = getUser.get(key);
if (!row) return send(res, 200, { missing: true });
return send(res, 200, {
key: row.key,
name: row.name,
salt: row.salt,
hash: row.hash,
state: JSON.parse(row.state || '{}')
});
}
// Sauvegarde de la progression (points, niveaux, objets...).
if (req.method === 'PUT' && parts[1] === 'state' && parts[2]) {
const key = decodeURIComponent(parts[2]).toLowerCase();
const b = await readBody(req);
if (!b || typeof b.state !== 'object' || b.state === null) {
return send(res, 400, { error: 'invalid' });
}
const info = setState.run(JSON.stringify(b.state), key);
if (info.changes === 0) return send(res, 404, { error: 'unknown user' });
return send(res, 200, { ok: true });
}
// Migration des comptes provenant de l'ancien stockage localStorage.
if (req.method === 'POST' && parts[1] === 'import') {
const b = await readBody(req);
let imported = 0;
if (b && b.users && typeof b.users === 'object') {
for (const [key, u] of Object.entries(b.users)) {
if (!KEY_RE.test(key) || !validUserPayload({ ...u, name: u && u.name })) continue;
try {
insertUser.run(key, u.name, u.salt, u.hash, JSON.stringify(u.state ?? {}));
imported++;
} catch { /* compte déjà présent : on ignore */ }
}
}
return send(res, 200, { imported });
}
if (req.method === 'GET' && parts[1] === 'stats') {
return send(res, 200, { users: countUsers.get().n });
}
return send(res, 404, { error: 'not found' });
}
// Service statique du build (préproduction) : node server/server.mjs suffit.
if (req.method === 'GET') {
const rel = normalize(decodeURIComponent(url.pathname)).replace(/^(\.\.[/\\])+/, '');
let file = join(DIST_DIR, rel === '.' || rel === '/' || rel === '\\' ? 'index.html' : rel);
let st;
try { st = await stat(file); } catch { file = join(DIST_DIR, 'index.html'); st = await stat(file); }
if (st.isDirectory()) { file = join(DIST_DIR, 'index.html'); st = await stat(file); }
const types = {
'.html': 'text/html; charset=utf-8',
'.js': 'text/javascript',
'.css': 'text/css',
'.png': 'image/png',
'.svg': 'image/svg+xml',
'.ico': 'image/x-icon',
'.json': 'application/json'
};
const body = await readFile(file);
res.writeHead(200, { 'Content-Type': types[extname(file).toLowerCase()] || 'application/octet-stream' });
return res.end(body);
}
return send(res, 404, { error: 'not found' });
} catch (e) {
return send(res, 500, { error: 'server error' });
}
});
server.listen(PORT, () => {
console.log(`API Orbit sur http://127.0.0.1:${PORT} (base : ${DB_PATH})`);
console.log(`Stats : GET /api/stats -> ${countUsers.get().n} compte(s)`);
});
+2
View File
@@ -0,0 +1,2 @@
<header id="hd" class="mx-auto max-w-5xl px-4 pt-4"></header>
<main id="app" class="mx-auto max-w-5xl px-4 pb-16 pt-4"></main>
+12
View File
@@ -0,0 +1,12 @@
import { AfterViewInit, Component } from '@angular/core';
@Component({
selector: 'app-root',
standalone: true,
templateUrl: './app.component.html'
})
export class AppComponent implements AfterViewInit {
async ngAfterViewInit(): Promise<void> {
await import('./orbit/orbit');
}
}
+1
View File
@@ -0,0 +1 @@
export const FL={"fr":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGlkPSJmbGFnLWljb25zLWZyIiB2aWV3Qm94PSIwIDAgNjQwIDQ4MCI+CiAgPHBhdGggZmlsbD0iIzAwMDA5MSIgZD0iTTAgMGgyMTMuM3Y0ODBIMHoiLz4KICA8cGF0aCBmaWxsPSIjZmZmIiBkPSJNMjEzLjMgMGgyMTMuNHY0ODBIMjEzLjN6Ii8+CiAgPHBhdGggZmlsbD0iI2UxMDAwZiIgZD0iTTQyNi43IDBINjQwdjQ4MEg0MjYuN3oiLz4KPC9zdmc+Cg==","es":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGlkPSJmbGFnLWljb25zLWVzIiB2aWV3Qm94PSIwIDAgN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maWxsPSJub25lIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iLjMiIGQ9Im0xNDIuMSAyMTMuMi0uNS0uNXMtLjYuMy0xLjMuMmMtLjYgMC0uOS0xLS45LTFzLS43LjctMS4zLjctMS0uNi0xLS42LS43LjUtMS4zLjQtMS4yLS44LTEuMi0uOC0uNi44LTEuMi44Yy0uNi4xLTEtLjUtMS0uNXMtLjQuLine truncated
+3
View File
@@ -0,0 +1,3 @@
export const C=[["France","🇫🇷","Paris","Marseille",46.6,2.4],["Espagne","🇪🇸","Madrid","Barcelone",40.4,-3.7],["Italie","🇮🇹","Rome","Milan",42.8,12.5],["Allemagne","🇩🇪","Berlin","Munich",51.1,10.4],["Royaume-Uni","🇬🇧","Londres","Manchester",54,-2],["Portugal","🇵🇹","Lisbonne","Porto",39.5,-8],["Pays-Bas","🇳🇱","Amsterdam","Rotterdam",52.2,5.3],["Belgique","🇧🇪","Bruxelles","Anvers",50.6,4.6],["Suisse","🇨🇭","Berne","Zurich",46.8,8.2],["Grèce","🇬🇷","Athènes","Thessalonique",39,22],["Pologne","🇵🇱","Varsovie","Cracovie",52,19],["Suède","🇸🇪","Stockholm","Göteborg",62,15],["Norvège","🇳🇴","Oslo","Bergen",61,9],["Russie","🇷🇺","Moscou","Saint-Pétersbourg",60,90],["Turquie","🇹🇷","Ankara","Istanbul",39,35],["Égypte","🇪🇬","Le Caire","Alexandrie",26.8,30.8],["Maroc","🇲🇦","Rabat","Casablanca",31.8,-7],["Nigeria","🇳🇬","Abuja","Lagos",9,8],["Kenya","🇰🇪","Nairobi","Mombasa",0.2,37.9],["Afrique du Sud","🇿🇦","Pretoria","Le Cap",-29,24],["Éthiopie","🇪🇹","Addis-Abeba","Dire Dawa",9,40],["Sénégal","🇸🇳","Dakar","Touba",14.5,-14.5],["Chine","🇨🇳","Pékin","Shanghai",35,103],["Japon","🇯🇵","Tokyo","Osaka",36,138],["Corée du Sud","🇰🇷","Séoul","Busan",36.5,127.8],["Inde","🇮🇳","New Delhi","Bombay",21,78],["Thaïlande","🇹🇭","Bangkok","Chiang Mai",15,101],["Vietnam","🇻🇳","Hanoï","Hô Chi Minh-Ville",16,107],["Indonésie","🇮🇩","Jakarta","Surabaya",-2,118],["Australie","🇦🇺","Canberra","Sydney",-25,134],["Nouvelle-Zélande","🇳🇿","Wellington","Auckland",-41,174],["États-Unis","🇺🇸","Washington","New York",39,-98],["Canada","🇨🇦","Ottawa","Toronto",56,-106],["Mexique","🇲🇽","Mexico","Guadalajara",23,-102],["Brésil","🇧🇷","Brasilia","São Paulo",-10,-52],["Argentine","🇦🇷","Buenos Aires","Córdoba",-35,-65],["Chili","🇨🇱","Santiago","Valparaíso",-33,-71],["Pérou","🇵🇪","Lima","Cusco",-9,-75],["Colombie","🇨🇴","Bogota","Medellín",4,-73]];
export const PL=[["🗼","Une tour de fer de 330 m sur le Champ-de-Mars",48.86,2.29],["🗽","Une statue offerte par la France à l’entrée d’un grand port",40.69,-74.04],["🏛️","Un temple antique sur une colline dominant la capitale",37.97,23.73],["🕌","Un canal de sable, des pyramides et un sphinx",29.98,31.13],["🏯","Un mont enneigé sacré et un train à grande vitesse",35.36,138.73],["🎭","Un opéra aux voiles blanches face à un pont en arc",-33.86,151.21],["🗿","Des statues géantes sur une île isolée du Pacifique",-27.12,-109.35],["🏰","Un château de conte de fées en Bavière",47.56,10.75],["⛰️","Le plus haut sommet du monde",27.99,86.93],["🌋","Un volcan et des geysers, au bord du cercle polaire",64.15,-21.94],["🛕","Un temple khmer enveloppé par la jungle",13.41,103.87],["🏟️","Une arène romaine de 80 après J.-C.",41.89,12.49]];
export const CODE={"France":"fr","Espagne":"es","Italie":"it","Allemagne":"de","Royaume-Uni":"gb","Portugal":"pt","Pays-Bas":"nl","Belgique":"be","Suisse":"ch","Grèce":"gr","Pologne":"pl","Suède":"se","Norvège":"no","Russie":"ru","Turquie":"tr","Égypte":"eg","Maroc":"ma","Nigeria":"ng","Kenya":"ke","Afrique du Sud":"za","Éthiopie":"et","Sénégal":"sn","Chine":"cn","Japon":"jp","Corée du Sud":"kr","Inde":"in","Thaïlande":"th","Vietnam":"vn","Indonésie":"id","Australie":"au","Nouvelle-Zélande":"nz","États-Unis":"us","Canada":"ca","Mexique":"mx","Brésil":"br","Argentine":"ar","Chili":"cl","Pérou":"pe","Colombie":"co"};C.forEach(c=>c[6]=CODE[c[0]]);
+37
View File
@@ -0,0 +1,37 @@
// ===== Objets =====
export const I=[];const add=(t,id,n,v,price,r,ex?)=>I.push({t,id,n,v,price,r,ex});
const g=(...c)=>"linear-gradient(90deg,"+c.join(",")+")";
let K=0;const bulk=(t,r,ex,l)=>l.forEach(a=>add(t,(ex?"d":"s")+t[0]+(K++),a[0],t==="title"?a[0]:a[1],ex?null:a[2],r,ex));
// --- Boutique (achat avec des points) ---
[["🌍","Globe-trotter",60],["🧭","Boussole",80],["🎒","Sac à dos",100],["📸","Photographe",120],["⛵","Voilier",150]].forEach((b,i)=>add("badge","b"+i,b[1],b[0],b[2],"commun"));
[["🏔️","Alpiniste",260],["🪂","Parachutiste",300]].forEach((b,i)=>add("badge","c"+i,b[1],b[0],b[2],"rare"));
bulk("badge","commun",false,[["Cartographe novice","🗺️",70],["Campeur","🏕️",90],["Voyageur du rail","🚂",110],["Pilote","✈️",130],["Cycliste","🚲",80],["Randonneur","🥾",90],["Gourmet","🍜",100],["Passeport","🎫",60],["Lève-tôt","🌅",70],["Plagiste","🏖️",90]]);
bulk("badge","rare",false,[["Plongeur","🤿",280],["Pilote d’hélico","🚁",320],["Explorateur fluvial","🛶",240],["Caravanier","🐪",290],["Astronome","🔭",340],["Grimpeur","🧗",270]]);
bulk("badge","epique",false,[["Champion","🏆",600],["Cosmonaute","🚀",700],["Sage","🦉",550]]);
[["Aube polaire",g("#0f6f7a","#7be0c3"),120],["Désert",g("#e8602c","#f5c16c"),120],["Minuit",g("#10303c","#3a2a6b"),160]].forEach((b,i)=>add("banner","n"+i,b[0],b[1],b[2],"commun"));
bulk("banner","commun",false,[["Prairie",g("#2e7d4f","#b6e388"),130],["Lagon",g("#0077b6","#90e0ef"),130],["Crépuscule",g("#44337a","#f6ad55"),150],["Lavande",g("#6b5b95","#d4c1ec"),140],["Corail",g("#ff6b6b","#ffd6a5"),140]]);
bulk("banner","rare",false,[["Océan profond",g("#03045e","#0077b6","#00b4d8"),340],["Canyon",g("#7f2704","#e8602c","#fdd49e"),320],["Néon Tokyo",g("#12002f","#ff2e93","#00e5ff"),400],["Forêt d’émeraude",g("#052e16","#16a34a","#bbf7d0"),360]]);
bulk("banner","epique",false,[["Galaxie",g("#0b0033","#4b1d8f","#e040fb"),700],["Volcan",g("#1a0000","#b91c1c","#fb923c"),650]]);
[["Voyageur",70],["Explorateur",150],["Cartographe",250]].forEach((b,i)=>add("title","t"+i,b[0],b[0],b[1],"commun"));
bulk("title","commun",false,[["Curieux",null,60],["Globe-trotteur",null,90],["Nomade",null,110],["Aventurier",null,180],["Boussole humaine",null,220]]);
bulk("title","rare",false,[["Capitaine",null,350],["Navigateur",null,400],["Érudit des cartes",null,450]]);
bulk("title","epique",false,[["Maître géographe",null,800],["Seigneur des continents",null,1000]]);
// --- Exclusifs (uniquement dans les boosters) ---
add("badge","x0","Dragon de jade","🐉",null,"epique",true);add("badge","x1","Aigle des Andes","🦅",null,"rare",true);add("badge","x2","Orbite stellaire","🪐",null,"epique",true);add("badge","x3","Souverain du monde","👑",null,"legendaire",true);add("badge","x4","Voie lactée","🌌",null,"legendaire",true);add("badge","x5","Trident d’Atlantis","🔱",null,"epique",true);
add("banner","nx0","Aurore boréale",g("#00c9a7","#845ec2","#ff6f91"),null,"epique",true);add("banner","nx1","Or impérial",g("#b8860b","#ffd700","#b8860b"),null,"legendaire",true);
add("title","tx0","Maître des cartes","Maître des cartes",null,"epique",true);add("title","tx1","Légende vivante","Légende vivante",null,"legendaire",true);
bulk("badge","commun",true,[["Sentier","🌿"],["Brise","🍃"],["Valise","🧳"],["Cerf-volant","🪁"],["Cabane","🛖"],["Trèfle","🍀"],["Coquillage","🐚"],["Tournesol","🌻"],["Croissant","🥐"],["Thé du voyageur","🍵"],["Bûche","🪵"],["Carillon","🎐"]]);
bulk("badge","rare",true,[["Renard roux","🦊"],["Loup gris","🐺"],["Requin","🦈"],["Éléphant","🐘"],["Perroquet","🦜"],["Tortue","🐢"],["Papillon","🦋"],["Baleine","🐋"],["Paon","🦚"],["Lion","🦁"],["Manchot","🐧"],["Flamant","🦩"]]);
bulk("badge","epique",true,[["Licorne","🦄"],["Kraken","🐙"],["Phénix","🔥"],["Cristal de glace","❄️"],["Foudre","⚡"],["Magma","🌋"],["Cobra royal","🐍"]]);
bulk("badge","legendaire",true,[["Comète","☄️"],["Étoile filante","🌠"],["Diamant éternel","💎"],["Relique d’Atlantis","🏺"]]);
bulk("banner","commun",true,[["Brume",g("#cfd8dc","#90a4ae")],["Sable rose",g("#f4c7c3","#e8a598")],["Ciel d’été",g("#4facfe","#a6e3ff")],["Menthe",g("#38b2ac","#c6f6d5")],["Pêche",g("#ffb88c","#ffe0cc")],["Ardoise",g("#334155","#64748b")]]);
bulk("banner","rare",true,[["Aurore",g("#ff9a9e","#fad0c4","#fbc2eb")],["Coucher de soleil",g("#ff512f","#f09819","#ffd200")],["Tempête",g("#232526","#414345","#5c6bc0")],["Jungle",g("#134e4a","#15803d","#a3e635")],["Glacier",g("#a5f3fc","#38bdf8","#0369a1")],["Rubis",g("#4a0418","#be123c","#fb7185")]]);
bulk("banner","epique",true,[["Nébuleuse",g("#1e1b4b","#7c3aed","#f472b6")],["Lave",g("#450a0a","#dc2626","#fbbf24")],["Cyber",g("#0f172a","#06b6d4","#a3e635")],["Opale",g("#a7f3d0","#c4b5fd","#fbcfe8")]]);
bulk("banner","legendaire",true,[["Supernova",g("#000","#7c3aed","#f97316","#fef08a")],["Prisme",g("#ff0080","#ff8c00","#ffee00","#00d26a","#00b4ff","#8a2be2")]]);
bulk("title","commun",true,[["Curieux du monde"],["Marcheur"],["Passager"],["Rêveur"],["Voyageur du dimanche"]]);
bulk("title","rare",true,[["Chasseur de capitales"],["Œil de lynx"],["Maître des drapeaux"],["Pisteur"],["Éclaireur"]]);
bulk("title","epique",true,[["Oracle des frontières"],["Gardien des atlas"],["Mémoire vivante"],["Fantôme des routes"]]);
bulk("title","legendaire",true,[["Empereur d’Orbit"],["Éternel explorateur"]]);
export const RC={commun:"Commun",rare:"Rare",epique:"Épique",legendaire:"Légendaire"};
export const BOOST={std:{n:"Booster Voyage",price:150,w:{commun:68,rare:24,epique:7,legendaire:1}},pre:{n:"Booster Expédition",price:400,w:{commun:20,rare:45,epique:27,legendaire:8}}};
// ===== Espace =====
+1
View File
@@ -0,0 +1 @@
export const PLTEX={"Mercure": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5Ojf/2wBDAQoKCg0MDRoPDxo3JR8lNzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzf/wAARCAEAAgADASIAAhEBAxEB/8QAGgAAAwEBAQEAAAAAAAAAAAAAAwQFAgEGAP/EAE8QAAICAQMCBAQDBQQGBwUHBQECAxEEABIhBTETQVFhFCJxgTKRoSNCUrHBFWLR4QYzcoLC8CRDU3OS0vE0Y4Oy4iVERYSTlKIWNVRkdP/EABkBAQEBAQEBAAAAAAAAAAAAAAEAAgMFBv/EACIRAQEBAAIDAQEBAQADAAAAAAABESExAkFREnFhgSKR8P/aAAwDAQACEQMRAD8A84uRjk/L09fuzH/g0dF8T8HT0P8A8J2/kuhXlv8AgwyV/iCMB+h1pYNxuaN1P92Rk/8AmXXzv/HsivBOgs9NjA/vY8o/4dLtIwNfBYt+mxh/NdEZFjPyGVvZ3Vv6aKmeIBYxp2Ye0YH/AMmnZUWLyKLbAiA9RGNfI6ycLHC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BkFTTf3exP5apY+JNEghl6hFEjDdLine truncated
+52
View File
@@ -0,0 +1,52 @@
export const SPD={
planet:["Mercure","Vénus","Terre","Mars","Jupiter","Saturne","Uranus","Neptune","Pluton","Lune"].map(n=>[n]),
system:[["Système solaire","#ffd966",8,"Une étoile jaune et huit planètes","Seul système où la vie est confirmée","Âgé d’environ 4,6 milliards d’années"],
["Alpha du Centaure","#ffe9a8",1,"Le système stellaire le plus proche du Soleil (environ 4,4 années-lumière)","Il compte trois étoiles","Sa naine rouge abrite une planète dans la zone habitable"],
["TRAPPIST-1","#ff6a4d",7,"Sept planètes rocheuses de la taille de la Terre","À environ 40 années-lumière, dans le Verseau","Étoile naine rouge ultra-froide"],
["Sirius","#cfe3ff",0,"Étoile la plus brillante du ciel nocturne","Accompagnée d’une naine blanche compagne","Dans le Grand Chien, à environ 8,6 années-lumière"],
["Kepler-16","#ffb36b",1,"Premier système à planète circumbinaire confirmé","Sa planète a été surnommée la « Tatooine » réelle","Deux étoiles qui tournent l’une autour de l’autre"],
["Gliese 581","#ff8a5c",3,"Naine rouge de la Balance, à environ 20 années-lumière","Plusieurs super-Terres, dont certaines controversées","Longtemps cité pour sa zone habitable"],
["Epsilon Eridani","#ffb86b",1,"Jeune étoile orange à environ 10,5 années-lumière","Entourée de ceintures de débris","Une planète géante a été détectée"],
["55 Cancri","#ffd08a",5,"Étoile du Cancer avec cinq planètes","L’une d’elles est une super-Terre brûlante couverte de lave","À environ 41 années-lumière"],
["HD 209458","#fff1b8",1,"Première exoplanète observée en transit devant son étoile","Dans la constellation de Pégase","Sa planète perd son atmosphère"],
["51 Pegasi","#fff1b8",1,"Première exoplanète autour d’une étoile de type solaire (1995)","Prototype des « Jupiters chauds »","Découverte récompensée par un prix Nobel"],
["Tau Ceti","#ffe9a8",4,"Étoile de type solaire à environ 12 années-lumière","Des super-Terres candidates y ont été proposées","Dans la Baleine"],
["Kepler-90","#fff1b8",8,"Huit planètes, comme le Soleil","Découvert en 2017 avec l’aide de l’intelligence artificielle","À environ 2 500 années-lumière"],
["Étoile de Barnard","#ff7a4d",4,"Naine rouge à environ 6 années-lumière","Détient l’un des plus grands mouvements propres du ciel","Autour d’elle, de petites planètes de taille sub-terrestre"]],
galaxy:[["Voie lactée","barred","Notre galaxie : des centaines de milliards d’étoiles","Le Soleil se trouve dans l’un de ses bras","Un trou noir supermassif en occupe le centre"],
["Andromède","spiral","La grande galaxie la plus proche, à environ 2,5 millions d’années-lumière","Elle fusionnera avec la nôtre dans quelques milliards d’années","Visible à l’œil nu dans un ciel sombre"],
["Triangle","spiral","Troisième plus grande galaxie du Groupe local","À environ 2,7 millions d’années-lumière","Cataloguée M33"],
["Grand Nuage de Magellan","irr","Satellite de la Voie lactée visible depuis l’hémisphère sud","Elle abrite la nébuleuse de la Tarentule","Forme irrégulière"],
["Petit Nuage de Magellan","irr","Satellite de la Voie lactée à environ 200 000 années-lumière","Plus petite que sa voisine du sud","Visible à l’œil nu dans l’hémisphère sud"],
["Tourbillon","spiral","Elle interagit avec une petite galaxie compagne","Cataloguée M51, dans les Chiens de chasse","À environ 23 millions d’années-lumière"],
["Sombrero","edge","Vue par la tranche, avec un bulbe brillant","Un anneau de poussière sombre barre son disque","Cataloguée M104"],
["Cigare","irr","Galaxie à flambée d’étoiles dans la Grande Ourse","Des jets de gaz s’en échappent","Cataloguée M82"],
["M87","ell","Galaxie elliptique géante de l’amas de la Vierge","Un jet de matière s’échappe de son noyau","Son trou noir central a été le premier photographié"],
["Roue de chariot","ring","Galaxie annulaire née d’une collision","À environ 500 millions d’années-lumière, dans le Sculpteur","Une onde de choc a formé son anneau"],
["Antennes","col","Deux galaxies en pleine fusion","De longues queues de marée s’étirent comme des antennes d’insecte","Dans le Corbeau, à environ 45 millions d’années-lumière"],
["Galaxie du Moulinet","spiral","Grande spirale vue de face dans la Grande Ourse","Cataloguée M101","À environ 21 millions d’années-lumière"],
["Centaurus A","ell","Galaxie elliptique traversée par une bande de poussière","Puissante source radio","À environ 12 millions d’années-lumière"]],
star:[["Soleil","#fff1b8",30,"L’étoile la plus proche de la Terre","Type spectral G2","Il contient 99,8 % de la masse du système solaire"],
["Sirius","#cfe3ff",34,"L’étoile la plus brillante du ciel nocturne","Dans le Grand Chien","À environ 8,6 années-lumière"],
["Bételgeuse","#ff6a3d",56,"Supergéante rouge d’Orion","Elle finira en supernova","Marque l’épaule du chasseur"],
["Rigel","#aecbff",44,"Supergéante bleue d’Orion","À environ 860 années-lumière","Marque le pied du chasseur"],
["Vega","#dbe8ff",34,"Étoile blanche de la Lyre","À environ 25 années-lumière","Longtemps utilisée comme référence de magnitude"],
["Polaris","#fff4cc",36,"L’étoile polaire","Elle indique le nord céleste","Étoile variable de type céphéide"],
["Antarès","#ff5a36",54,"Supergéante rouge du Scorpion","Son nom signifie « rival de Mars »","Elle marque le cœur du Scorpion"],
["Proxima du Centaure","#ff7a4d",16,"Naine rouge la plus proche du Soleil","À environ 4,2 années-lumière","Invisible à l’œil nu"],
["Aldébaran","#ffa24d",44,"Géante orange, œil du Taureau","À environ 65 années-lumière","Voisine apparente des Hyades"],
["Arcturus","#ffb86b",44,"Étoile la plus brillante de l’hémisphère nord céleste","Géante orange du Bouvier","À environ 37 années-lumière"],
["Altaïr","#f2f6ff",32,"Sommet du triangle d’été avec Véga et Deneb","Dans l’Aigle","Elle tourne sur elle-même en quelques heures"],
["Canopus","#fffbe0",44,"Deuxième étoile la plus brillante du ciel","Dans la Carène","Supergéante utilisée pour guider les sondes"],
["Deneb","#e3ecff",46,"Supergéante très lumineuse du Cygne","Sommet du triangle d’été","À plus de mille années-lumière"],
["Spica","#a9c4ff",36,"Étoile bleue de la Vierge","C’est en réalité une binaire très serrée","À environ 250 années-lumière"]],
bh:[["Sagittarius A*",4,"Trou noir supermassif au centre de la Voie lactée","Environ 4 millions de masses solaires","Photographié en 2022"],
["M87*",5,"Premier trou noir photographié (2019)","Environ 6,5 milliards de masses solaires","Au cœur d’une galaxie elliptique géante"],
["Cygnus X-1",1,"Premier candidat trou noir stellaire","Environ 20 masses solaires","Puissante source de rayons X"],
["TON 618",5,"Quasar parmi les plus massifs connus","Des dizaines de milliards de masses solaires","À environ 10 milliards d’années-lumière"],
["Gaia BH1",1,"Trou noir dormant parmi les plus proches connus","À environ 1 560 années-lumière","Compagnon d’une étoile semblable au Soleil"],
["Gaia BH3",2,"Trou noir stellaire très massif de notre galaxie","Environ 33 masses solaires","Découvert en 2024 grâce au mouvement d’une étoile"],
["V404 Cygni",1,"Système binaire à rayons X du Cygne","Éruption spectaculaire en 2015","Trou noir d’environ 9 masses solaires"],
["GW150914",2,"Fusion de deux trous noirs","Premier signal d’ondes gravitationnelles détecté (2015)","Environ 62 masses solaires au résultat"],
["OJ 287",4,"Blazar avec un trou noir binaire supposé","Éclats lumineux périodiques d’environ 12 ans","Dans la constellation du Cancer"],
["A0620-00",1,"Trou noir stellaire proche, dans la Licorne","Système binaire à rayons X","À environ 3 000 années-lumière"]]};
+1
View File
@@ -0,0 +1 @@
export const WORLD={"type":"FeatureCollection","features":[{"type":"Feature","id":"242","properties":{},"geometry":{"type":"MultiPolygon","coordinates":[[[[178.12,-17.51],[178.37,-17.34],[178.72,-17.63],[178.55,-18.15],[177.93,-18.29],[177.38,-18.16],[177.29,-17.72],[177.67,-17.38],[178.12,-17.51]]],[[[-180,-16.07],[-179.79,-16.02],[-179.92,-16.5],[-180,-16.56],[179.36,-16.8],[178.73,-17.01],[178.6,-16.64],[179.1,-16.43],[179.41,-16.38],[180,-16.07],[-180,-16.07]]]]}},{"type":"Feature","id":"834","properties":{},"geometry":{"type":"Polygon","coordinates":[[[33.9,-0.95],[34.07,-1.06],[37.7,-3.1],[37.77,-3.68],[39.2,-4.68],[38.74,-5.91],[38.8,-6.48],[39.44,-6.84],[39.47,-7.1],[39.2,-7.7],[39.25,-8.01],[39.19,-8.49],[39.54,-9.11],[39.95,-10.1],[40.32,-10.32],[39.52,-10.9],[38.43,-11.29],[37.83,-11.27],[37.47,-11.57],[36.78,-11.6],[36.51,-11.72],[35.31,-11.44],[34.56,-11.52],[34.28,-10.16],[33.94,-9.69],[33.74,-9.42],[32.76,-9.23],[32.19,-8.93],[31.56,-8.76],[31.16,-8.59],[30.74,-8.34],[30.2,-7.08],[29.62,-6.52],[29.42,-5.94],[29.52,-5.42],[29.34,-4.5],[29.75,-4.45],[30.12,-4.09],[30.5,-3.57],[30.75,-3.36],[30.74,-3.03],[30.53,-2.81],[30.47,-2.41],[30.76,-2.29],[30.81,-1.7],[30.42,-1.14],[30.77,-1.01],[31.87,-1.03],[33.9,-0.95]]]}},{"type":"Feature","id":"732","properties":{},"geometry":{"type":"Polygon","coordinates":[[[-8.67,27.66],[-8.66,27.59],[-8.69,27.4],[-8.69,25.88],[-11.97,25.93],[-11.94,23.37],[-12.88,23.29],[-13.12,22.77],[-12.93,21.33],[-16.85,21.33],[-17.06,21],[-17.02,21.42],[-17,21.42],[-14.75,21.5],[-14.63,21.86],[-14.22,22.31],[-13.89,23.69],[-12.5,24.77],[-12.03,26.03],[-11.72,26.1],[-11.39,26.88],[-10.55,26.99],[-10.19,26.86],[-9.74,26.86],[-9.41,27.09],[-8.79,27.12],[-8.82,27.66],[-8.67,27.66]]]}},{"type":"Feature","id":"124","properties":{},"geometry":{"type":"MultiPolygon","coordinates":[[[[-122.84,49],[-122.98,49],[-124.91,49.99],[-125.63,50.42],[-127.44,50.83],[-127.99,51.72],[-127.85,52.33],[-129.13,52.76],[-129.3,53.56],[-130.51,54.29],[-130.54,54.8],[-129.98,55.28],[-130.01,55.92],[-131.71,56.55],[-132.73,57.69],[-133.35,58.41],[-134.27,58.86],[-134.95,59.27],[-135.47,59.79],[-136.48,59.46],[-137.45,58.91],[-138.34,59.56],[-139.04,60],[-140.01,60.28],[-141,60.31],[-140.99,66],[-140.99,69.71],[-139.12,69.47],[-137.54,68.99],[-136.5,68.9],[-135.63,69.32],[-134.42,69.63],[-132.93,69.51],[-131.43,69.94],[-129.79,70.19],[-129.11,69.78],[-128.36,70.01],[-128.14,70.48],[-127.45,70.38],[-125.75,69.48],[-124.43,70.16],[-124.29,69.4],[-123.06,69.56],[-122.68,69.86],[-121.47,69.8],[-119.94,69.38],[-117.6,69.01],[-116.23,68.84],[-115.25,68.91],[-113.9,68.4],[-115.3,67.9],[-113.5,67.69],[-110.8,67.81],[-109.95,67.98],[-108.88,67.38],[-107.79,67.89],[-108.81,68.31],[-108.17,68.65],[-106.95,68.7],[-106.15,68.8],[-105.34,68.56],[-104.34,68.02],[-103.22,68.1],[-101.45,67.65],[-99.9,67.81],[-98.44,67.78],[-98.56,68.4],[-97.67,68.58],[-96.12,68.24],[-96.13,67.29],[-95.49,68.09],[-94.69,68.06],[-94.23,69.07],[-95.31,69.68],[-96.47,70.09],[-96.39,71.19],[-95.21,71.92],[-93.89,71.76],[-92.88,71.32],[-91.52,70.19],[-92.41,69.7],[-90.55,69.5],[-90.55,68.47],[-89.21,69.26],[-88.02,68.62],[-88.32,67.87],[-87.35,67.2],[-86.31,67.92],[-85.58,68.78],[-85.52,69.88],[-84.1,69.81],[-82.62,69.66],[-81.28,69.16],[-81.22,68.67],[-81.96,68.13],[-81.26,67.6],[-81.39,67.11],[-83.35,66.41],[-84.74,66.26],[-85.77,66.56],[-86.07,66.06],[-87.03,65.21],[-87.32,64.77],[-88.48,64.1],[-89.91,64.03],[-90.7,63.61],[-90.77,62.96],[-91.93,62.84],[-93.16,62.02],[-94.24,60.9],[-94.63,60.11],[-94.69,58.95],[-93.21,58.78],[-92.76,57.85],[-92.3,57.09],[-90.9,57.29],[-89.04,56.85],[-88.04,56.47],[-87.32,56],[-86.07,55.72],[-85.01,55.3],[-83.36,55.25],[-82.27,55.15],[-82.44,54.28],[-82.13,53.28],[-81.4,52.16],[-79.91,51.21],[-79.14,51.53],[-78.6,52.56],[-79.12,54.14],[-79.83,54.67],[-78.23,55.14],[-77.1,55.84],[-76.54,56.53],[-76.62,57.2],[-77.3,58.05],[-78.52,58.81],[-77.34,59.85],[-77.77,60.76],[-78.11,62.32],[-77.41,62.55],[-75.7,62.28],[-74.67,62.18],[-73.84,62.44],[-72.91,62.11],[-71.68,61.53],[-71.37,61.14],[-69.59,61.06],[-69.62,60.22],[-69.29,58.96],[-68.37,58.8],[-67.65,58.21],[-66.2,58.77],[-65.25,59.87],[-64.58,60.34],[-63.81,59.44],[-62.5,58.17],[-61.4,56.97],[-61.8,56.34],[-60.47,55.78],[-59.57,55.2],[-57.98,54.95],[-57.33,54.63],[-56.94,53.78],[-56.16,53.65],[-55.76,53.27],[-55.68,52.15],[-56.41,51.77],[-57.13,51.42],[-58.78,51.07],[-60.03,50.24],[-61.72,50.08],[-63.86,50.29],[-65.36,50.3],[-66.4,50.23],[-67.24,49.51],[-68.51,49.07],[-69.95,47.74],[-71.11,46.82],[-70.26,46.99],[-68.65,48.3],[-66.55,49.13],[-65.06,49.23],[-64.17,48.74],[-65.12,48.07],[-64.8,46.99],[-64.47,46.24],[-63.17,45.74],[-61.52,45.88],[-60.52,47.01],[-60.45,46.28],[-59.8,45.92],[-61.04,45.26],[-63.25,44.67],[-64.25,44.27],[-65.36,43.55],[-66.12,43.62],[-66.16,44.47],[-64.42,45.29],[-66.03,45.26],[-67.14,45.14],[-67.79,45.7],[-67.79,47.07],[-68.23,47.35],[-68.91,47.19],[-69.24,47.45],[-70,46.69],[-70.3,45.91],[-70.66,45.46],[-71.08,45.31],[-71.4,45.25],[Line truncated
+194
View File
@@ -0,0 +1,194 @@
import {C,PL} from "../data/geo";
import {FL} from "../data/flags";
import {WORLD} from "../data/world";
import {I,RC,BOOST} from "../data/items";
import {PLTEX} from "../data/planet-textures";
import {SPD} from "../data/space-quiz";
declare const L:any; // Leaflet chargé par CDN dans index.html
let c0:any; // variable globale implicite du script d'origine
const rs=s=>()=>(s=(s*16807)%2147483647)/2147483647;
const seedOf=n=>[...n].reduce((a,c)=>a+c.charCodeAt(0),7);
const bgStars=(r,n)=>Array.from({length:n||30},()=>`<circle cx="${(r()*200).toFixed(0)}" cy="${(r()*200).toFixed(0)}" r="${(r()*.9+.2).toFixed(1)}" fill="#fff" opacity="${(r()*.7+.2).toFixed(2)}"/>`).join("");
const svgW=(r,inner)=>`<svg viewBox="0 0 200 200" class="mx-auto h-48 w-48 rounded-full ring-1 ring-ln/10" style="background:radial-gradient(#0c1230,#02030a)" role="img" aria-label="Illustration">${bgStars(r,28)}${inner}</svg>`;
function galSVG(t,seed){const r=rs(seed),gs=()=>(r()+r()+r()+r()-2)/2,d=[],P=(x,y,o,s,c)=>d.push(`<circle cx="${x.toFixed(1)}" cy="${y.toFixed(1)}" r="${s.toFixed(1)}" fill="${c||"#fff"}" opacity="${o.toFixed(2)}"/>`);
if(t==="spiral"||t==="barred"){const bar=t==="barred";for(let i=0;i<420;i++){const arm=i%2,th=r()*5,rad=(bar?26:6)+th*(bar?13:16),a=th+arm*Math.PI+(bar?.5:0)+gs()*.3;P(100+rad*Math.cos(a)+gs()*4,100+rad*Math.sin(a)*.92+gs()*4,.35+r()*.5,.5+r()*.9,i%7?"#cfd9ff":"#ffd9a8")}
if(bar)for(let i=0;i<90;i++){const k=(r()-.5)*58;P(100+k*Math.cos(.5)+gs()*3,100+k*Math.sin(.5)+gs()*3,.7,.8,"#ffe2b8")}
for(let i=0;i<60;i++)P(100+gs()*10,100+gs()*10,.9,1,"#fff1cc")}
else if(t==="edge"){for(let i=0;i<420;i++)P(100+gs()*72,100+gs()*5,.4+r()*.5,.6+r()*.8,"#e8dcc8");for(let i=0;i<160;i++)P(100+gs()*22,100+gs()*14,.8,1,"#fff1cc");d.push('<ellipse cx="100" cy="102" rx="64" ry="2.4" fill="#000" opacity=".6"/>')}
else if(t==="ell"){for(let i=0;i<520;i++){const k=gs()*gs()*1.6;P(100+k*58,100+gs()*gs()*36,.4+r()*.5,.6+r()*.9,"#ffe2b8")}}
else if(t==="irr"){const c=Array.from({length:6},()=>[100+gs()*50,100+gs()*45]);for(let i=0;i<420;i++){const b=c[i%6];P(b[0]+gs()*16,b[1]+gs()*14,.35+r()*.55,.5+r()*.9,i%5?"#d6e2ff":"#ff9ec7")}}
else if(t==="ring"){for(let i=0;i<360;i++){const a=r()*6.283,rad=46+gs()*5;P(100+rad*Math.cos(a),100+rad*Math.sin(a),.5+r()*.5,.6+r()*.9,"#9fd0ff")}for(let i=0;i<70;i++)P(100+gs()*8,100+gs()*8,.9,1,"#fff1cc")}
else{for(let i=0;i<260;i++){P(72+gs()*20,88+gs()*16,.5,.8,"#cfd9ff");P(128+gs()*20,114+gs()*16,.5,.8,"#ffd9a8")}for(let i=0;i<170;i++){const k=r();P(72-k*34+gs()*3,88-k*50+gs()*3,.45,.7,"#cfd9ff");P(128+k*34+gs()*3,114+k*50+gs()*3,.45,.7,"#ffd9a8")}}
return svgW(r,d.join(""))}
function starSVG(c,s,seed){const r=rs(seed);return svgW(r,`<defs><radialGradient id="sg"><stop offset="0" stop-color="#fff"/><stop offset=".4" stop-color="${c}"/><stop offset="1" stop-color="${c}" stop-opacity="0"/></radialGradient></defs><circle cx="100" cy="100" r="${Math.min(96,s*1.7)}" fill="url(#sg)" opacity=".85"/><circle cx="100" cy="100" r="${s*.55}" fill="${c}"/><circle cx="100" cy="100" r="${s*.3}" fill="#fff" opacity=".9"/>`)}
function bhSVG(p,seed){const r=rs(seed),R=9+p*4;return svgW(r,`<defs><linearGradient id="ad"><stop offset="0" stop-color="#ffd08a"/><stop offset=".5" stop-color="#ff6a1f"/><stop offset="1" stop-color="#ffd08a"/></linearGradient></defs><g transform="rotate(-16 100 100)"><ellipse cx="100" cy="100" rx="${R*2.7}" ry="${R*.65}" fill="none" stroke="url(#ad)" stroke-width="${R*.4}" opacity=".95"/></g><circle cx="100" cy="100" r="${R*1.2}" fill="none" stroke="#ffb35a" stroke-width="2" opacity=".8"/><circle cx="100" cy="100" r="${R}" fill="#000"/>`)}
function sysSVG(c,n,seed){const r=rs(seed),o=[];for(let i=0;i<n;i++){const rad=24+i*9,a=r()*6.283;o.push(`<circle cx="100" cy="100" r="${rad}" fill="none" stroke="#fff" opacity=".15"/><circle cx="${(100+rad*Math.cos(a)).toFixed(1)}" cy="${(100+rad*Math.sin(a)).toFixed(1)}" r="${(2+r()*2.5).toFixed(1)}" fill="#9fd0ff"/>`)}
return svgW(r,`<defs><radialGradient id="sy"><stop offset="0" stop-color="#fff"/><stop offset=".5" stop-color="${c}"/><stop offset="1" stop-color="${c}" stop-opacity="0"/></radialGradient></defs>${o.join("")}<circle cx="100" cy="100" r="16" fill="url(#sy)"/>`)}
const planetHTML=n=>`<div class="relative mx-auto h-48 w-48"><div class="h-48 w-48 rounded-full" role="img" aria-label="Astre à identifier" style="background:url(${PLTEX[n]}) 0 50%/auto 100% repeat-x;animation:spinp 50s linear infinite;box-shadow:inset -28px -8px 46px rgb(0 0 0/.85),0 0 40px rgb(120 160 255/.25)"></div>${n==="Saturne"?'<div class="pointer-events-none absolute left-1/2 top-1/2 h-16 w-72 -translate-x-1/2 -translate-y-1/2 -rotate-[18deg] rounded-full border-[6px] border-amber-200/50"></div>':""}</div>`;
const SPL={planet:"Quel est cet astre ?",system:"Quel est ce système stellaire ?",galaxy:"Quelle est cette galaxie ?",star:"Quelle est cette étoile ?",bh:"Quel est ce trou noir ?"};
function spaceQs(m,d){const n=DF[d].o,cl=[3,2,2,1][d];
const mk=(t,it)=>{const o=shuf([it,...shuf(SPD[t].filter(x=>x!==it)).slice(0,n-1)]),s=seedOf(it[0]);let pic="",cs=[];
if(t==="planet")return{c:it,o,lab:SPL[t],vis:planetHTML(it[0])};
if(t==="system"){pic=sysSVG(it[1],it[2],s);cs=it.slice(3)}else if(t==="galaxy"){pic=galSVG(it[1],s);cs=it.slice(2)}else if(t==="star"){pic=starSVG(it[1],it[2],s);cs=it.slice(3)}else{pic=bhSVG(it[1],s);cs=it.slice(2)}
return{c:it,o,lab:SPL[t],vis:pic+`<div class="mx-auto mt-4 max-w-md space-y-1 text-left text-base">${cs.slice(0,cl).map(c=>`<p>• ${c}</p>`).join("")}</div>`}};
if(m!=="bulk")return shuf(SPD[m]).slice(0,10).map(it=>mk(m,it));
return shuf(Object.keys(SPD).flatMap(t=>shuf(SPD[t]).slice(0,2).map(it=>mk(t,it))))}
// ===== Utilitaires =====
const $=id=>document.getElementById(id),item=id=>I.find(x=>x.id===id);
const rnd=a=>a[Math.floor(Math.random()*a.length)],shuf=a=>a.map(x=>[Math.random(),x]).sort((a,b)=>a[0]-b[0]).map(x=>x[1]);
const E=s=>String(s).replace(/[&<>"]/g,c=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[c]);
const hav=(a,b,c,d)=>{const r=x=>x*Math.PI/180,h=Math.sin(r(c-a)/2)**2+Math.cos(r(a))*Math.cos(r(c))*Math.sin(r(d-b)/2)**2;return 12742*Math.asin(Math.sqrt(h))};
const need=l=>100*l;
const LS=(k,v?)=>{try{if(v===undefined)return JSON.parse(localStorage.getItem(k));localStorage.setItem(k,JSON.stringify(v))}catch(e){return null}};
function toast(m){const t=document.createElement("div");t.className="fixed left-1/2 -translate-x-1/2 bottom-6 z-50 rounded-xl bg-ink px-4 py-3 text-sm font-bold text-bg shadow-2xl";t.textContent=m;document.body.appendChild(t);setTimeout(()=>t.remove(),2800)}
// ===== Comptes (stockage local au navigateur) =====
const RS={commun:"border-ln/10",rare:"border-sky-400/60",epique:"border-purple-400/60",legendaire:"border-gold"};
const RT={commun:"text-mu",rare:"text-sky-400",epique:"text-purple-400",legendaire:"text-gold"};
const BASE=()=>({pts:100,xp:0,lvl:1,free:{std:1,pre:0},own:[],eq:{badge:null,banner:null,title:null},played:0,best:0});
let NOM=null,ME=LS("orbit_session")||LS("cq_session"),S=null,tab="play",G=null,opened=null,am="login",MAP=null,PT=null;
const req=async(m,u,b?)=>{try{const r=await fetch(u,{method:m,headers:{"Content-Type":"application/json"},body:b===undefined?undefined:JSON.stringify(b)});return await r.json()}catch(e){return null}};
const save=()=>{if(ME)req("PUT","/api/state/"+encodeURIComponent(ME),{state:S})};
async function hp(pw,salt){const k=await crypto.subtle.importKey("raw",new TextEncoder().encode(pw),"PBKDF2",false,["deriveBits"]);const b=await crypto.subtle.deriveBits({name:"PBKDF2",salt:new TextEncoder().encode(salt),iterations:100000,hash:"SHA-256"},k,256);return btoa(String.fromCharCode(...new Uint8Array(b)))}
const bad=m=>{const f=$("af");$("er").textContent=m;f.classList.remove("shake");void f.offsetWidth;f.classList.add("shake")};
async function auth(ev){ev.preventDefault();const er=$("er"),n=$("pn").value.trim(),pw=$("pw").value,key=n.toLowerCase();er.textContent="";
if(!window.crypto||!crypto.subtle){bad("Ce navigateur ne permet pas de sécuriser le mot de passe.");return}
if(!/^[A-Za-z0-9_-]{3,16}$/.test(n)){bad("Pseudo : 3 à 16 caractères (lettres, chiffres, - et _).");return}
if(pw.length<6){bad("Mot de passe : 6 caractères minimum.");return}
if(am==="reg"){if(pw!==$("pc").value){bad("Les deux mots de passe sont différents.");return}
const salt=Array.from(crypto.getRandomValues(new Uint8Array(12))).join("-");
const r=await req("POST","/api/register",{key,name:n,salt,hash:await hp(pw,salt),state:BASE()});
if(!r){bad("Serveur de comptes inaccessible. Lance l'API (npm run api).");return}
if(r.taken){bad("Ce pseudo est déjà pris.");return}S=BASE();NOM=n}
else{const u=await req("GET","/api/user/"+encodeURIComponent(key));
if(!u){bad("Serveur de comptes inaccessible. Lance l'API (npm run api).");return}
if(!u.hash||u.hash!==await hp(pw,u.salt)){bad("Pseudo ou mot de passe incorrect.");return}
S=Object.assign(BASE(),u.state);NOM=u.name}
ME=key;LS("orbit_session",key);tab="play";G=null;render();toast("Bienvenue "+NOM+" !")}
function logout(){ME=null;S=null;G=null;LP=null;PM=null;CAT=null;LS("orbit_session","");render()}
// ===== Progression =====
function gain(p){S.pts+=p;S.xp+=p;while(S.xp>=need(S.lvl)){S.xp-=need(S.lvl);S.lvl++;const k=S.lvl%5===0?"pre":"std";S.free[k]++;toast("Niveau "+S.lvl+" ! Un "+BOOST[k].n+" offert");confetti(40)}save()}
// ===== Shell =====
const tb=(on)=>"rounded-full px-4 py-1.5 text-sm font-semibold transition "+(on?"bg-ink text-bg":"text-mu hover:text-ink");
function head(){if(!ME){$("hd").innerHTML=`<div class="font-disp text-2xl font-semibold tracking-tight">Orbit</div>`;return}
const T=[["play","Jouer"],["shop","Boutique"],["boost","Boosters"],["me","Profil"]],f=S.free.std+S.free.pre;
$("hd").innerHTML=`<div class="flex items-center gap-3"><div class="font-disp text-2xl font-semibold tracking-tight">Orbit</div>
<div class="ml-auto flex items-center gap-2">
<div class="hidden min-w-[120px] sm:block"><div class="flex justify-between text-xs text-mu"><span>Niveau ${S.lvl}</span><span>${S.xp}/${need(S.lvl)}</span></div><div class="mt-1 h-1.5 rounded-full bg-ln/10"><div class="h-full rounded-full bg-gold" style="width:${100*S.xp/need(S.lvl)}%"></div></div></div>
<span class="rounded-full border border-ln/10 bg-sf/70 px-3 py-1 text-sm font-bold sm:hidden">Niv. ${S.lvl}</span>
<span class="${LP!==null&&LP!==S.pts?"bump ":""}rounded-full border border-ln/10 bg-sf/70 px-3 py-1 text-sm font-bold">🪙 ${S.pts}</span>
<button id="lo" class="rounded-full border border-ln/10 px-3 py-1 text-sm text-mu hover:text-ink">Quitter</button></div></div>
<nav class="mt-3 flex gap-1 overflow-x-auto">${T.map(t=>`<button data-t="${t[0]}" class="${tb(tab===t[0])}">${t[1]}${t[0]==="boost"&&f?` <span class="ml-1 rounded-full bg-gold px-1.5 text-xs text-bg">${f}</span>`:""}</button>`).join("")}</nav>`;
LP=S.pts;$("lo").onclick=logout;$("hd").querySelectorAll("nav button").forEach(b=>b.onclick=()=>{tab=b.dataset.t;G=null;PM=null;CAT=null;render()})}
function render(){stopT();head();if(MAP){MAP.remove();MAP=null}if(!ME)vAuth();else({play:vPlay,shop:vShop,boost:vBoost,me:vMe})[tab]();FX=null;const a=$("app");a.classList.remove("vin");void a.offsetWidth;a.classList.add("vin")}
const inp="w-full rounded-xl border border-ln/15 bg-bg/60 px-4 py-3 outline-none placeholder:text-mu/70 focus:border-gold";
function vAuth(){const reg=am==="reg";
$("app").innerHTML=`<div class="grid items-center gap-10 py-8 lg:grid-cols-2 lg:py-16"><div>
<h1 class="font-disp text-5xl font-semibold leading-[1.05] sm:text-6xl">Le monde en quatre jeux.</h1>
<p class="mt-5 max-w-md text-lg text-mu">Reconnais un drapeau, une capitale, une ville, ou pose ton point sur la carte. Gagne des points, monte en niveau et ouvre des boosters pour décrocher des badges exclusifs.</p>
<div class="mt-6 flex gap-4 text-3xl">🏳️ 🏙️ 🌆 📍</div></div>
<form id="af" class="rounded-3xl border border-ln/10 bg-sf/70 p-6 shadow-2xl backdrop-blur sm:p-8" novalidate>
<div class="mb-5 flex rounded-full bg-ln/10 p-1 text-sm font-semibold"><button type="button" data-m="login" class="flex-1 rounded-full py-2 ${!reg?"bg-ink text-bg":"text-mu"}">Connexion</button><button type="button" data-m="reg" class="flex-1 rounded-full py-2 ${reg?"bg-ink text-bg":"text-mu"}">Inscription</button></div>
<label class="mb-1 block text-sm text-mu" for="pn">Pseudo</label><input id="pn" class="${inp}" autocomplete="username" placeholder="ex. Magellan">
<label class="mb-1 mt-4 block text-sm text-mu" for="pw">Mot de passe</label><input id="pw" type="password" class="${inp}" autocomplete="${reg?"new-password":"current-password"}" placeholder="6 caractères minimum">
${reg?`<label class="mb-1 mt-4 block text-sm text-mu" for="pc">Confirmer le mot de passe</label><input id="pc" type="password" class="${inp}" autocomplete="new-password">`:""}
<p id="er" class="mt-3 min-h-[1.25rem] text-sm text-ko" role="alert"></p>
<button class="mt-2 w-full rounded-xl bg-gold py-3 font-bold text-bg transition hover:brightness-110">${reg?"Créer mon compte":"Se connecter"}</button>
<p class="mt-4 text-xs text-mu">Les comptes sont enregistrés sur le serveur de l'application.</p></form></div>`;
$("af").onsubmit=auth;$("af").querySelectorAll("[data-m]").forEach(b=>b.onclick=()=>{am=b.dataset.m;vAuth()})}
// ===== Jeux =====
const DF=[{n:"Facile",e:"🌱",m:1,o:3,t:0,pt:0,k:2500,d:"3 choix, sans chrono"},{n:"Normal",e:"🧭",m:1.5,o:4,t:15,pt:60,k:1500,d:"4 choix, 15 s par question"},{n:"Difficile",e:"🔥",m:2,o:6,t:10,pt:40,k:800,d:"6 choix, 10 s par question"},{n:"Expert",e:"💀",m:3,o:8,t:6,pt:25,k:400,d:"8 choix, 6 s par question"}];
const CATS=[["earth","🌍","Terre","Drapeaux, capitales, villes et lieux sur la carte."],["space","🪐","Espace","Planètes, étoiles, galaxies et trous noirs."]];
const MODES=[["flag","🏳️","Drapeaux","Reconnais le pays à son drapeau.","earth"],["cap","🏙️","Capitales","Trouve le pays de chaque capitale.","earth"],["city","🌆","Villes","Dans quel pays se trouve cette ville ?","earth"],["place","📍","Lieux","Une photo, une carte : place ton point.","earth"],["planet","🪐","Planètes","Reconnais la planète sur la photo.","space"],["system","⭐","Systèmes connus","Identifie le système stellaire.","space"],["galaxy","🌀","Galaxies","Quelle est cette galaxie ?","space"],["star","✨","Étoiles","Trouve l’étoile d’après ses indices.","space"],["bh","🕳️","Trous noirs","Quel est ce trou noir ?","space"],["bulk","🌌","Bulk","Un mélange des cinq quiz de l’espace.","space"]];
let CAT=null,PM=null,TM=null,MKF=null,VF=null,FX=null,LP=null;
const stopT=()=>{if(TM){clearInterval(TM);TM=null}};
function startT(s,end){if(!s)return;const t0=Date.now();TM=setInterval(()=>{const l=s-(Date.now()-t0)/1000,b=$("tb");if(!b){stopT();return}b.style.width=Math.max(0,100*l/s)+"%";b.className="h-full rounded-full "+(l/s<.3?"bg-ko":"bg-aq");$("tt").textContent="⏱ "+Math.max(0,Math.ceil(l))+" s";if(l<=0){stopT();end()}},100)}
function fly(t,el){const r=el?el.getBoundingClientRect():{left:innerWidth/2,top:innerHeight/3,width:0},d=document.createElement("div");d.className="fly";d.textContent=t;d.style.left=(r.left+r.width/2)+"px";d.style.top=r.top+"px";document.body.appendChild(d);setTimeout(()=>d.remove(),1000)}
function confetti(n){if(matchMedia("(prefers-reduced-motion:reduce)").matches)return;for(let i=0;i<(n||28);i++){const s=document.createElement("span");s.className="cf";s.textContent=rnd(["✨","🎉","⭐","🪙","🎊"]);s.style.left="50%";s.style.top="40%";s.style.setProperty("--dx",(Math.random()-.5)*640+"px");s.style.setProperty("--dy",(Math.random()*-260-40)+"px");s.style.setProperty("--r",(Math.random()*720-360)+"deg");s.style.fontSize=(14+Math.random()*16)+"px";document.body.appendChild(s);setTimeout(()=>s.remove(),1300)}}
function prog(){const p=$("pb");if(p)requestAnimationFrame(()=>requestAnimationFrame(()=>{p.style.width=100*G.i/G.qs.length+"%"}))}
function vPlay(){
if(!G&&PM){const m=MODES.find(x=>x[0]===PM),sd=S.diff==null?1:S.diff;
$("app").innerHTML=`<div><button id="bk" class="text-sm text-mu hover:text-ink">← Retour</button><h2 class="mt-3 font-disp text-3xl font-semibold">${m[1]} ${m[2]}</h2><p class="mt-1 text-mu">Choisis ta difficulté : plus c’est dur, plus les points sont élevés.</p><div class="mt-6 grid gap-4 sm:grid-cols-2">${DF.map((d,i)=>`<button data-d="${i}" class="lift rounded-2xl border bg-sf/70 p-5 text-left ${sd===i?"border-gold":"border-ln/10"}"><div class="flex items-center justify-between"><span class="text-3xl">${d.e}</span><span class="rounded-full bg-gold px-3 py-0.5 text-sm font-bold text-bg">×${d.m}</span></div><div class="mt-3 font-disp text-xl font-semibold">${d.n}</div><div class="text-sm text-mu">${PM==="place"?"Tolérance de "+(d.k>=2500?"large":d.k>=1500?"moyenne":d.k>=800?"faible":"minime")+" sur la distance"+(d.pt?", "+d.pt+" s par manche":", sans chrono"):d.d}</div></button>`).join("")}</div></div>`;
$("bk").onclick=()=>{PM=null;render()};$("app").querySelectorAll("[data-d]").forEach(b=>b.onclick=()=>start(PM,+b.dataset.d));return}
if(!G&&CAT){const c=CATS.find(x=>x[0]===CAT);$("app").innerHTML=`<div><button id="bk" class="text-sm text-mu hover:text-ink">← Catégories</button><h2 class="mt-3 font-disp text-3xl font-semibold">${c[1]} ${c[2]}</h2><p class="mt-1 text-mu">${c[3]}</p><div class="mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-3">${MODES.filter(m=>m[4]===CAT).map(m=>`<button data-m="${m[0]}" class="lift rounded-2xl border ${m[0]==="bulk"?"border-gold/60":"border-ln/10"} bg-sf/70 p-6 text-left hover:border-gold/60"><div class="text-4xl">${m[1]}</div><div class="mt-4 font-disp text-xl font-semibold">${m[2]}</div><div class="mt-1 text-sm text-mu">${m[3]}</div></button>`).join("")}</div></div>`;
$("bk").onclick=()=>{CAT=null;render()};$("app").querySelectorAll("[data-m]").forEach(b=>b.onclick=()=>{PM=b.dataset.m;render()});return}
if(!G){$("app").innerHTML=`<h2 class="font-disp text-3xl font-semibold">Choisis une catégorie</h2><div class="mt-6 grid gap-4 sm:grid-cols-2">${CATS.map(c=>`<button data-k="${c[0]}" class="lift rounded-2xl border border-ln/10 bg-sf/70 p-7 text-left hover:border-gold/60"><div class="text-5xl">${c[1]}</div><div class="mt-4 font-disp text-2xl font-semibold">${c[2]}</div><div class="mt-1 text-sm text-mu">${c[3]}</div><div class="mt-3 text-xs font-semibold text-gold">${MODES.filter(m=>m[4]===c[0]).length} quiz</div></button>`).join("")}</div>
<p class="mt-6 text-sm text-mu">${S.played} parties jouées · record ${S.best} pts</p>`;
$("app").querySelectorAll("[data-k]").forEach(b=>b.onclick=()=>{CAT=b.dataset.k;render()});return}
const df=DF[G.d];
if(G.end){$("app").innerHTML=`<div class="mx-auto mt-8 max-w-md rounded-3xl border border-ln/10 bg-sf/70 p-8 text-center"><div class="pop text-6xl">🏁</div><h2 class="mt-4 font-disp text-3xl font-semibold">Partie terminée</h2><p class="mt-2 text-mu">${G.ok} bonnes réponses sur ${G.qs.length} · ${df.e} ${df.n} ×${df.m}</p><p class="pop mt-1 text-2xl font-bold text-gold">+${G.pts} points</p><div class="mt-6 flex justify-center gap-3"><button id="rp" class="rounded-xl bg-gold px-5 py-2.5 font-bold text-bg">Rejouer</button><button id="mn" class="rounded-xl border border-ln/15 px-5 py-2.5 font-semibold">Menu</button></div></div>`;
$("rp").onclick=()=>start(G.m,G.d);$("mn").onclick=()=>{G=null;PM=null;render()};return}
const secs=G.m==="place"?df.pt:df.t,
bar=`<div class="mb-2 flex items-center justify-between text-sm text-mu"><span>Question ${G.i+1} / ${G.qs.length} · ${df.e} ${df.n} ×${df.m}</span><span class="flex gap-3">${secs?`<span id="tt">⏱ ${secs} s</span>`:""}<span class="font-bold text-gold">+${G.pts} pts</span></span></div><div class="h-1.5 rounded-full bg-ln/10"><div id="pb" class="h-full rounded-full bg-gold transition-all duration-500" style="width:${100*Math.max(0,G.i-1)/G.qs.length}%"></div></div>${secs?`<div class="mt-2 h-1 rounded-full bg-ln/10"><div id="tb" class="h-full rounded-full bg-aq" style="width:100%"></div></div>`:""}<div class="mb-6"></div>`;
if(G.m==="place"){if(!G.cur){$("app").innerHTML=`<div class="mx-auto max-w-3xl">${bar}<div class="grid h-64 place-items-center rounded-2xl border border-ln/10 bg-sf/70 text-mu"><span class="animate-pulse">Recherche d’une photo…</span></div></div>`;prog();return}
const c=G.cur;$("app").innerHTML=`<div class="mx-auto max-w-3xl">${bar}
${c.src?`<figure><img src="${E(c.src)}" alt="Lieu à localiser" class="aspect-[16/10] w-full rounded-2xl border border-ln/10 object-cover"><figcaption class="mt-1 text-xs text-mu">Photo : <a class="underline" href="${E(c.page)}" target="_blank" rel="noopener">Wikimedia Commons</a></figcaption></figure>`:`<div class="rounded-2xl border border-ln/10 bg-sf/70 p-6 text-center"><div class="pop text-7xl">${c.emoji}</div><p class="mt-3 text-lg font-semibold">${c.clue}</p><p class="mt-2 text-xs text-mu">Les photos réelles se chargent quand la page est hébergée hors de claude.ai.</p></div>`}
<div id="map" class="mt-4 h-[420px] overflow-hidden rounded-2xl border border-ln/10"></div>
<p id="fb" class="mt-3 text-sm text-mu">Clique sur la carte pour placer ton point, puis valide.</p>
<div id="nx" class="mt-3"><button id="val" disabled class="rounded-xl bg-gold px-5 py-2.5 font-bold text-bg disabled:opacity-40">Valider mon point</button></div></div>`;prog();initMap();return}
const q=G.qs[G.i],lab=q.vis?[q.lab,q.vis]:{flag:["Quel est ce pays ?",`<img class="mx-auto w-72 max-w-full rounded-lg shadow-2xl ring-1 ring-ln/10" src="${FL[q.c[6]]}" alt="Drapeau à deviner">`],cap:["Capitale de quel pays ?",`<div class="font-disp text-5xl font-semibold">${q.c[2]}</div>`],city:["Dans quel pays se trouve cette ville ?",`<div class="font-disp text-5xl font-semibold">${q.c[3]}</div>`]}[G.m];
$("app").innerHTML=`<div class="mx-auto max-w-2xl">${bar}<div id="qc" class="rounded-3xl border border-ln/10 bg-sf/70 px-6 py-10 text-center">${lab[1]}<p class="mt-5 text-mu">${lab[0]}</p></div>
<div class="mt-4 grid gap-3 sm:grid-cols-2" id="op">${q.o.map(o=>`<button class="rounded-xl border border-ln/15 bg-sf/60 px-4 py-4 font-semibold enabled:hover:border-gold/70">${o[0]}</button>`).join("")}</div><div id="nx" class="mt-4"></div></div>`;
prog();$("op").querySelectorAll("button").forEach((b,k)=>b.onclick=()=>answer(b,k));startT(df.t,()=>answer(null,-1))}
function start(m,d){let qs;S.diff=d;save();PM=null;if(m==="place")qs=shuf(PL).slice(0,5);else if(SPD[m]||m==="bulk")qs=spaceQs(m,d);else qs=shuf(C).slice(0,10).map(c=>({c,o:shuf([c,...shuf(C.filter(x=>x!==c)).slice(0,DF[d].o-1)])}));
G={m,d,qs,i:0,ok:0,st:0,pts:0,done:false,cur:null};if(m==="place")loadRound();else render()}
async function loadRound(){const g=G;g.cur=null;g.done=false;render();let p=null;if(!g.noPhoto){p=await randomPhoto();if(!p)g.noPhoto=true}
if(!p){const f=g.qs[g.i];p={emoji:f[0],clue:f[1],lat:f[2],lon:f[3]}}if(G===g){g.cur=p;render()}}
function next(){$("nx").innerHTML=`<button id="go" class="vin rounded-xl bg-gold px-5 py-2.5 font-bold text-bg">${G.i+1<G.qs.length?"Suivant":"Voir le résultat"}</button>`;
$("go").onclick=()=>{G.i++;if(G.i>=G.qs.length){G.end=true;S.played++;S.best=Math.max(S.best,G.pts);save();render();if(G.ok*2>=G.qs.length)confetti(36)}else if(G.m==="place")loadRound();else{G.done=false;render()}}}
function answer(b,k){if(G.done)return;stopT();G.done=true;const q=G.qs[G.i],good=k>=0&&q.o[k]===q.c,df=DF[G.d];
$("op").querySelectorAll("button").forEach((x,j)=>{x.disabled=true;if(q.o[j]===q.c){x.classList.add("bg-ok/20","border-ok");if(good)x.classList.add("pop")}});
if(good){G.ok++;G.st++;const p=Math.round((10+Math.min(G.st-1,5)*2)*df.m);G.pts+=p;gain(p);head();fly("+"+p,b)}else{G.st=0;(b||$("qc")).classList.add("shake");if(b)b.classList.add("bg-ko/20","border-ko")}next()}
// ===== Photos aléatoires (Wikimedia Commons) =====
const inR=(x,y,r)=>{let c=false;for(let i=0,j=r.length-1;i<r.length;j=i++){const a=r[i],b=r[j];if((a[1]>y)!==(b[1]>y)&&x<(b[0]-a[0])*(y-a[1])/(b[1]-a[1])+a[0])c=!c}return c};
const inLand=(la,lo)=>WORLD.features.some(f=>{const g=f.geometry,P=g.type==="Polygon"?[g.coordinates]:g.coordinates;return P.some(p=>inR(lo,la,p[0])&&!p.slice(1).some(h=>inR(lo,la,h)))});
function randPoint(){for(let k=0;k<60;k++){const c=rnd(C),la=Math.max(-80,Math.min(80,c[4]+(Math.random()-.5)*14)),lo=c[5]+(Math.random()-.5)*14;if(inLand(la,lo))return[la,lo]}return[c0=rnd(C)[4],rnd(C)[5]]}
async function geo(la,lo){const u="https://commons.wikimedia.org/w/api.php?action=query&format=json&formatversion=2&origin=*&generator=geosearch&ggscoord="+la+"%7C"+lo+"&ggsradius=10000&ggsnamespace=6&ggslimit=15&prop=coordinates%7Cimageinfo&iiprop=url&iiurlwidth=1000";
const j=await(await fetch(u)).json();const p=((j.query&&j.query.pages)||[]).filter(x=>/\.jpe?g$/i.test(x.title)&&x.coordinates&&x.imageinfo);return p.length?rnd(p):null}
async function randomPhoto(){for(let k=0;k<3;k++){const r=await Promise.all(Array.from({length:8},()=>{const[la,lo]=randPoint();return geo(la,lo).catch(()=>null)})).then(a=>a.filter(Boolean));
if(r.length){const x=rnd(r);return{src:x.imageinfo[0].thumburl,page:x.imageinfo[0].descriptionurl,lat:x.coordinates[0].lat,lon:x.coordinates[0].lon}}}return null}
// ===== Carte (Leaflet, fond vectoriel intégré) =====
function pops(m){const t0=performance.now();(function f(t){const k=Math.min(1,(t-t0)/450);m.setRadius(8*k+Math.sin(Math.PI*k)*6);if(k<1)requestAnimationFrame(f)})(t0)}
function initMap(){if(typeof L==="undefined"){$("map").innerHTML='<p class="p-6 text-ko">Leaflet n’a pas pu se charger.</p>';return}
const st=getComputedStyle(document.documentElement),v=n=>"rgb("+st.getPropertyValue(n).trim()+")";
MAP=L.map("map",{minZoom:1,maxZoom:8,zoomSnap:.5,maxBounds:[[-85,-180],[85,180]],maxBoundsViscosity:1,attributionControl:false}).setView([25,10],1);
L.geoJSON(WORLD,{style:{color:v("--ink"),opacity:.25,weight:.6,fillColor:v("--aq"),fillOpacity:.4},interactive:false}).addTo(MAP);
const mk=(ll,col)=>L.circleMarker(ll,{radius:0,color:"#fff",weight:2,fillColor:col,fillOpacity:1}).addTo(MAP);let m=null;MKF=mk;VF=v;PT=null;
MAP.on("click",e=>{if(G.done)return;PT=e.latlng;if(m)m.remove();m=mk(PT,v("--gold"));pops(m);$("val").disabled=false});
$("val").onclick=()=>guess(PT,mk,v);setTimeout(()=>MAP&&MAP.invalidateSize(),50);startT(DF[G.d].pt,timeoutPlace)}
function timeoutPlace(){if(G.done)return;if(PT)return guess(PT,MKF,VF);G.done=true;G.st=0;const q=G.cur,a=L.latLng(q.lat,q.lon);pops(MKF(a,VF("--ok")));MAP.setView(a,4);$("fb").textContent="Temps écoulé : 0 point.";$("fb").classList.add("shake");next()}
function guess(ll,mk,v){if(G.done||!ll)return;stopT();G.done=true;const q=G.cur,df=DF[G.d],a=L.latLng(q.lat,q.lon),d=Math.round(hav(ll.lat,ll.lng,q.lat,q.lon)),base=Math.round(50*Math.exp(-d/df.k)),p=Math.round(base*df.m);
if(base>=20)G.ok++;G.pts+=p;gain(p);head();fly("+"+p,$("val"));pops(mk(a,v("--ok")));
L.polyline([ll,a],{color:v("--ink"),weight:2,dashArray:"6 5",className:"draw"}).addTo(MAP);MAP.fitBounds(L.latLngBounds([ll,a]),{padding:[40,40],maxZoom:5});
$("fb").innerHTML='Tu es à <b id="km">0</b> km du lieu · <b class="text-gold">+'+p+' points</b> (×'+df.m+', vert = lieu réel)';
const t0=performance.now();(function f(t){const k=Math.min(1,(t-t0)/800),e=$("km");if(e)e.textContent=Math.round(d*(1-Math.pow(1-k,3))).toLocaleString("fr-FR");if(k<1)requestAnimationFrame(f)})(t0);next()}
// ===== Objets =====
function card(x,extra){const o=S.own.includes(x.id);return `<div class="rounded-2xl border bg-sf/70 p-4 ${RS[x.r]} ${FX===x.id?"pop":""} ${x.r==="legendaire"?"glow":""}">${x.t==="banner"?`<div class="mb-2 h-14 rounded-lg" style="background:${x.v}"></div>`:x.t==="badge"?`<div class="text-center text-4xl">${x.v}</div>`:`<div class="py-2 text-center font-disp text-lg">${x.v}</div>`}<div class="mt-2 font-semibold">${x.n}</div><div class="text-xs ${RT[x.r]}">${RC[x.r]}${x.ex?" · exclusif":""}</div>${extra(x,o)}</div>`}
const bt="mt-3 w-full rounded-lg bg-gold py-2 text-sm font-bold text-bg disabled:opacity-40";
let SF="all",CF="all";
function vShop(){const fb=[["all","Tous"],["commun","Communs"],["rare","Rares"],["epique","Épiques"]];
const sec=(t,h)=>{const l=I.filter(x=>x.t===t&&!x.ex&&(SF==="all"||x.r===SF)).sort((a,b)=>a.price-b.price);return `<h3 class="mb-3 mt-8 font-disp text-xl font-semibold">${h} <span class="text-sm font-normal text-mu">(${l.length})</span></h3>${l.length?`<div class="grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4">${l.map(x=>card(x,(x,o)=>o?`<div class="mt-3 text-sm text-ok">✓ Possédé</div>`:`<button class="${bt} buy" data-id="${x.id}" ${S.pts<x.price?"disabled":""}>🪙 ${x.price}</button>`)).join("")}</div>`:'<p class="text-sm text-mu">Rien dans cette catégorie.</p>'}`};
$("app").innerHTML=`<h2 class="font-disp text-3xl font-semibold">Boutique</h2><div class="mt-4 flex gap-2 overflow-x-auto">${fb.map(f=>`<button data-f="${f[0]}" class="${tb(SF===f[0])} border border-ln/10">${f[1]}</button>`).join("")}</div>`+sec("badge","Badges")+sec("banner","Bannières")+sec("title","Titres")+`<p class="mt-8 text-sm text-mu">Les objets légendaires et la plupart des épiques se gagnent dans les boosters.</p>`;
$("app").querySelectorAll("[data-f]").forEach(b=>b.onclick=()=>{SF=b.dataset.f;vShop()});
$("app").querySelectorAll(".buy").forEach(b=>b.onclick=()=>{const x=item(b.dataset.id);if(S.pts>=x.price){S.pts-=x.price;S.own.push(x.id);save();FX=x.id;toast(x.n+" acheté");confetti(14);render()}})}
function colHtml(){const ex=I.filter(x=>x.ex),ow=ex.filter(x=>S.own.includes(x.id)).length,ft=[["all","Tout"],["badge","Badges"],["banner","Bannières"],["title","Titres"]];
const mini=x=>{const o=S.own.includes(x.id);return `<div class="rounded-xl border bg-sf/70 p-3 text-center ${RS[x.r]} ${o?"":"opacity-45 grayscale"}">${x.t==="badge"?`<div class="text-3xl">${x.v}</div>`:x.t==="banner"?`<div class="h-8 rounded-md" style="background:${x.v}"></div>`:`<div class="py-1 font-disp text-xs leading-tight">${x.v}</div>`}<div class="mt-1 truncate text-xs font-semibold">${x.n}</div><div class="text-[11px] ${o?"text-ok":"text-mu"}">${o?"✓ Obtenu":"🔒 À gagner"}</div></div>`};
let h=`<div class="mt-10 flex flex-wrap items-end justify-between gap-3"><div><h3 class="font-disp text-2xl font-semibold">Objets à gagner</h3><p class="text-sm text-mu">${ow} / ${ex.length} obtenus · uniquement dans les boosters</p></div><div class="flex gap-1 overflow-x-auto">${ft.map(f=>`<button data-c="${f[0]}" class="${tb(CF===f[0])} border border-ln/10">${f[1]}</button>`).join("")}</div></div><div class="mt-3 h-1.5 rounded-full bg-ln/10"><div class="h-full rounded-full bg-gold" style="width:${100*ow/ex.length}%"></div></div>`;
["legendaire","epique","rare","commun"].forEach(r=>{const l=ex.filter(x=>x.r===r&&(CF==="all"||x.t===CF));if(!l.length)return;const o=l.filter(x=>S.own.includes(x.id)).length;
h+=`<h4 class="mb-2 mt-6 font-semibold ${RT[r]}">${RC[r]} <span class="text-xs font-normal text-mu">${o}/${l.length} · ${BOOST.std.w[r]} % Voyage · ${BOOST.pre.w[r]} % Expédition</span></h4><div class="grid grid-cols-3 gap-2 sm:grid-cols-4 lg:grid-cols-6">${l.map(mini).join("")}</div>`});return h}
function bindCol(){$("col").querySelectorAll("[data-c]").forEach(b=>b.onclick=()=>{CF=b.dataset.c;$("col").innerHTML=colHtml();bindCol()})}
function draw(k){const w=BOOST[k].w;let t=Math.random()*100,r="commun";for(const q in w){if(t<w[q]){r=q;break}t-=w[q]}return rnd(I.filter(x=>x.r===r&&x.ex))}
function openB(k,free){const b=BOOST[k];if(free){if(!S.free[k])return;S.free[k]--}else{if(S.pts<b.price)return;S.pts-=b.price}
opened=[1,2,3].map(()=>{const x=draw(k),dup=S.own.includes(x.id);if(dup)S.pts+=({commun:15,rare:40,epique:90,legendaire:200})[x.r];else S.own.push(x.id);return{x,dup}});save();render();if(opened.some(o=>!o.dup&&(o.x.r==="epique"||o.x.r==="legendaire")))setTimeout(()=>confetti(36),500)}
function pack(b,f){const c=b.closest(".rounded-2xl");c.classList.add("shake");b.disabled=true;setTimeout(()=>openB(b.dataset.k,f),450)}
function vBoost(){let h=`<h2 class="font-disp text-3xl font-semibold">Boosters</h2><div class="mt-6 grid gap-4 sm:grid-cols-2">`+Object.keys(BOOST).map(k=>{const b=BOOST[k];return `<div class="rounded-2xl border border-ln/10 bg-sf/70 p-6"><div class="text-4xl">${k==="std"?"📦":"💎"}</div><div class="mt-3 font-disp text-xl font-semibold">${b.n}</div><div class="text-sm text-mu">3 objets · ${b.w.legendaire} % de légendaires</div><div class="mt-4 flex gap-2"><button class="${bt} op" style="margin-top:0" data-k="${k}" ${S.pts<b.price?"disabled":""}>🪙 ${b.price}</button><button class="${bt} opf rounded-lg border border-ln/20 !bg-transparent !text-ink" style="margin-top:0" data-k="${k}" ${S.free[k]?"":"disabled"}>Gratuit (${S.free[k]})</button></div></div>`}).join("")+`</div><p class="mt-4 text-sm text-mu">Un booster gratuit à chaque niveau, un Expédition tous les 5 niveaux. Les doublons sont remboursés en points.</p>`;
if(opened)h+=`<h3 class="mb-3 mt-8 font-disp text-xl font-semibold">Ton tirage</h3><div class="tirage grid grid-cols-1 gap-3 sm:grid-cols-3">`+opened.map(o=>card(o.x,()=>`<div class="mt-3 text-sm ${o.dup?"text-mu":"text-ok"}">${o.dup?"Doublon · remboursé":"Nouveau !"}</div>`).replace('class="rounded-2xl','class="flip rounded-2xl')).join("")+`</div>`;
h+='<div id="col">'+colHtml()+"</div>";$("app").innerHTML=h;bindCol();$("app").querySelectorAll(".op").forEach(b=>b.onclick=()=>pack(b,false));$("app").querySelectorAll(".opf").forEach(b=>b.onclick=()=>pack(b,true))}
function vMe(){const e=S.eq,ba=item(e.banner),bd=item(e.badge),ti=item(e.title),sel=t=>`<h3 class="mb-3 mt-8 font-disp text-xl font-semibold">${{badge:"Badges",banner:"Bannières",title:"Titres"}[t]}</h3><div class="grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4">`+(S.own.map(item).filter(x=>x&&x.t===t).map(x=>card(x,x=>`<button class="${bt} eqb" data-t="${t}" data-id="${x.id}">${S.eq[t]===x.id?"Retirer":"Équiper"}</button>`)).join("")||`<p class="col-span-full text-sm text-mu">Rien pour l’instant : visite la boutique ou ouvre un booster.</p>`)+`</div>`;
$("app").innerHTML=`<div class="overflow-hidden rounded-3xl border border-ln/10 bg-sf/70"><div class="h-28" style="background:${ba?ba.v:"rgb(var(--ln)/.08)"}"></div><div class="flex items-center gap-4 p-5"><div class="-mt-12 grid h-20 w-20 place-items-center rounded-2xl border border-ln/10 bg-bg text-4xl">${bd?bd.v:"🙂"}</div><div><div class="font-disp text-2xl font-semibold">${E(NOM)}</div><div class="text-sm text-mu">${ti?ti.v:"Sans titre"} · Niveau ${S.lvl} · ${S.played} parties · record ${S.best} pts</div></div></div></div>`+sel("badge")+sel("banner")+sel("title");
$("app").querySelectorAll(".eqb").forEach(b=>b.onclick=()=>{S.eq[b.dataset.t]=S.eq[b.dataset.t]===b.dataset.id?null:b.dataset.id;FX=b.dataset.id;save();render()})}
(async()=>{const imp=LS("orbit_users")||LS("cq_users");if(imp)await req("POST","/api/import",{users:imp});
if(ME){const u=await req("GET","/api/user/"+encodeURIComponent(ME));if(u&&u.hash){NOM=u.name;S=Object.assign(BASE(),u.state)}else ME=null}
render()})();
Binary file not shown.

After

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 B

+13
View File
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="fr"><head><meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>Orbit</title>
<link href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Manrope:wght@400;500;600;700&display=swap" rel="stylesheet">
<script src="https://cdn.tailwindcss.com/3.4.17"></script>
<script>tailwind.config={theme:{extend:{colors:{bg:"rgb(var(--bg)/<alpha-value>)",sf:"rgb(var(--sf)/<alpha-value>)",ink:"rgb(var(--ink)/<alpha-value>)",mu:"rgb(var(--mu)/<alpha-value>)",gold:"rgb(var(--gold)/<alpha-value>)",aq:"rgb(var(--aq)/<alpha-value>)",ln:"rgb(var(--ln)/<alpha-value>)",ok:"rgb(var(--ok)/<alpha-value>)",ko:"rgb(var(--ko)/<alpha-value>)"},fontFamily:{disp:["Fraunces","Georgia","serif"],sans:["Manrope","system-ui","sans-serif"]}}}}</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js"></script>
</head>
<body class="min-h-screen font-sans text-ink antialiased">
<app-root></app-root>
</body>
</html>
+4
View File
@@ -0,0 +1,4 @@
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app/app.component';
bootstrapApplication(AppComponent).catch(err => console.error(err));
+685
View File
@@ -0,0 +1,685 @@
:root{--bg:244 246 250;--sf:255 255 255;--ink:15 23 42;--mu:90 102 125;--gold:150 105 30;--aq:14 130 125;--ln:15 23 42;--ok:22 140 90;--ko:200 60 45;box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--bg:9 14 26;--sf:20 29 48;--ink:238 240 245;--mu:143 155 178;--gold:212 175 106;--aq:94 200 190;--ln:255 255 255;--ok:74 209 151;--ko:255 123 107}}
:root[data-theme="dark"]{--bg:9 14 26;--sf:20 29 48;--ink:238 240 245;--mu:143 155 178;--gold:212 175 106;--aq:94 200 190;--ln:255 255 255;--ok:74 209 151;--ko:255 123 107}
html{scroll-padding-top:env(safe-area-inset-top,0px)}
body{background:radial-gradient(1100px 500px at 80% -10%,rgb(var(--gold)/.12),transparent 60%),rgb(var(--bg))}
button:focus-visible,input:focus-visible{outline:2px solid rgb(var(--gold));outline-offset:2px}
.leaflet-container{background:rgb(var(--sf));font:inherit;cursor:crosshair}.leaflet-container img{max-width:none!important}
/* required styles */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
position: absolute;
left: 0;
top: 0;
}
.leaflet-container {
overflow: hidden;
}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
-webkit-user-drag: none;
}
/* Prevents IE11 from highlighting tiles in blue */
.leaflet-tile::selection {
background: transparent;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
image-rendering: -webkit-optimize-contrast;
}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
width: 1600px;
height: 1600px;
-webkit-transform-origin: 0 0;
}
.leaflet-marker-icon,
.leaflet-marker-shadow {
display: block;
}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg {
max-width: none !important;
max-height: none !important;
}
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
max-width: none !important;
max-height: none !important;
width: auto;
padding: 0;
}
.leaflet-container img.leaflet-tile {
/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
mix-blend-mode: plus-lighter;
}
.leaflet-container.leaflet-touch-zoom {
-ms-touch-action: pan-x pan-y;
touch-action: pan-x pan-y;
}
.leaflet-container.leaflet-touch-drag {
-ms-touch-action: pinch-zoom;
/* Fallback for FF which doesn't support pinch-zoom */
touch-action: none;
touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
-ms-touch-action: none;
touch-action: none;
}
.leaflet-container {
-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
filter: inherit;
visibility: hidden;
}
.leaflet-tile-loaded {
visibility: inherit;
}
.leaflet-zoom-box {
width: 0;
height: 0;
-moz-box-sizing: border-box;
box-sizing: border-box;
z-index: 800;
}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
-moz-user-select: none;
}
.leaflet-pane { z-index: 400; }
.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg { z-index: 200; }
.leaflet-vml-shape {
width: 1px;
height: 1px;
}
.lvml {
behavior: url(#default#VML);
display: inline-block;
position: absolute;
}
/* control positioning */
.leaflet-control {
position: relative;
z-index: 800;
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
.leaflet-top,
.leaflet-bottom {
position: absolute;
z-index: 1000;
pointer-events: none;
}
.leaflet-top {
top: 0;
}
.leaflet-right {
right: 0;
}
.leaflet-bottom {
bottom: 0;
}
.leaflet-left {
left: 0;
}
.leaflet-control {
float: left;
clear: both;
}
.leaflet-right .leaflet-control {
float: right;
}
.leaflet-top .leaflet-control {
margin-top: 10px;
}
.leaflet-bottom .leaflet-control {
margin-bottom: 10px;
}
.leaflet-left .leaflet-control {
margin-left: 10px;
}
.leaflet-right .leaflet-control {
margin-right: 10px;
}
/* zoom and fade animations */
.leaflet-fade-anim .leaflet-popup {
opacity: 0;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
opacity: 1;
}
.leaflet-zoom-animated {
-webkit-transform-origin: 0 0;
-ms-transform-origin: 0 0;
transform-origin: 0 0;
}
svg.leaflet-zoom-animated {
will-change: transform;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
-webkit-transition: none;
-moz-transition: none;
transition: none;
}
.leaflet-zoom-anim .leaflet-zoom-hide {
visibility: hidden;
}
/* cursors */
.leaflet-interactive {
cursor: pointer;
}
.leaflet-grab {
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
cursor: crosshair;
}
.leaflet-popup-pane,
.leaflet-control {
cursor: auto;
}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
cursor: move;
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
pointer-events: none;
}
.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
/* visual tweaks */
.leaflet-container {
background: #ddd;
outline-offset: 1px;
}
.leaflet-container a {
color: #0078A8;
}
.leaflet-zoom-box {
border: 2px dotted #38f;
background: rgba(255,255,255,0.5);
}
/* general typography */
.leaflet-container {
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
font-size: 12px;
font-size: 0.75rem;
line-height: 1.5;
}
/* general toolbar styles */
.leaflet-bar {
box-shadow: 0 1px 5px rgba(0,0,0,0.65);
border-radius: 4px;
}
.leaflet-bar a {
background-color: #fff;
border-bottom: 1px solid #ccc;
width: 26px;
height: 26px;
line-height: 26px;
display: block;
text-align: center;
text-decoration: none;
color: black;
}
.leaflet-bar a,
.leaflet-control-layers-toggle {
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
}
.leaflet-bar a:hover,
.leaflet-bar a:focus {
background-color: #f4f4f4;
}
.leaflet-bar a:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.leaflet-bar a:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom: none;
}
.leaflet-bar a.leaflet-disabled {
cursor: default;
background-color: #f4f4f4;
color: #bbb;
}
.leaflet-touch .leaflet-bar a {
width: 30px;
height: 30px;
line-height: 30px;
}
.leaflet-touch .leaflet-bar a:first-child {
border-top-left-radius: 2px;
border-top-right-radius: 2px;
}
.leaflet-touch .leaflet-bar a:last-child {
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
}
/* zoom control */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
font: bold 18px 'Lucida Console', Monaco, monospace;
text-indent: 1px;
}
.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
font-size: 22px;
}
/* layers control */
.leaflet-control-layers {
box-shadow: 0 1px 5px rgba(0,0,0,0.4);
background: #fff;
border-radius: 5px;
}
.leaflet-control-layers-toggle {
background-image: url(images/layers.png);
width: 36px;
height: 36px;
}
.leaflet-retina .leaflet-control-layers-toggle {
background-image: url(images/layers-2x.png);
background-size: 26px 26px;
}
.leaflet-touch .leaflet-control-layers-toggle {
width: 44px;
height: 44px;
}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
display: none;
}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
display: block;
position: relative;
}
.leaflet-control-layers-expanded {
padding: 6px 10px 6px 6px;
color: #333;
background: #fff;
}
.leaflet-control-layers-scrollbar {
overflow-y: scroll;
overflow-x: hidden;
padding-right: 5px;
}
.leaflet-control-layers-selector {
margin-top: 2px;
position: relative;
top: 1px;
}
.leaflet-control-layers label {
display: block;
font-size: 13px;
font-size: 1.08333em;
}
.leaflet-control-layers-separator {
height: 0;
border-top: 1px solid #ddd;
margin: 5px -10px 5px -6px;
}
/* Default icon URLs */
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
background-image: url(images/marker-icon.png);
}
/* attribution and scale controls */
.leaflet-container .leaflet-control-attribution {
background: #fff;
background: rgba(255, 255, 255, 0.8);
margin: 0;
}
.leaflet-control-attribution,
.leaflet-control-scale-line {
padding: 0 5px;
color: #333;
line-height: 1.4;
}
.leaflet-control-attribution a {
text-decoration: none;
}
.leaflet-control-attribution a:hover,
.leaflet-control-attribution a:focus {
text-decoration: underline;
}
.leaflet-attribution-flag {
display: inline !important;
vertical-align: baseline !important;
width: 1em;
height: 0.6669em;
}
.leaflet-left .leaflet-control-scale {
margin-left: 5px;
}
.leaflet-bottom .leaflet-control-scale {
margin-bottom: 5px;
}
.leaflet-control-scale-line {
border: 2px solid #777;
border-top: none;
line-height: 1.1;
padding: 2px 5px 1px;
white-space: nowrap;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: rgba(255, 255, 255, 0.8);
text-shadow: 1px 1px #fff;
}
.leaflet-control-scale-line:not(:first-child) {
border-top: 2px solid #777;
border-bottom: none;
margin-top: -2px;
}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
border-bottom: 2px solid #777;
}
.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
box-shadow: none;
}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
border: 2px solid rgba(0,0,0,0.2);
background-clip: padding-box;
}
/* popup */
.leaflet-popup {
position: absolute;
text-align: center;
margin-bottom: 20px;
}
.leaflet-popup-content-wrapper {
padding: 1px;
text-align: left;
border-radius: 12px;
}
.leaflet-popup-content {
margin: 13px 24px 13px 20px;
line-height: 1.3;
font-size: 13px;
font-size: 1.08333em;
min-height: 1px;
}
.leaflet-popup-content p {
margin: 17px 0;
margin: 1.3em 0;
}
.leaflet-popup-tip-container {
width: 40px;
height: 20px;
position: absolute;
left: 50%;
margin-top: -1px;
margin-left: -20px;
overflow: hidden;
pointer-events: none;
}
.leaflet-popup-tip {
width: 17px;
height: 17px;
padding: 1px;
margin: -10px auto 0;
pointer-events: auto;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
background: white;
color: #333;
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
.leaflet-container a.leaflet-popup-close-button {
position: absolute;
top: 0;
right: 0;
border: none;
text-align: center;
width: 24px;
height: 24px;
font: 16px/24px Tahoma, Verdana, sans-serif;
color: #757575;
text-decoration: none;
background: transparent;
}
.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
color: #585858;
}
.leaflet-popup-scrolled {
overflow: auto;
}
.leaflet-oldie .leaflet-popup-content-wrapper {
-ms-zoom: 1;
}
.leaflet-oldie .leaflet-popup-tip {
width: 24px;
margin: 0 auto;
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
}
.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
border: 1px solid #999;
}
/* div icon */
.leaflet-div-icon {
background: #fff;
border: 1px solid #666;
}
/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
position: absolute;
padding: 6px;
background-color: #fff;
border: 1px solid #fff;
border-radius: 3px;
color: #222;
white-space: nowrap;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.leaflet-tooltip.leaflet-interactive {
cursor: pointer;
pointer-events: auto;
}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
position: absolute;
pointer-events: none;
border: 6px solid transparent;
background: transparent;
content: "";
}
/* Directions */
.leaflet-tooltip-bottom {
margin-top: 6px;
}
.leaflet-tooltip-top {
margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
left: 50%;
margin-left: -6px;
}
.leaflet-tooltip-top:before {
bottom: 0;
margin-bottom: -12px;
border-top-color: #fff;
}
.leaflet-tooltip-bottom:before {
top: 0;
margin-top: -12px;
margin-left: -6px;
border-bottom-color: #fff;
}
.leaflet-tooltip-left {
margin-left: -6px;
}
.leaflet-tooltip-right {
margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
top: 50%;
margin-top: -6px;
}
.leaflet-tooltip-left:before {
right: 0;
margin-right: -12px;
border-left-color: #fff;
}
.leaflet-tooltip-right:before {
left: 0;
margin-left: -12px;
border-right-color: #fff;
}
/* Printing */
@media print {
/* Prevent printers from removing background-images of controls. */
.leaflet-control {
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
}
@keyframes flip{from{transform:rotateY(90deg);opacity:0}}.flip{animation:flip .5s ease both}
@keyframes spinp{to{background-position:-384px 50%}}
@keyframes vin{from{opacity:0;transform:translateY(10px)}}.vin{animation:vin .35s ease both}
#op button{animation:vin .35s ease both}#op button:nth-child(2){animation-delay:.05s}#op button:nth-child(3){animation-delay:.1s}#op button:nth-child(4){animation-delay:.15s}#op button:nth-child(5){animation-delay:.2s}#op button:nth-child(6){animation-delay:.25s}#op button:nth-child(7){animation-delay:.3s}#op button:nth-child(8){animation-delay:.35s}
.tirage>div:nth-child(2){animation-delay:.3s}.tirage>div:nth-child(3){animation-delay:.6s}
@keyframes pop{40%{transform:scale(1.08)}}.pop{animation:pop .45s ease}
@keyframes shake{20%{transform:translateX(-7px)}40%{transform:translateX(7px)}60%{transform:translateX(-5px)}80%{transform:translateX(5px)}}.shake{animation:shake .4s}
@keyframes bump{50%{transform:scale(1.2)}}.bump{animation:bump .4s}
@keyframes fly{from{opacity:1;transform:translate(-50%,0) scale(.8)}to{opacity:0;transform:translate(-50%,-70px) scale(1.2)}}
.fly{position:fixed;z-index:60;font:800 1.6rem Manrope,sans-serif;color:rgb(var(--gold));pointer-events:none;animation:fly 1s ease-out forwards}
@keyframes cf{to{opacity:0;transform:translate(var(--dx),var(--dy)) rotate(var(--r))}}.cf{position:fixed;z-index:60;pointer-events:none;animation:cf 1.2s ease-out forwards}
@keyframes glow{50%{box-shadow:0 0 36px rgb(var(--gold)/.55)}}.glow{animation:glow 1.8s ease-in-out infinite;box-shadow:0 0 22px rgb(var(--gold)/.3)}
@keyframes draw{from{opacity:0}}.draw{animation:draw .6s .3s both}
button:not(:disabled){transition:transform .15s,border-color .15s,background-color .15s,filter .15s}button:not(:disabled):active{transform:scale(.95)}
@media (hover:hover){.lift{transition:transform .2s,border-color .2s}.lift:hover{transform:translateY(-3px)}}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
+12
View File
@@ -0,0 +1,12 @@
// Compléments de typage DOM afin de compiler le moteur du quiz (écrit en JS
// classique) sans modifier son code : il utilise dataset/onclick/disabled/value
// sur des sélecteurs genériques (NodeList, getElementById).
interface Element {
dataset: DOMStringMap;
disabled: boolean;
onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
}
interface HTMLElement {
value: string;
}
+9
View File
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
"files": ["src/main.ts"],
"include": ["src/**/*.d.ts"]
}
+31
View File
@@ -0,0 +1,31 @@
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"strict": false,
"noImplicitAny": false,
"strictNullChecks": false,
"noImplicitReturns": false,
"noFallthroughCasesInSwitch": false,
"noImplicitOverride": false,
"noPropertyAccessFromIndexSignature": false,
"skipLibCheck": true,
"isolatedModules": true,
"esModuleInterop": true,
"sourceMap": true,
"declaration": false,
"experimentalDecorators": true,
"moduleResolution": "bundler",
"importHelpers": true,
"target": "ES2022",
"module": "ES2022",
"useDefineForClassFields": false,
"lib": ["ES2022", "dom"]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": false
}
}