mirror of
https://git.j0bot.ch/admin_j0bot/ploxion-timeline.git
synced 2026-11-29 07:15:10 +00:00
synchro du labo (0bf0da65) : app.blade.php, README.md
This commit is contained in:
commit
772727765b
21
README.md
Normal file
21
README.md
Normal file
@ -0,0 +1,21 @@
|
||||
# ⏳ Timeline
|
||||
|
||||
La frise de la machine à tsoins : passé ← présent → futur. Tes événements du Calendrier posés dans le temps.
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| id | `timeline` |
|
||||
| fournit | `frise` `tsoins` |
|
||||
| bions qu'il nomme | `jOSApps` `jOSBoxion` `jOSGame` `jOSMobile` `jOSOp` `jOSPorts` `jOSXui` |
|
||||
| fichiers | `app.blade.php` |
|
||||
| dans le labo | `resources/views/ploxions/timeline/` (dépôt `my_website2`) |
|
||||
|
||||
## Contribuer
|
||||
|
||||
- **Dans le xer** : https://labo.j0bot.ch/px/atelier?ploxion=timeline — prends-le, modifie-le, vois-le tourner, « ⧗ envoyer le tsoin ».
|
||||
- **Dans VS Code** : `xb prendre timeline` (ou l'extension xerboxion › ⇩ Prendre), puis ⧗ Envoyer.
|
||||
- Le chemin complet : https://labo.j0bot.ch/px/contribuer
|
||||
|
||||
Ce dépôt est un **miroir** du labo (synchronisé par `bin/ploxions-forge.mjs`, depuis le commit `0bf0da65`) : une modif se propose par un tsoin ou une branche du labo, pas directement ici.
|
||||
|
||||
© 2026 chill-tekk · ne pas nuire
|
||||
503
app.blade.php
Normal file
503
app.blade.php
Normal file
@ -0,0 +1,503 @@
|
||||
{{-- PL0XI0N timeline ♾️ — le mur de post-its de RS-7 (OneNote 2020, « Protagonistes ») digitalisé : la BOUCLE de la timeline. Citation du mur : « la vie est un jeu vidéo, le xerboxion ajoute des features à la vie » — Life is a video GAME. --}}
|
||||
<style>
|
||||
.px-timeline{--tla:var(--xr-accent,#7c5cff);position:relative;overflow:hidden;min-height:100%;background:var(--xr-bg,#0a0d16);color:var(--xr-fg,#e8ecf8);font-family:system-ui,-apple-system,sans-serif;padding:10px 0 16px;box-sizing:border-box}
|
||||
.px-timeline *{box-sizing:border-box}
|
||||
.px-timeline .tl-band{margin:0 12px 8px;padding:12px 14px;border:1px solid var(--xr-line,#1b2540);border-radius:14px;background:linear-gradient(135deg,var(--xr-card,#111a30),transparent)}
|
||||
.px-timeline .tl-band h2{margin:0;font-size:17px;letter-spacing:.4px}
|
||||
.px-timeline .tl-band h2 .inf{color:var(--tla);font-size:22px;vertical-align:-2px}
|
||||
.px-timeline .tl-sub{margin-top:4px;font-size:11px;color:var(--xr-muted,#7f93c8);letter-spacing:1.5px;text-transform:uppercase}
|
||||
.px-timeline .tl-truths{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
|
||||
.px-timeline .tl-truth{font-size:11px;font-weight:700;letter-spacing:2px;padding:4px 12px;border-radius:999px;border:1px solid var(--xr-line,#1b2540);background:var(--xr-bg,#0a0d16)}
|
||||
.px-timeline .tl-truth.t1{color:#ff7a7a}.px-timeline .tl-truth.t2{color:#ff9ed2}.px-timeline .tl-truth.t3{color:var(--tla)}
|
||||
.px-timeline .tl-prog{margin:0 12px 10px;padding:8px 12px;border:1px solid var(--xr-line,#1b2540);border-radius:12px;background:var(--xr-card,#111a30)}
|
||||
.px-timeline .tl-prog-txt{display:flex;justify-content:space-between;gap:8px;font-size:11px;color:var(--xr-muted,#7f93c8);margin-bottom:6px;flex-wrap:wrap}
|
||||
.px-timeline .tl-prog-txt b{color:var(--xr-fg,#e8ecf8)}
|
||||
.px-timeline .tl-bar{height:8px;border-radius:99px;background:var(--xr-bg,#0a0d16);overflow:hidden;border:1px solid var(--xr-line,#1b2540)}
|
||||
.px-timeline .tl-bar i{display:block;height:100%;width:100%;background:linear-gradient(90deg,var(--tla),#4de1c1);border-radius:99px;transform-origin:left;transform:scaleX(0);transition:transform .5s ease}
|
||||
.px-timeline .tl-scroll{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding:4px 0 10px;position:relative;z-index:2}
|
||||
.px-timeline .tl-strip{min-width:max-content;padding:0 12px}
|
||||
.px-timeline .tl-tree{position:relative;display:flex;align-items:flex-start;gap:22px;padding:8px 6px 18px}
|
||||
.px-timeline .tl-glyphcv{position:absolute;left:0;top:0;pointer-events:none;z-index:1}
|
||||
.px-timeline .tl-chain{display:flex;align-items:center}
|
||||
.px-timeline .tl-node{position:relative;width:86px;text-align:center;padding:6px 4px;z-index:2}
|
||||
.px-timeline .tl-node .ch{display:block;font-size:26px;line-height:34px;color:var(--tla)}
|
||||
.px-timeline .tl-node.glyph-on .ch{color:transparent}
|
||||
.px-timeline .tl-node .nm{display:block;font-size:10px;margin-top:3px;color:var(--xr-fg,#e8ecf8);word-break:break-word}
|
||||
.px-timeline .tl-node .lv{display:block;font-size:9px;color:var(--xr-muted,#7f93c8)}
|
||||
.px-timeline .tl-node.ghost{opacity:.35;filter:grayscale(1)}
|
||||
.px-timeline .tl-node+.tl-node{margin-left:22px}
|
||||
.px-timeline .tl-node+.tl-node::before{content:'';position:absolute;left:-22px;top:22px;width:22px;height:2px;background:var(--xr-line,#1b2540)}
|
||||
.px-timeline .tl-branch{display:grid;grid-template-columns:repeat(2,minmax(120px,1fr));gap:6px;padding:4px 8px;border-left:2px dashed var(--xr-line,#1b2540)}
|
||||
.px-timeline .tl-branch .bt{font-size:9px;letter-spacing:1.5px;text-transform:uppercase;color:var(--xr-muted,#7f93c8);grid-column:1/-1}
|
||||
.px-timeline .tl-chip{font-size:10px;padding:5px 8px;border-radius:8px;border:1px solid var(--xr-line,#1b2540);background:var(--xr-card,#111a30);white-space:nowrap}
|
||||
.px-timeline .tl-chip.ghost{opacity:.35}
|
||||
.px-timeline .tl-end .tl-chip{border-color:var(--tla);color:var(--tla);font-weight:700}
|
||||
.px-timeline .tl-life{display:flex;align-items:center;gap:10px;padding:2px 8px 8px;font-size:10px;letter-spacing:2px;text-transform:uppercase;color:var(--xr-muted,#7f93c8)}
|
||||
.px-timeline .tl-life .ln{flex:1;height:2px;min-width:400px;background:linear-gradient(90deg,var(--xr-line,#1b2540),var(--tla))}
|
||||
.px-timeline .tl-quests{display:flex;gap:10px;align-items:stretch;padding:2px 4px 8px}
|
||||
.px-timeline .tl-q{width:152px;flex:0 0 auto;padding:10px;border-radius:12px;border:1px solid var(--xr-line,#1b2540);background:var(--xr-card,#111a30);cursor:pointer;-webkit-tap-highlight-color:transparent;transition:transform .12s ease,opacity .12s ease;position:relative}
|
||||
.px-timeline .tl-q:active{transform:scale(.96)}
|
||||
.px-timeline .tl-q .qi{font-size:22px}
|
||||
.px-timeline .tl-q .ql{font-size:12px;font-weight:600;margin-top:5px;line-height:1.3}
|
||||
.px-timeline .tl-q .qs{font-size:10px;color:var(--xr-muted,#7f93c8);margin-top:2px}
|
||||
.px-timeline .tl-q .qx{font-size:10px;color:var(--tla);margin-top:6px}
|
||||
.px-timeline .tl-q .qc{position:absolute;top:8px;right:8px;width:20px;height:20px;border-radius:6px;border:1px solid var(--xr-line,#1b2540);display:flex;align-items:center;justify-content:center;font-size:12px;color:transparent;background:var(--xr-bg,#0a0d16)}
|
||||
.px-timeline .tl-q.done{border-color:#4de1c1}
|
||||
.px-timeline .tl-q.done .qc{color:#4de1c1;border-color:#4de1c1}
|
||||
.px-timeline .tl-q.done .ql{text-decoration:line-through;opacity:.75}
|
||||
.px-timeline .tl-q .qlinks{display:flex;gap:6px;margin-top:7px;flex-wrap:wrap}
|
||||
.px-timeline .tl-q .qlinks button{font-size:11px;min-height:44px;min-width:44px;padding:5px 10px;border-radius:8px;border:1px solid var(--xr-line,#1b2540);background:var(--xr-bg,#0a0d16);color:var(--xr-fg,#e8ecf8);cursor:pointer;-webkit-tap-highlight-color:transparent}
|
||||
.px-timeline .tl-loopcard{width:132px;flex:0 0 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;border:1px dashed var(--tla);border-radius:12px;color:var(--tla);cursor:pointer;font-size:11px;text-align:center;padding:10px;background:transparent;-webkit-tap-highlight-color:transparent}
|
||||
.px-timeline .tl-loopcard .big{font-size:26px}
|
||||
.px-timeline .tl-lock{width:152px;flex:0 0 auto;padding:10px;border-radius:12px;border:1px solid var(--xr-line,#1b2540);background:repeating-linear-gradient(135deg,var(--xr-card,#111a30),var(--xr-card,#111a30) 8px,var(--xr-bg,#0a0d16) 8px,var(--xr-bg,#0a0d16) 16px);cursor:pointer;text-align:center;color:var(--xr-muted,#7f93c8);font-size:11px;-webkit-tap-highlight-color:transparent}
|
||||
.px-timeline .tl-lock .qi{font-size:22px;filter:grayscale(1)}
|
||||
.px-timeline .tl-rules{margin:8px 12px;padding:12px;border:1px solid var(--xr-line,#1b2540);border-radius:14px;background:var(--xr-card,#111a30)}
|
||||
.px-timeline .tl-rules h3{margin:0 0 2px;font-size:12px;letter-spacing:2px;text-transform:uppercase;color:var(--xr-muted,#7f93c8)}
|
||||
.px-timeline .tl-rules .arch{font-size:10px;color:var(--tla);letter-spacing:1px;margin-bottom:8px}
|
||||
.px-timeline .tl-eq{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:14px;padding:8px 10px;border-left:3px solid var(--tla);background:var(--xr-bg,#0a0d16);border-radius:0 8px 8px 0;margin:6px 0;overflow-x:auto;white-space:nowrap}
|
||||
.px-timeline .tl-eq small{display:block;font-size:9px;color:var(--xr-muted,#7f93c8);letter-spacing:1px;margin-top:2px;font-family:system-ui,sans-serif;white-space:normal}
|
||||
.px-timeline .tl-method{margin-top:8px;font-size:11px;color:var(--xr-fg,#e8ecf8);font-style:italic}
|
||||
.px-timeline .tl-method b{color:var(--tla)}
|
||||
.px-timeline .tl-player{margin:8px 12px 0;padding:12px;border:1px solid var(--tla);border-radius:14px;background:linear-gradient(160deg,var(--xr-card,#111a30),var(--xr-bg,#0a0d16));display:flex;gap:12px;align-items:center}
|
||||
.px-timeline .tl-player .av{font-size:32px}
|
||||
.px-timeline .tl-player .pn{font-size:15px;font-weight:800}
|
||||
.px-timeline .tl-player .pc{font-size:11px;color:var(--tla);margin-top:1px}
|
||||
.px-timeline .tl-player .pr{font-size:10px;color:var(--xr-muted,#7f93c8);margin-top:4px;line-height:1.5}
|
||||
.px-timeline .tl-walkers{position:absolute;left:0;right:0;bottom:6px;height:34px;pointer-events:none;z-index:1;overflow:hidden}
|
||||
.px-timeline .tl-walk{position:absolute;bottom:0;left:0;font-size:22px;opacity:.07;will-change:transform;animation:tl-back 46s linear infinite}
|
||||
.px-timeline .tl-walk.w2{font-size:18px;animation-duration:61s;animation-delay:-22s;opacity:.055}
|
||||
@keyframes tl-back{0%{transform:translateX(100vw) scaleX(-1)}100%{transform:translateX(-60px) scaleX(-1)}}
|
||||
.px-timeline .tl-toast{position:absolute;left:50%;bottom:18px;transform:translateX(-50%) translateY(20px);background:var(--xr-card,#111a30);border:1px solid var(--tla);color:var(--xr-fg,#e8ecf8);font-size:12px;padding:8px 14px;border-radius:10px;opacity:0;transition:opacity .25s ease,transform .25s ease;pointer-events:none;z-index:9;max-width:86%;text-align:center}
|
||||
.px-timeline .tl-toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
|
||||
@media (prefers-reduced-motion:reduce){.px-timeline .tl-walk{animation:none;display:none}.px-timeline .tl-bar i{transition:none}}
|
||||
@media (min-width:700px){.px-timeline .tl-band h2{font-size:20px}.px-timeline .tl-q{width:172px}}
|
||||
</style>
|
||||
<script>
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var QUESTS = [
|
||||
{ id: 'heig', label: 'Finir HEIG-VD', icon: '🎓', xp: 120 },
|
||||
{ id: 'arosa', label: 'Aller à Arosa', icon: '🏔️', xp: 40 },
|
||||
{ id: 'cern', label: 'CERN (avec LORI)', icon: '⚛️', xp: 80 },
|
||||
{ id: 'tesla', label: 'Nikola Tesla Museum', icon: '⚡', xp: 60 },
|
||||
{ id: 'rust', label: 'Rust Flowstate', icon: '🦀', xp: 70 },
|
||||
{ id: 'cabane', label: 'Cabane autonome', icon: '🛖', xp: 150 },
|
||||
{ id: 'farm', label: 'First Farm (MWF 1.0, first village)', icon: '🌾', xp: 200 },
|
||||
{ id: 'eeg', label: 'EEG brain-to-computer interface', icon: '🧠', xp: 180 },
|
||||
{ id: 'psyon', label: 'Psyon 1', icon: '🔮', xp: 220 },
|
||||
{ id: 'vega', label: 'Aller à Véga ✱', icon: '✨', xp: 500, sub: '25,04 années-lumière', links: [ ['shipyard', '🚀 shipyard'], ['carte-espace', '🌌 carte-espace'] ] },
|
||||
{ id: 'proxima', label: 'Proxima Centauri', icon: '🌟', xp: 400 },
|
||||
{ id: 'andromede', label: 'Andromède', icon: '🌌', xp: 800 },
|
||||
{ id: 'pluton', label: 'Pluton en 2420', icon: '❄️', xp: 600 },
|
||||
{ id: 'oction', label: 'Aller au oction', icon: '🌀', xp: 888 }
|
||||
];
|
||||
|
||||
var CHAIN = [
|
||||
{ n: 'bion', g: 'wormion', ch: '○', req: 0 },
|
||||
{ n: 'cubion', g: 'portion', ch: '▢', req: 1 },
|
||||
{ n: 'koin', g: 'koin', ch: '△', req: 2 },
|
||||
{ n: 'kion', g: 'xer', ch: '◱', req: 3 },
|
||||
{ n: 'ploxion', g: 'ploxion', ch: '◇', req: 4 },
|
||||
{ n: 'boxion', g: 'portion', ch: '▣', req: 5 },
|
||||
{ n: 'xion', g: 'koin', ch: '△', req: 6 },
|
||||
{ n: 'xerboxion-OS', g: 'ploxion', ch: '◈', req: 7 },
|
||||
{ n: 'xerion', g: 'koin', ch: '✦', req: 8 }
|
||||
];
|
||||
var FINALS = ['xerbot system', 'xerbrain 1.0', 'spiderion', 'exo-squelette all-types', 'xion final system', 'boxion final system', 'xerboxion-OS final form', 'xertoxion global system'];
|
||||
var ENDGAME = ['xeroction', 'zlorbion', 'THOM', 'Tsoinfini / Epsylaeu ∞·∞'];
|
||||
var LSKEY = 'jos:timeline';
|
||||
|
||||
function esc(s) { return window.jOSb.esc(s); }
|
||||
|
||||
function openApp(id) {
|
||||
try { if (window.jOSMobile && window.jOSMobile.open) { window.jOSMobile.open(id, id); return; } } catch (e) {}
|
||||
try { if (window.jOSOp && window.jOSOp.openPloxion) { window.jOSOp.openPloxion(id); return; } } catch (e) {}
|
||||
try { if (window.jOS && window.jOS.openPloxion) { window.jOS.openPloxion(id); return; } } catch (e) {}
|
||||
}
|
||||
|
||||
function gameLevel() {
|
||||
try {
|
||||
var G = window.jOSGame;
|
||||
if (G) {
|
||||
if (typeof G.level === 'function') return G.level();
|
||||
if (typeof G.level === 'number') return G.level;
|
||||
}
|
||||
} catch (e) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
function normFeedNode(nd) {
|
||||
if (nd == null) return null;
|
||||
if (typeof nd === 'string' || typeof nd === 'number') return { n: String(nd), ch: '⧗', lv: '' };
|
||||
if (typeof nd !== 'object') return null;
|
||||
var nm = nd.n != null ? nd.n : (nd.name != null ? nd.name : (nd.label != null ? nd.label : (nd.title != null ? nd.title : nd.id)));
|
||||
if (nm == null || nm === '') return null;
|
||||
var lv = nd.lv != null ? nd.lv : (nd.level != null ? nd.level : (nd.req != null ? nd.req : (nd.at != null ? nd.at : '')));
|
||||
return { n: String(nm), ch: String(nd.ch || '⧗').slice(0, 2), lv: lv === '' ? '' : String(lv) };
|
||||
}
|
||||
|
||||
function feedFromPayload(payload) {
|
||||
if (payload == null) return null;
|
||||
var src = Array.isArray(payload) ? { nodes: payload } : payload;
|
||||
if (typeof src !== 'object') return null;
|
||||
var out = { title: '', nodes: [], branches: [] };
|
||||
try { if (src.title != null || src.name != null || src.label != null) out.title = String(src.title || src.name || src.label || ''); } catch (e) {}
|
||||
var raw = src.nodes || src.chain || src.items || src.forks || src.tree;
|
||||
var i, m;
|
||||
if (Array.isArray(raw)) {
|
||||
for (i = 0; i < raw.length && out.nodes.length < 24; i++) { m = normFeedNode(raw[i]); if (m) out.nodes.push(m); }
|
||||
} else if (raw && typeof raw === 'object') {
|
||||
var cur = raw, depth = 0;
|
||||
while (cur && typeof cur === 'object' && depth < 24) {
|
||||
m = normFeedNode(cur);
|
||||
if (m) out.nodes.push(m);
|
||||
var kids = Array.isArray(cur.children) ? cur.children : (Array.isArray(cur.forks) ? cur.forks : null);
|
||||
if (!kids || !kids.length) break;
|
||||
if (kids.length > 1 && out.branches.length < 6) {
|
||||
var alts = [];
|
||||
for (i = 1; i < kids.length && alts.length < 8; i++) { var a = normFeedNode(kids[i]); if (a) alts.push(a.n); }
|
||||
if (alts.length) out.branches.push({ t: 'fork @ ' + (m ? m.n : depth), items: alts });
|
||||
}
|
||||
cur = kids[0];
|
||||
depth++;
|
||||
}
|
||||
}
|
||||
var rb = Array.isArray(src.branches) ? src.branches : [];
|
||||
for (i = 0; i < rb.length && out.branches.length < 6; i++) {
|
||||
var br = rb[i], t = 'fork', items = [], bi, k, x;
|
||||
if (typeof br === 'string') { items = [br]; }
|
||||
else if (Array.isArray(br)) { for (k = 0; k < br.length && items.length < 8; k++) { x = normFeedNode(br[k]); if (x) items.push(x.n); } }
|
||||
else if (br && typeof br === 'object') {
|
||||
t = String(br.t || br.title || br.label || br.name || t);
|
||||
bi = br.items || br.nodes || br.children;
|
||||
if (Array.isArray(bi)) { for (k = 0; k < bi.length && items.length < 8; k++) { x = normFeedNode(bi[k]); if (x) items.push(x.n); } }
|
||||
}
|
||||
if (items.length) out.branches.push({ t: t, items: items });
|
||||
}
|
||||
if (!out.nodes.length && !out.branches.length) return null;
|
||||
return out;
|
||||
}
|
||||
|
||||
function mount(container, ctx) {
|
||||
var state = { done: {} };
|
||||
try { var raw = localStorage.getItem(LSKEY); if (raw) { var p = JSON.parse(raw); if (p && p.done) state.done = p.done; } } catch (e) {}
|
||||
|
||||
var lvl = gameLevel();
|
||||
|
||||
var h = '';
|
||||
h += '<div class="px-timeline">';
|
||||
h += '<div class="tl-walkers"><span class="tl-walk">🚶♂️</span><span class="tl-walk w2">🚶</span></div>';
|
||||
h += '<div class="tl-band"><h2><span class="inf">∞</span> La boucle de la timeline</h2>';
|
||||
h += '<div class="tl-sub">Life is a video GAME — le xerboxion ajoute des features à la vie</div>';
|
||||
h += '<div class="tl-truths"><span class="tl-truth t1">CHAOS</span><span class="tl-truth t2">LOVE</span><span class="tl-truth t3">XERBOXION</span></div></div>';
|
||||
h += '<div class="tl-prog"><div class="tl-prog-txt"><span><b data-nd>0</b>/' + QUESTS.length + ' quêtes réelles</span><span data-feats>0 feature ajoutée à la vie</span></div><div class="tl-bar"><i data-bar></i></div></div>';
|
||||
h += '<div class="tl-scroll" data-scroll><div class="tl-strip">';
|
||||
|
||||
h += '<div class="tl-tree" data-tree><div class="tl-chain">';
|
||||
var i, q;
|
||||
for (i = 0; i < CHAIN.length; i++) {
|
||||
var nd = CHAIN[i];
|
||||
var ghost = (lvl === null) ? (i < 3 ? '' : ' ghost') : (lvl < nd.req ? ' ghost' : '');
|
||||
h += '<div class="tl-node' + ghost + '" data-glyph="' + nd.g + '"><span class="ch">' + nd.ch + '</span><span class="nm">' + esc(nd.n) + '</span><span class="lv">niv ' + nd.req + '</span></div>';
|
||||
}
|
||||
h += '</div>';
|
||||
h += '<div class="tl-branch"><span class="bt">final forms</span>';
|
||||
for (i = 0; i < FINALS.length; i++) {
|
||||
h += '<span class="tl-chip' + ((lvl === null || lvl < 7) ? ' ghost' : '') + '">' + esc(FINALS[i]) + '</span>';
|
||||
}
|
||||
h += '</div>';
|
||||
h += '<div class="tl-branch tl-end"><span class="bt">endgame</span>';
|
||||
for (i = 0; i < ENDGAME.length; i++) {
|
||||
h += '<span class="tl-chip' + ((lvl === null || lvl < 9) ? ' ghost' : '') + '">' + esc(ENDGAME[i]) + '</span>';
|
||||
}
|
||||
h += '</div></div>';
|
||||
|
||||
h += '<div class="tl-life"><span>ligne de vie</span><span class="ln"></span><span>→</span></div>';
|
||||
|
||||
h += '<div class="tl-quests">';
|
||||
for (i = 0; i < QUESTS.length; i++) {
|
||||
q = QUESTS[i];
|
||||
h += '<div class="tl-q" data-q="' + q.id + '" role="button" tabindex="0" aria-pressed="false">';
|
||||
h += '<span class="qc">✓</span><span class="qi">' + q.icon + '</span>';
|
||||
h += '<div class="ql">' + esc(q.label) + '</div>';
|
||||
if (q.sub) h += '<div class="qs">' + esc(q.sub) + '</div>';
|
||||
h += '<div class="qx">+' + q.xp + ' XP</div>';
|
||||
if (q.links) {
|
||||
h += '<div class="qlinks">';
|
||||
for (var j = 0; j < q.links.length; j++) {
|
||||
h += '<button type="button" data-open="' + q.links[j][0] + '">' + esc(q.links[j][1]) + '</button>';
|
||||
}
|
||||
h += '</div>';
|
||||
}
|
||||
h += '</div>';
|
||||
}
|
||||
h += '<div class="tl-lock" data-prologue role="button" tabindex="0"><span class="qi">🔒</span><div class="ql">Prologue</div><div class="qs">révélé à chaque tsoin, un peu</div></div>';
|
||||
h += '<div class="tl-loopcard" data-loop role="button" tabindex="0"><span class="big">⟲</span><span>la boucle se referme<br>— retour au début —</span></div>';
|
||||
h += '</div>';
|
||||
|
||||
h += '</div></div>';
|
||||
|
||||
h += '<div class="tl-rules"><h3>Les règles du moteur du réel</h3><div class="arch">Architecte du réel</div>';
|
||||
h += '<div class="tl-eq">Gµν = 8πG/c⁴ · Tµν<small>Einstein — la géométrie dit à la matière comment bouger</small></div>';
|
||||
h += '<div class="tl-eq">iℏ d/dt |ψ⟩ = Ĥ |ψ⟩<small>Schrödinger — l’état évolue, toutes les possibilités à la fois</small></div>';
|
||||
h += '<div class="tl-eq">Δx · Δp ≥ ℏ/2<small>Heisenberg — le flou est une règle, pas un bug</small></div>';
|
||||
h += '<div class="tl-method">Méthode : <b>« What if it’s true ? Apply scale & disprove it. »</b></div></div>';
|
||||
|
||||
h += '<div class="tl-player"><span class="av">🧙</span><div><div class="pn">Jobot</div><div class="pc">The Chillest Techno-Wizard in the MW</div><div class="pr">Engineer · Scientist · Philosopher<br>Inventor · Psychonaut · Wizard</div></div></div>';
|
||||
|
||||
h += '<div class="tl-toast" data-toast></div>';
|
||||
h += '</div>';
|
||||
|
||||
container.innerHTML = h;
|
||||
|
||||
var root = container.querySelector('.px-timeline');
|
||||
var scroller = root.querySelector('[data-scroll]');
|
||||
var toastEl = root.querySelector('[data-toast]');
|
||||
var toastTimer = null;
|
||||
var rafId = 0;
|
||||
var glyphCv = null;
|
||||
|
||||
function toast(msg) {
|
||||
var ok = false;
|
||||
try { if (window.jOSb && window.jOSb.toast) { window.jOSb.toast(msg); ok = true; } } catch (e) {}
|
||||
if (ok) return;
|
||||
toastEl.textContent = msg;
|
||||
toastEl.classList.add('show');
|
||||
if (toastTimer) clearTimeout(toastTimer);
|
||||
toastTimer = setTimeout(function () { toastEl.classList.remove('show'); }, 2200);
|
||||
}
|
||||
|
||||
function save() {
|
||||
try { localStorage.setItem(LSKEY, JSON.stringify(state)); } catch (e) {}
|
||||
try { if (window.jOSBoxion && window.jOSBoxion.saveSoon) window.jOSBoxion.saveSoon('timeline', state); } catch (e) {}
|
||||
}
|
||||
|
||||
function countDone() {
|
||||
var n = 0;
|
||||
for (var k = 0; k < QUESTS.length; k++) if (state.done[QUESTS[k].id]) n++;
|
||||
return n;
|
||||
}
|
||||
|
||||
function paint() {
|
||||
var n = countDone();
|
||||
var cards = root.querySelectorAll('[data-q]');
|
||||
for (var k = 0; k < cards.length; k++) {
|
||||
var id = cards[k].getAttribute('data-q');
|
||||
var on = !!state.done[id];
|
||||
cards[k].classList.toggle('done', on);
|
||||
cards[k].setAttribute('aria-pressed', on ? 'true' : 'false');
|
||||
}
|
||||
root.querySelector('[data-nd]').textContent = String(n);
|
||||
root.querySelector('[data-feats]').textContent = n + ' feature' + (n > 1 ? 's' : '') + ' ajoutée' + (n > 1 ? 's' : '') + ' à la vie';
|
||||
root.querySelector('[data-bar]').style.transform = 'scaleX(' + (n / QUESTS.length) + ')';
|
||||
}
|
||||
|
||||
function questById(id) {
|
||||
for (var k = 0; k < QUESTS.length; k++) if (QUESTS[k].id === id) return QUESTS[k];
|
||||
return null;
|
||||
}
|
||||
|
||||
function toggleQuest(id) {
|
||||
var was = !!state.done[id];
|
||||
if (was) { delete state.done[id]; }
|
||||
else { state.done[id] = Date.now(); }
|
||||
save();
|
||||
paint();
|
||||
var qd = questById(id);
|
||||
if (!was && qd) {
|
||||
toast(qd.icon + ' ' + qd.label + ' — +' + qd.xp + ' XP · feature ajoutée à la vie');
|
||||
try {
|
||||
if (window.jOSGame) {
|
||||
if (window.jOSGame.award) window.jOSGame.award('side-done', { label: 'Quête réelle : ' + qd.label, icon: qd.icon, toast: true });
|
||||
if (window.jOSGame.event) window.jOSGame.event('timeline.quest', { id: id, xp: qd.xp });
|
||||
if (countDone() === QUESTS.length && window.jOSGame.unlock) window.jOSGame.unlock('timeline-boucle-complete');
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
|
||||
function drawGlyphs() {
|
||||
try {
|
||||
if (!window.jGlyph || !window.jGlyph.prim) return;
|
||||
var strip = root.querySelector('[data-tree]');
|
||||
if (!strip) return;
|
||||
if (!glyphCv) {
|
||||
glyphCv = document.createElement('canvas');
|
||||
glyphCv.className = 'tl-glyphcv';
|
||||
strip.appendChild(glyphCv);
|
||||
}
|
||||
var w = strip.scrollWidth, hh = strip.offsetHeight;
|
||||
var dpr = Math.min(2, window.devicePixelRatio || 1);
|
||||
glyphCv.width = Math.round(w * dpr);
|
||||
glyphCv.height = Math.round(hh * dpr);
|
||||
glyphCv.style.width = w + 'px';
|
||||
glyphCv.style.height = hh + 'px';
|
||||
var c2 = glyphCv.getContext('2d');
|
||||
if (!c2) return;
|
||||
c2.setTransform(dpr, 0, 0, dpr, 0, 0);
|
||||
c2.clearRect(0, 0, w, hh);
|
||||
var sr = strip.getBoundingClientRect();
|
||||
var col = 'rgba(124,92,255,0.95)';
|
||||
try {
|
||||
var cs = getComputedStyle(root).getPropertyValue('--xr-accent');
|
||||
if (cs && cs.trim()) col = cs.trim();
|
||||
} catch (e) {}
|
||||
var nodes = strip.querySelectorAll('[data-glyph]');
|
||||
for (var k = 0; k < nodes.length; k++) {
|
||||
var el = nodes[k];
|
||||
var chEl = el.querySelector('.ch');
|
||||
var er = (chEl || el).getBoundingClientRect();
|
||||
var cx = er.left - sr.left + er.width / 2;
|
||||
var cy = er.top - sr.top + er.height / 2;
|
||||
window.jGlyph.prim(c2, el.getAttribute('data-glyph'), cx, cy, 13, col, 2);
|
||||
el.classList.add('glyph-on');
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
var feedWrap = null;
|
||||
var feedSeen = -1;
|
||||
|
||||
function renderFeedTree(data) {
|
||||
var strip = root.querySelector('.tl-strip');
|
||||
if (!strip) return;
|
||||
if (!feedWrap) {
|
||||
feedWrap = document.createElement('div');
|
||||
feedWrap.setAttribute('data-feed', '');
|
||||
var anchor = root.querySelector('[data-tree]');
|
||||
if (anchor && anchor.parentNode === strip && anchor.nextSibling) strip.insertBefore(feedWrap, anchor.nextSibling);
|
||||
else strip.appendChild(feedWrap);
|
||||
}
|
||||
var fh = '<div class="tl-life"><span>⧗ ' + esc(data.title || 'forks — branches') + '</span><span class="ln"></span></div>';
|
||||
fh += '<div class="tl-tree"><div class="tl-chain">';
|
||||
var k;
|
||||
for (k = 0; k < data.nodes.length; k++) {
|
||||
var nd = data.nodes[k];
|
||||
fh += '<div class="tl-node"><span class="ch">' + esc(nd.ch) + '</span><span class="nm">' + esc(nd.n) + '</span>' + (nd.lv ? '<span class="lv">' + esc(nd.lv) + '</span>' : '') + '</div>';
|
||||
}
|
||||
fh += '</div>';
|
||||
for (k = 0; k < data.branches.length; k++) {
|
||||
var br = data.branches[k];
|
||||
fh += '<div class="tl-branch"><span class="bt">' + esc(br.t) + '</span>';
|
||||
for (var x = 0; x < br.items.length; x++) fh += '<span class="tl-chip">' + esc(br.items[x]) + '</span>';
|
||||
fh += '</div>';
|
||||
}
|
||||
fh += '</div>';
|
||||
feedWrap.innerHTML = fh;
|
||||
if (data.nodes.length !== feedSeen) {
|
||||
feedSeen = data.nodes.length;
|
||||
toast('⧗ arbre de forks reçu — ' + feedSeen + ' nœud' + (feedSeen > 1 ? 's' : '') + ' (branches)');
|
||||
}
|
||||
}
|
||||
|
||||
function onClick(e) {
|
||||
var t = e.target;
|
||||
if (!t || !t.closest) return;
|
||||
var openBtn = t.closest('[data-open]');
|
||||
if (openBtn && root.contains(openBtn)) {
|
||||
e.stopPropagation();
|
||||
openApp(openBtn.getAttribute('data-open'));
|
||||
return;
|
||||
}
|
||||
var loopBtn = t.closest('[data-loop]');
|
||||
if (loopBtn && root.contains(loopBtn)) {
|
||||
try { scroller.scrollTo({ left: 0, behavior: 'smooth' }); } catch (err) { scroller.scrollLeft = 0; }
|
||||
toast('∞ la boucle recommence');
|
||||
return;
|
||||
}
|
||||
var proBtn = t.closest('[data-prologue]');
|
||||
if (proBtn && root.contains(proBtn)) {
|
||||
toast('chaque tsoin est la fin du jeu. le temps va en arrière — il y a toujours des tsoins.');
|
||||
return;
|
||||
}
|
||||
var card = t.closest('[data-q]');
|
||||
if (card && root.contains(card)) toggleQuest(card.getAttribute('data-q'));
|
||||
}
|
||||
|
||||
function onKey(e) {
|
||||
if (e.key !== 'Enter' && e.key !== ' ') return;
|
||||
var el = e.target;
|
||||
if (el && el.hasAttribute && (el.hasAttribute('data-q') || el.hasAttribute('data-prologue') || el.hasAttribute('data-loop'))) {
|
||||
e.preventDefault();
|
||||
el.click();
|
||||
}
|
||||
}
|
||||
|
||||
function onResize() {
|
||||
if (rafId) cancelAnimationFrame(rafId);
|
||||
rafId = requestAnimationFrame(drawGlyphs);
|
||||
}
|
||||
|
||||
root.addEventListener('click', onClick);
|
||||
root.addEventListener('keydown', onKey);
|
||||
window.addEventListener('resize', onResize);
|
||||
|
||||
paint();
|
||||
rafId = requestAnimationFrame(drawGlyphs);
|
||||
|
||||
try {
|
||||
if (window.jOSBoxion && window.jOSBoxion.load) {
|
||||
window.jOSBoxion.load('timeline').then(function (remote) {
|
||||
if (remote && remote.done) {
|
||||
var changed = false;
|
||||
for (var k in remote.done) {
|
||||
if (remote.done.hasOwnProperty(k) && !state.done[k]) { state.done[k] = remote.done[k]; changed = true; }
|
||||
}
|
||||
if (changed) {
|
||||
try { localStorage.setItem(LSKEY, JSON.stringify(state)); } catch (e) {}
|
||||
paint();
|
||||
}
|
||||
}
|
||||
}).catch(function () {});
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
try { if (window.jOSGame && window.jOSGame.event) window.jOSGame.event('timeline.open', { quests: QUESTS.length }); } catch (e) {}
|
||||
|
||||
var offFeed = null;
|
||||
try {
|
||||
if (window.jOSPorts && window.jOSPorts.on) {
|
||||
offFeed = window.jOSPorts.on('ploxion.timeline.feed', function (payload) {
|
||||
try {
|
||||
var data = feedFromPayload(payload);
|
||||
if (data) renderFeedTree(data);
|
||||
} catch (e) {}
|
||||
});
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
return {
|
||||
unmount: function () {
|
||||
try { if (typeof offFeed === 'function') offFeed(); } catch (e) {}
|
||||
if (toastTimer) clearTimeout(toastTimer);
|
||||
if (rafId) cancelAnimationFrame(rafId);
|
||||
window.removeEventListener('resize', onResize);
|
||||
root.removeEventListener('click', onClick);
|
||||
root.removeEventListener('keydown', onKey);
|
||||
container.innerHTML = '';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// ===== XUI (contrat v0, bion jOSXui) : describe() = MA timeline de vie, non monté =====
|
||||
// p1 = les quêtes réelles accomplies (LA donnée maîtresse : jos:timeline.done, le même
|
||||
// state que le mount) + l'XP de vie gagné. Pur, jamais le DOM, ne throw jamais.
|
||||
function describe(){
|
||||
var items=[];
|
||||
try{
|
||||
var done={}; try{ var p=JSON.parse(localStorage.getItem(LSKEY)); if(p&&p.done) done=p.done; }catch(e){}
|
||||
var n=0, xp=0, next=null;
|
||||
QUESTS.forEach(function(q){ if(done[q.id]){ n++; xp+=(q.xp|0); } else if(!next) next=q; });
|
||||
items.push({ p:1, kind:'stat', label:'♾️ quêtes réelles', value:n+' / '+QUESTS.length });
|
||||
items.push({ p:2, kind:'gauge', label:'la boucle', value:n, min:0, max:QUESTS.length });
|
||||
if(next) items.push({ p:2, kind:'text', label:'prochaine', value:String(next.icon+' '+next.label).slice(0,60) });
|
||||
items.push({ p:3, kind:'stat', label:'XP de vie', value:xp });
|
||||
}catch(e){ items=[{ p:1, kind:'text', label:'♾️ timeline', value:'boucle indisponible' }]; }
|
||||
return { v:1, id:'timeline', title:'Timeline', icon:'♾️', items:items };
|
||||
}
|
||||
|
||||
window.jOSApps = window.jOSApps || {};
|
||||
window.jOSApps['timeline'] = { manifest: { id: 'timeline', name: 'Timeline', icon: '♾️' }, mount: mount, describe: describe };
|
||||
})();
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user