synchro du labo (0bf0da65) : app.blade.php, README.md

This commit is contained in:
cloudion
2026-11-03 22:39:31 +00:00
commit 18a3e00da6
2 changed files with 123 additions and 0 deletions

21
README.md Normal file
View File

@@ -0,0 +1,21 @@
# ◆ Xeroction
Inviter des xeroctions d'un geste (un code, un QR : leur compte reçoit le palier xeroction), suivre qui est arrivé, et l'arrivée au Nexus : l'app ploxi0n, le RepoVerse, son boxion relié au Nexus en une ligne. Cloudion, c'est le Nexus en vrai.
| | |
| --- | --- |
| id | `xeroction` |
| fournit | `xeroction` `invitation` `nexus` `onboarding` `echelle` |
| bions qu'il nomme | `jOSApps` `jOSQR` |
| fichiers | `app.blade.php` |
| dans le labo | `resources/views/ploxions/xeroction/` (dépôt `my_website2`) |
## Contribuer
- **Dans le xer** : https://labo.j0bot.ch/px/atelier?ploxion=xeroction — prends-le, modifie-le, vois-le tourner, « ⧗ envoyer le tsoin ».
- **Dans VS Code** : `xb prendre xeroction` (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

102
app.blade.php Normal file
View File

@@ -0,0 +1,102 @@
{{-- ◆ XEROCTION — inviter des xeroctions d'un geste, les suivre, et leur arrivée au Nexus (RS-7 15.10). Backend : /px/xeroction/etat ;
l'émission = POST /px/invitation/emit (niv=xeroction, la garde « seul un xeroction » y vit) ; le QR = jOSQR ou la lib vendor. --}}
<style>
.xo { --a:#a597cf; --b:#79d9a2; --t:#ddd6ea; --m:#7f7699; --s:#0f0b18; --bd:#272036; --bd2:#3a3050; min-height:100%; box-sizing:border-box; background:#07050c; color:var(--t);
padding:16px 16px calc(96px + env(safe-area-inset-bottom,0px)); font-family:-apple-system,system-ui,sans-serif; }
.xo h2 { margin:6px 0 4px; font-size:21px; } .xo .sous { color:var(--m); font-size:13.5px; line-height:1.5; margin:0 0 16px; }
.xo-glyphe { font-size:34px; color:var(--a); }
.xo input { width:100%; box-sizing:border-box; padding:14px; border-radius:14px; border:2px solid var(--bd2); background:#0a0712; color:var(--t); font:16px -apple-system,system-ui,sans-serif; margin-bottom:10px; }
.xo .grand { width:100%; min-height:58px; border-radius:16px; border:2px solid var(--a); background:var(--a); color:#0d0a16; font:800 17px -apple-system,system-ui,sans-serif; }
.xo .grand:active, .xo .sec:active { transform:scale(.98); }
.xo .sec { width:100%; min-height:48px; margin-top:8px; border-radius:14px; border:2px solid var(--bd); background:var(--s); color:var(--t); font:700 14.5px -apple-system,system-ui,sans-serif; }
.xo-qr { margin:18px auto 10px; width:min(72vw,280px); aspect-ratio:1; padding:12px; border-radius:18px; background:#fff; display:flex; align-items:center; justify-content:center; }
.xo-qr img { width:100% !important; height:auto !important; image-rendering:pixelated; }
.xo-lien { text-align:center; font:600 12px ui-monospace,Menlo,monospace; color:var(--m); word-break:break-all; margin-bottom:6px; }
.xo-i { display:flex; align-items:center; gap:11px; padding:11px 12px; margin-bottom:8px; border-radius:14px; border:2px solid var(--bd); background:var(--s); }
.xo-i i { font-style:normal; width:24px; text-align:center; color:var(--a); font-size:18px; } .xo-i div { flex:1; min-width:0; } .xo-i b { font-size:14.5px; }
.xo-i small { display:block; color:var(--m); font:600 11px ui-monospace,Menlo,monospace; margin-top:2px; }
.xo-i.pris { border-color:rgba(121,217,162,.45); } .xo-i.pris i { color:var(--b); }
.xo-i button { min-height:38px; padding:0 11px; border-radius:11px; border:2px solid var(--bd2); background:#0a0712; color:var(--t); font:700 12px ui-monospace,Menlo,monospace; }
.xo-etape { display:flex; gap:12px; padding:12px 0; border-bottom:1px solid rgba(190,175,230,.06); }
.xo-etape .n { flex:none; width:30px; height:30px; border-radius:50%; border:2px solid var(--bd2); display:flex; align-items:center; justify-content:center; font:800 13px ui-monospace,Menlo,monospace; color:var(--m); }
.xo-etape.fait .n { border-color:var(--b); background:var(--b); color:#0d0a16; }
.xo-etape b { font-size:15px; } .xo-etape p { margin:3px 0 6px; color:var(--m); font-size:13px; line-height:1.45; }
.xo-etape code { display:block; padding:10px; border-radius:11px; background:#0a0712; border:1.5px solid var(--bd); color:var(--t); font:12px/1.5 ui-monospace,Menlo,monospace; word-break:break-all; }
.xo-etape a, .xo-etape button { display:inline-block; margin-top:6px; padding:9px 13px; border-radius:11px; border:2px solid var(--a); color:var(--t); background:none; text-decoration:none; font:700 13px -apple-system,system-ui,sans-serif; }
.xo-nav { position:fixed; left:12px; right:12px; bottom:calc(env(safe-area-inset-bottom,0px) + 10px); display:flex; gap:6px; padding:6px; border-radius:20px; border:2px solid var(--bd2); background:#0a0712; z-index:5; }
.xo-nav button { flex:1; min-height:52px; border:0; border-radius:14px; background:none; color:var(--m); font:700 10px ui-monospace,Menlo,monospace; letter-spacing:.06em; text-transform:uppercase; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; }
.xo-nav button i { font-style:normal; font-size:17px; } .xo-nav button.on { background:#151021; color:var(--t); box-shadow:inset 0 0 0 1.5px var(--b); }
.xo-msg { min-height:1.3em; margin:10px 0 0; text-align:center; color:var(--a); font-size:13.5px; }
</style>
<script>
(function () {
function esc(x) { var d = document.createElement('div'); d.textContent = x == null ? '' : String(x); return d.innerHTML; }
function csrf() { var m = document.querySelector('meta[name="csrf-token"]'); return m ? m.getAttribute('content') : ''; }
function api(m, u, b) { return fetch(u, { method: m, credentials: 'same-origin', headers: { Accept: 'application/json', 'Content-Type': 'application/json', 'X-CSRF-TOKEN': csrf() }, body: b ? JSON.stringify(b) : undefined }).then(function (r) { return r.json().catch(function () { return {}; }).then(function (d) { d.__s = r.status; return d; }); }); }
function code() { var a = new Uint8Array(10), al = 'abcdefghjkmnpqrstuvwxyz23456789', s = ''; (window.crypto || {}).getRandomValues ? crypto.getRandomValues(a) : a.forEach(function (_, i) { a[i] = Math.random() * 256; }); a.forEach(function (x) { s += al[x % al.length]; }); return s; }
function quand(t) { if (!t) return ''; var s = Math.round((Date.now() - Date.parse(t)) / 1000); return s < 3600 ? 'il y a ' + Math.max(1, Math.round(s / 60)) + ' min' : s < 86400 ? 'il y a ' + Math.round(s / 3600) + ' h' : 'il y a ' + Math.round(s / 86400) + ' j'; }
var qrP = null;
function qr(el, txt) {
if (window.jOSQR) { try { window.jOSQR(txt, el, 280); return; } catch (e) {} }
if (!qrP) qrP = new Promise(function (ok, ko) { var s = document.createElement('script'); s.src = '/vendor/js/qrcode-generator.js'; s.onload = function () { ok(window.qrcode); }; s.onerror = ko; document.head.appendChild(s); });
qrP.then(function (lib) { var q = lib(0, 'M'); q.addData(txt); q.make(); el.innerHTML = q.createImgTag(Math.max(4, Math.round(280 / q.getModuleCount())), 0); }).catch(function () { el.textContent = 'QR indisponible : partage le lien'; });
}
function mount(c) {
var vivant = true, tab = 'inviter', E = null, dernier = null;
function charger() { return api('GET', '/px/xeroction/etat').then(function (d) { E = d; }); }
function lien(cd) { return (E && E.nexus ? E.nexus.join : 'https://xerboxion.org/join') + '?inv=' + encodeURIComponent(cd) + '&niv=xeroction'; }
function vueInviter() {
if (E && E.moi && !E.moi.peut_inviter) return '<div class="xo-glyphe">◆</div><h2>Xeroction</h2><p class="sous">Seul un xeroction peut inviter un xeroction. Ton palier : <b>' + esc(E.moi.palier) + '</b>. Regarde l\'onglet « arrivée » pour rejoindre le Nexus.</p>';
return '<div class="xo-glyphe">◆</div><h2>Inviter un xeroction</h2><p class="sous">Un xeroction a son propre boxion et rejoint le Nexus. Un code, un QR : il entre, son compte reçoit le palier xeroction, et son arrivée au Nexus l\'attend.</p>'
+ '<input data-nom placeholder="son nom ou son pseudo (facultatif)" maxlength="60" autocapitalize="words">'
+ '<button class="grand" data-creer>créer l\'invitation</button>'
+ (dernier ? '<div class="xo-qr" data-qr></div><div class="xo-lien">' + esc(lien(dernier)) + '</div><button class="sec" data-partager>partager le lien</button><button class="sec" data-copier>copier</button>' : '')
+ '<p class="xo-msg" data-msg></p>';
}
function vueMiens() {
var l = (E && E.invitations) || [];
return '<h2>Mes xeroctions</h2><p class="sous">' + l.length + ' invitation(s) · ' + l.filter(function (x) { return x.pris_par; }).length + ' acceptée(s).</p>'
+ (l.length ? l.map(function (x) { return '<div class="xo-i' + (x.pris_par ? ' pris' : '') + '"><i>' + (x.pris_par ? '◆' : '◇') + '</i><div><b>' + esc(x.pris_par || x.nom || x.code) + '</b><small>' + (x.pris_par ? 'xeroction depuis ' + quand(x.pris_le) : 'émise ' + quand(x.le) + ' · en attente') + '</small></div>'
+ (x.pris_par ? '' : '<button data-revoir="' + esc(x.code) + '">QR</button>') + '</div>'; }).join('') : '<p class="sous">aucune encore.</p>');
}
function vueArrivee() {
var n = (E && E.nexus) || {}, moi = (E && E.moi) || {};
var etapes = [
{ f: moi.est_xeroction, t: 'Ton compte xeroction', d: moi.est_xeroction ? 'c\'est fait : palier xeroction.' : 'ton palier : ' + esc(moi.palier || '?') + ' — une invitation xeroction le pose.' },
{ t: 'L\'app ploxi0n', d: 'le xerboxion dans la poche, connecté à ton compte.', a: n.app ? '<a href="' + esc(n.app) + '" target="_blank" rel="noopener">rejoindre le TestFlight</a>' : '<p>demande l\'accès à qui t\'a invité.</p>' },
{ t: 'Le RepoVerse (le Nexus)', d: 'là où l\'on contribue : chaque ploxion, chaque bion est un dépôt.', a: '<a href="' + esc(n.repoverse || 'https://git.j0bot.ch/') + '" target="_blank" rel="noopener">ouvrir git.j0bot.ch</a>' },
{ t: 'Ton boxion, relié au Nexus', d: 'sur ta machine (Debian 13+), une ligne : le dépôt du xerboxion, puis le paquet.', a: '<code>' + esc(n.boxion || '') + '</code><button data-copier-boxion>copier</button>' },
];
return '<h2>L\'arrivée au Nexus</h2><p class="sous">Cloudion, c\'est le Nexus en vrai. Quatre pas, et tu y es.</p>'
+ etapes.map(function (e, i) { return '<div class="xo-etape' + (e.f ? ' fait' : '') + '"><span class="n">' + (e.f ? '✓' : i + 1) + '</span><div><b>' + esc(e.t) + '</b><p>' + e.d + '</p>' + (e.a || '') + '</div></div>'; }).join('');
}
function dessiner() {
if (!vivant) return;
c.innerHTML = '<div class="xo">' + (tab === 'inviter' ? vueInviter() : tab === 'miens' ? vueMiens() : vueArrivee())
+ '<nav class="xo-nav">' + [['inviter', '◆', 'inviter'], ['miens', '≡', 'mes xeroctions'], ['arrivee', '⬢', 'arrivée']].map(function (t) { return '<button data-tab="' + t[0] + '" class="' + (tab === t[0] ? 'on' : '') + '"><i>' + t[1] + '</i>' + t[2] + '</button>'; }).join('') + '</nav></div>';
var q = c.querySelector('[data-qr]'); if (q && dernier) qr(q, lien(dernier));
}
function dire(t) { var m = c.querySelector('[data-msg]'); if (m) m.textContent = t; }
c.addEventListener('click', function (e) {
var b = e.target.closest('button'); if (!b) return;
if (b.dataset.tab) { tab = b.dataset.tab; return dessiner(); }
if (b.hasAttribute('data-creer')) {
var cd = code(), nom = (c.querySelector('[data-nom]') || {}).value || ''; b.disabled = true; b.textContent = '…';
return api('POST', '/px/invitation/emit', { code: cd, niv: 'xeroction', name: nom.trim() || null }).then(function (d) {
if (d.ok === false || d.__s >= 400) { b.disabled = false; b.textContent = 'créer l\'invitation'; return dire('⚠ ' + (d.error || d.message || 'refusé')); }
dernier = cd; return charger().then(dessiner);
});
}
if (b.dataset.revoir) { dernier = b.dataset.revoir; tab = 'inviter'; return dessiner(); }
if (b.hasAttribute('data-partager')) { var u = lien(dernier); if (navigator.share) navigator.share({ title: 'Rejoins le xerboxion — xeroction', text: 'Ton invitation xeroction', url: u }).catch(function () {}); else { try { navigator.clipboard.writeText(u); dire('✓ lien copié'); } catch (er) {} } return; }
if (b.hasAttribute('data-copier')) { try { navigator.clipboard.writeText(lien(dernier)).then(function () { b.textContent = '✓ copié'; }); } catch (er) {} return; }
if (b.hasAttribute('data-copier-boxion')) { try { navigator.clipboard.writeText((E.nexus || {}).boxion || '').then(function () { b.textContent = '✓ copié'; }); } catch (er) {} }
});
c.innerHTML = '<div class="xo"><p class="sous">◆ …</p></div>';
charger().then(function () { if (E && E.moi && !E.moi.peut_inviter) tab = 'arrivee'; dessiner(); }).catch(function () { c.innerHTML = '<div class="xo"><p class="sous">⚠ connecte-toi pour ouvrir le ploxion xeroction.</p></div>'; });
return { unmount: function () { vivant = false; c.innerHTML = ''; } };
}
window.jOSApps = window.jOSApps || {};
window.jOSApps['xeroction'] = { manifest: { id: 'xeroction', name: 'Xeroction', icon: '◆' }, mount: mount };
})();
</script>