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

This commit is contained in:
cloudion
2026-11-03 22:41:53 +00:00
parent 723eafc165
commit 9855eaad27
3 changed files with 355 additions and 2 deletions

View File

@@ -1,3 +1,21 @@
# ploxion-glyphed
# ◇ Atelier des glyphes
PLOXION · Dessine à la main le glyphe pixel-art de chaque ploxion, dans un placeholder de losange. Override le glyphe généré partout (favoris/lanceur/fenêtres/dock). window.jGlyph. · fournit: glyph, pixel, art, editor, icon
L'atelier des glyphes du xerboxion : la revue de chaque icône au swipe (✎ à corriger · ♥ bon · ★ parfait), la correction (le glyphe, la couleur, le cœur, le style ; pour toi ou pour tous), et tes propres glyphes (le générateur forme × marque, le dessin au trait). Les icônes de ploxi0n : la forme = le type.
| | |
| --- | --- |
| id | `glyphed` |
| fournit | `glyph` `pixel` `art` `editor` `icon` |
| bions qu'il nomme | `jOSApps` `jOSIcone` `jOSStore` `jOSSwipe` |
| fichiers | `_boutons.blade.php` `app.blade.php` |
| dans le labo | `resources/views/ploxions/glyphed/` (dépôt `my_website2`) |
## Contribuer
- **Dans le xer** : https://labo.j0bot.ch/px/atelier?ploxion=glyphed — prends-le, modifie-le, vois-le tourner, « ⧗ envoyer le tsoin ».
- **Dans VS Code** : `xb prendre glyphed` (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

168
_boutons.blade.php Normal file
View File

@@ -0,0 +1,168 @@
{{-- L'atelier des glyphes · ⌗ boutons (02.11, RS-7 : « il y en a plein c'est des glyphes et c'est incompréhensible, on est obligé de hover pour
savoir ce que c'est, il faudrait travailler ensemble sur des glyphes ui plus précis », puis « donne-moi une page avec tous les boutons qui
existent dans le xer entier pour les propositions »). Chaque bouton du xer, relevé dans un vrai Chromium par bin/inventaire-boutons.mjs
(resources/data/boutons-ui.json, servi par /data/boutons-ui.json) : tel qu'il s'affiche, son nom, sa zone, son action ; trois glyphes
proposés, « le mot » (son nom écrit au lieu d'un glyphe), « garder », ou le tien. Plus une question pour tout le bureau : écrire le nom à
côté du glyphe quand il y a la place. Les choix vont dans jOSStore('glyphes-ui') (ton boxion) : xerxion les lit et les applique.
window.jOSGlyphedBoutons.monter(hote) → {stop}. Les SVG relevés sont nettoyés (liste blanche d'éléments et d'attributs) avant affichage. --}}
<style>
.gab{ display:flex; flex-direction:column; gap:10px; padding-bottom:10px; }
.gab__tete{ display:flex; flex-wrap:wrap; align-items:baseline; gap:8px; font-size:13px; } .gab__tete b{ font-size:15px; } .gab__tete span{ color:var(--m,#7f7699); }
.gab__glob{ border:1.5px solid var(--bd2,#3a3050); border-radius:14px; padding:10px 12px; display:flex; flex-direction:column; gap:8px; font-size:13px; }
.gab__glob p{ margin:0; color:var(--t,#ddd6ea); }
.gab__ch{ display:flex; flex-wrap:wrap; gap:6px; }
.gab__c{ cursor:pointer; min-height:34px; padding:4px 11px; border-radius:999px; border:1.5px solid var(--bd2,#3a3050); background:transparent; color:var(--t,#ddd6ea); font:600 12px ui-sans-serif,system-ui; }
.gab__c.on{ border-color:var(--b,#79d9a2); color:#08110b; background:var(--b,#79d9a2); }
.gab__c i{ font-style:normal; opacity:.65; margin-left:5px; }
.gab__f{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.gab__f input{ flex:1 1 160px; min-height:36px; border-radius:10px; border:1.5px solid var(--bd2,#3a3050); background:#0a0712; color:var(--t,#ddd6ea); padding:6px 10px; font:14px ui-sans-serif,system-ui; }
.gab__b{ display:grid; grid-template-columns:52px minmax(0,1fr); gap:6px 12px; padding:10px 4px; border-bottom:1px solid var(--bd,#272036); }
.gab__now{ grid-row:span 2; width:52px; height:52px; border-radius:12px; border:1.5px solid var(--bd2,#3a3050); display:flex; align-items:center; justify-content:center; font:20px ui-sans-serif,system-ui; color:var(--t,#ddd6ea); overflow:hidden; background:#0a0712; }
.gab__now svg{ width:30px; height:30px; } .gab__now small{ font-size:10px; text-align:center; line-height:1.1; padding:2px; }
.gab__q b{ font-size:14px; display:block; overflow-wrap:anywhere; } .gab__q small{ color:var(--m,#7f7699); font-size:11px; }
.gab__q small.cache{ color:#c99; }
.gab__p{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.gab__g{ cursor:pointer; min-width:42px; min-height:40px; padding:2px 10px; border-radius:11px; border:1.5px solid var(--bd2,#3a3050); background:transparent; color:var(--t,#ddd6ea); font:20px ui-sans-serif,system-ui; }
.gab__g.mot{ font:600 12px ui-sans-serif,system-ui; } .gab__g.on{ border-color:var(--b,#79d9a2); box-shadow:inset 0 0 0 1.5px var(--b,#79d9a2); color:#fff; }
.gab__g input{ width:2.2em; border:0; background:transparent; color:inherit; font:inherit; text-align:center; outline:none; }
.gab__plus{ text-align:center; } .gab__vide{ padding:30px 10px; text-align:center; color:var(--m,#7f7699); }
</style>
<script>
(function () {
'use strict';
if (window.jOSGlyphedBoutons) return;
// l'état de l'onglet survit à un nouveau rendu de l'atelier (il redessine tout à chaque geste)
var ETAT = { zone: "la barre d'une fenêtre", visibles: true, restants: false, q: '', max: 80 }, DONNEES = null;
var ZONES_D_ABORD = ["la barre d'une fenêtre", 'le dock', 'le haut du bureau', 'les réglages', 'le HUD téléphone', 'les onglets d\'une fenêtre'];
function esc(s) { return String(s == null ? '' : s).replace(/[&<>"']/g, function (c) { return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]; }); }
function cle(b) { return b.zone + '|' + (b.nom || b.texte); }
// trois glyphes proposés selon ce que fait le bouton (des glyphes sans variante emoji : ils restent des glyphes sur iPhone aussi)
var PROPOS = [
[/fermer|close/, ['✕', '⊗', '⊠']], [/réduire|minimi/, ['–', '⌄', '▁']], [/plein écran|full/, ['⤢', '▣', '⊡']],
[/tiling plein|tilefull/, ['▦', '▩', '⊟']], [/tiling|grille|\btile\b/, ['⊞', '▤', '⊟']], [/gauche|\bleft\b/, ['◧', '⇤', '▌']], [/droite|\bright\b/, ['◨', '⇥', '▐']],
[/nouvelle instance|\bdup\b|dupliquer/, ['⧉', '⊕', '⊔']], [/picture|\bpip\b/, ['◳', '⧈', '▣']], [/recharger|reload|actualiser/, ['⟳', '↻', '↺']],
[/analyser|analyse/, ['⌕', '⊙', '∴']], [/forger|forge/, ['⟐', '◈', '✠']], [/son temps|\btemps\b|tsoin/, ['⧗', '◷', '⧖']], [/chat|envoyer|message/, ['⇢', '✎', '▷']],
[/knob|tourner/, ['◔', '⊚', '◑']], [/widget|xerbion/, ['⬢', '▣', '⬡']], [/backend|frontend|plugion/, ['⌗', '⟨⟩', '⇅']], [/upgrade|mettre à jour/, ['⇪', '↥', '⤊']],
[/braindump|extrapol/, ['✎', '⤳', '∿']], [/connexion/, ['⋈', '⟷', '∞']], [/tout voir/, ['⊹', '◎', '⊙']], [/organiser|région/, ['⊞', '▤', '⊟']],
[/lanceur|launchpad|carte \/ lanceur/, ['⁂', '▦', '⊞']], [/xerkion/, ['⬡', '⬢', '⏣']], [/bureau seul|masquer la carte/, ['▭', '◻', '▢']],
[/mode ui|iphone|android|finch/, ['◫', '▯', '⇋']], [/xerminal|terminal/, ['›_', '⟩', '▸']], [/curseur|manette/, ['⌖', '➚', '✥']], [/\bmenu\b/, ['☰', '≡', '⋯']],
[/^ploxions$|ploxions\b/, ['◇', '◈', '⬦']], [/thème|identité|palette/, ['◐', '◑', '◒']], [/journal|quêtes/, ['☷', '≣', '⚑']], [/réglages|paramètres/, ['⛭', '⊛', '≚']],
[/tes xers|changer de xer|\bxers\b/, ['⇄', '✥', '⟲']], [/apparence/, ['◐', '◍', '✧']], [/^xer$/, ['◇', '⬦', '◈']], [/chrome/, ['▭', '▔', '⎕']], [/^bureau$/, ['▢', '⌂', '▦']],
[/^dock$|dock,/, ['▁', '⎽', '▂']], [/^jeu$/, ['◆', '✦', '⬥']], [/compte|profil/, ['◯', '⍝', '◉']], [/install/, ['⤓', '⊕', '⇩']], [/données/, ['⛁', '▤', '≣']],
[/mobile|téléphone/, ['▯', '▮', '⎕']], [/^son$|sons|musique/, ['♪', '♫', '∿']], [/aide/, ['?', '⍰', '¿']], [/fond/, ['▨', '▧', '▩']], [/icônes|glyphe/, ['△', '◇', '⬦']],
[/peau/, ['◍', '◌', '○']], [/monde/, ['◎', '⊕', '○']], [/époque/, ['◧', '⧗', '◷']], [/défaire|annuler/, ['↶', '↺', '⟲']], [/dossier/, ['⌂', '▱', '⊟']],
[/densité/, ['≡', '☰', '⋮']], [/mouvement|animation/, ['∿', '≋', '⤳']], [/police|taille/, ['Aa', 'ᴀ', 'A⁺']], [/clair|sombre/, ['◐', '◑', '☾']],
[/export/, ['⤓', '⇩', '↧']], [/import/, ['⤒', '⇧', '↥']], [/purger|vider|supprimer/, ['⌫', '✕', '⊘']], [/connecter|connexion/, ['⇥', '→', '⊸']],
[/zoom/, ['⊕', '⤢', '⊖']], [/recherch|chercher|filtrer/, ['⌕', '⊙', '◎']], [/aperçu/, ['◎', '⊙', '◉']], [/secours/, ['✚', '⊕', '◬']], [/actions/, ['▸', '⇉', '↯']],
[/renommer/, ['✎', '✐', 'Aa']], [/garder|sauver|enregistrer/, ['✓', '⤓', '◉']], [/réinitialiser|défaut|revenir/, ['↺', '⟲', '◌']], [/partag/, ['↗', '⇪', '⤴']],
[/succès/, ['★', '✦', '◆']], [/règles|quand/, ['⌁', '⇒', '≔']], [/sélecteur/, ['⇄', '⧉', '⊟']], [/éléments/, ['▦', '⊞', '⁘']], [/hud/, ['⌗', '▤', '⊡']]
];
function propositions(b) {
var t = ((b.nom || '') + ' ' + (b.texte || '') + ' ' + (b.act || '')).toLowerCase(), out = [];
for (var i = 0; i < PROPOS.length && out.length < 3; i++) if (PROPOS[i][0].test(t)) PROPOS[i][1].forEach(function (g) { if (out.length < 3 && out.indexOf(g) < 0 && g !== b.glyphe) out.push(g); });
['◇', '○', '▸'].forEach(function (g) { if (out.length < 3 && out.indexOf(g) < 0 && g !== b.glyphe) out.push(g); });
return out;
}
// le SVG relevé, nettoyé : seulement des formes et leurs attributs de dessin (jamais de script, de lien, d'événement, de style)
var EL_OK = /^(svg|g|path|circle|ellipse|line|polyline|polygon|rect|text|tspan|title|defs|lineargradient|radialgradient|stop|clippath|mask)$/i;
var AT_OK = /^(viewbox|width|height|d|cx|cy|r|rx|ry|x|y|x1|y1|x2|y2|points|fill|stroke|stroke-width|stroke-linecap|stroke-linejoin|stroke-dasharray|stroke-miterlimit|opacity|fill-opacity|stroke-opacity|transform|font-size|font-weight|text-anchor|dominant-baseline|fill-rule|clip-rule|offset|stop-color|stop-opacity|gradientunits|x1|id|clip-path|mask|vector-effect|xmlns|preserveaspectratio)$/i;
function svgSur(src) {
try {
var doc = new DOMParser().parseFromString(src, 'image/svg+xml'), r = doc.documentElement;
if (!r || r.nodeName.toLowerCase() !== 'svg' || doc.getElementsByTagName('parsererror').length) return '';
(function net(n) {
Array.prototype.slice.call(n.children).forEach(function (k) { if (!EL_OK.test(k.nodeName)) { k.parentNode.removeChild(k); return; } net(k); });
Array.prototype.slice.call(n.attributes).forEach(function (a) { var v = String(a.value || ''); if (!AT_OK.test(a.name) || /javascript:|url\(\s*['"]?\s*[a-z]+:/i.test(v)) n.removeAttribute(a.name); });
})(r);
r.removeAttribute('width'); r.removeAttribute('height');
return new XMLSerializer().serializeToString(r);
} catch (e) { return ''; }
}
function store() { try { return window.jOSStore ? window.jOSStore('glyphes-ui') : null; } catch (e) { return null; } }
function choixDe(S, k) { var x = S && S.get(k); return x ? x.choix : null; }
function choisir(S, b, choix) {
if (!S) return; var k = cle(b), x = S.get(k);
var v = { id: k, choix: choix, nom: b.nom || b.texte, zone: b.zone, avant: b.glyphe || (b.svg ? 'svg' : ''), act: b.act || '', m: Date.now() };
if (x && x.choix === choix) S.remove(k); else if (x) S.set(k, v); else S.add(v);
}
function monter(hote) {
if (!hote) return { stop: function () {} };
var vivant = true, S = store(), off = null;
hote.innerHTML = '<div class="gab__vide">◌ les boutons du xer se chargent…</div>';
var p = DONNEES ? Promise.resolve(DONNEES) : fetch('/data/boutons-ui.json', { credentials: 'same-origin', headers: { Accept: 'application/json' } }).then(function (r) { if (!r.ok) throw new Error(r.status); return r.json(); }).then(function (d) { DONNEES = d; return d; });
p.then(function () { if (vivant) rendre(); }, function () { if (vivant) hote.innerHTML = '<div class="gab__vide">△ le relevé des boutons ne répond pas</div>'; });
if (S && S.on) off = S.on(function () { if (vivant && DONNEES) majChoix(); });
function liste() {
var B = DONNEES.boutons || [], q = ETAT.q.trim().toLowerCase();
return B.filter(function (b) {
if (ETAT.zone !== '*' && (ETAT.zone === 'autres' ? ZONES_D_ABORD.indexOf(b.zone) >= 0 : b.zone !== ETAT.zone)) return false;
if (ETAT.visibles && !b.visible) return false;
if (ETAT.restants && choixDe(S, cle(b))) return false;
if (q && ((b.nom || '') + ' ' + (b.texte || '') + ' ' + b.zone + ' ' + (b.act || '')).toLowerCase().indexOf(q) < 0) return false;
return true;
});
}
function nbChoix() { return S ? S.all().filter(function (x) { return x && x.id !== '_bureau'; }).length : 0; }
function ligne(b) {
var k = cle(b), ch = choixDe(S, k), now = b.svg ? svgSur(b.svg) : '';
var PAST = { close: '#ff5f57', min: '#febc2e', full: '#28c840' }; // les trois pastilles de la barre : des ronds de couleur, sans glyphe
if (!now && PAST[b.act]) now = '<span style="width:16px;height:16px;border-radius:50%;background:' + PAST[b.act] + '"></span>';
if (!now) now = b.glyphe ? esc(b.glyphe) : '<small>' + esc((b.texte || '—').slice(0, 18)) + '</small>';
var props = propositions(b), perso = ch && ch.indexOf('g:') === 0 && props.indexOf(ch.slice(2)) < 0 ? ch.slice(2) : '';
return '<div class="gab__b" data-gk="' + esc(k) + '"><div class="gab__now" title="tel qu\'il s\'affiche aujourd\'hui">' + now + '</div>'
+ '<div class="gab__q"><b>' + esc(b.nom || b.texte || '(sans nom)') + '</b><small' + (b.visible ? '' : ' class="cache"') + '>' + esc(b.zone + (b.act ? ' · ' + b.act : '') + (b.n > 1 ? ' · ×' + b.n : '') + (b.visible ? '' : ' · caché au relevé')) + '</small></div>'
+ '<div class="gab__p" role="group" aria-label="choisir pour ' + esc(b.nom || b.texte) + '">'
+ props.map(function (g) { return '<button type="button" class="gab__g' + (ch === 'g:' + g ? ' on' : '') + '" data-gc="g:' + esc(g) + '" aria-pressed="' + (ch === 'g:' + g) + '" aria-label="glyphe ' + esc(g) + '">' + esc(g) + '</button>'; }).join('')
+ '<button type="button" class="gab__g mot' + (ch === 'mot' ? ' on' : '') + '" data-gc="mot" aria-pressed="' + (ch === 'mot') + '" title="écrire son nom au lieu d\'un glyphe">le mot</button>'
+ '<button type="button" class="gab__g mot' + (ch === 'garder' ? ' on' : '') + '" data-gc="garder" aria-pressed="' + (ch === 'garder') + '">garder</button>'
+ '<label class="gab__g' + (perso ? ' on' : '') + '" title="ton glyphe">✎<input data-gperso maxlength="3" value="' + esc(perso) + '" aria-label="ton glyphe pour ' + esc(b.nom || b.texte) + '"></label>'
+ '</div></div>';
}
function rendre() {
var B = DONNEES.boutons || [], zones = {}, l = liste();
B.forEach(function (b) { if (!ETAT.visibles || b.visible) zones[b.zone] = (zones[b.zone] || 0) + 1; });
var autres = Object.keys(zones).filter(function (z) { return ZONES_D_ABORD.indexOf(z) < 0; }).reduce(function (s, z) { return s + zones[z]; }, 0);
var glob = (S && S.get('_bureau')) || {};
hote.innerHTML = '<div class="gab"><div class="gab__tete"><b>⌗ ' + B.length + ' boutons dans le xer</b><span data-gnb>' + nbChoix() + ' choisis · relevé le ' + esc(String(DONNEES.releve || '').slice(0, 10)) + '</span></div>'
+ '<div class="gab__glob"><p>Sur le bureau, à côté de chaque glyphe :</p><div class="gab__ch">' + [['nom', 'son nom, quand il y a la place'], ['survol', 'rien, le nom au survol (comme maintenant)'], ['nom-barre', 'son nom seulement dans la barre des fenêtres']].map(function (x) { return '<button type="button" class="gab__c' + (glob.choix === x[0] ? ' on' : '') + '" data-gglob="' + x[0] + '" aria-pressed="' + (glob.choix === x[0]) + '">' + esc(x[1]) + '</button>'; }).join('') + '</div></div>'
+ '<div class="gab__ch" role="toolbar" aria-label="zones">' + ZONES_D_ABORD.filter(function (z) { return zones[z]; }).concat(autres ? ['autres'] : []).concat(['*']).map(function (z) { var n = z === '*' ? Object.keys(zones).reduce(function (s, k) { return s + zones[k]; }, 0) : z === 'autres' ? autres : zones[z]; return '<button type="button" class="gab__c' + (ETAT.zone === z ? ' on' : '') + '" data-gz="' + esc(z) + '">' + esc(z === '*' ? 'tout' : z) + '<i>' + n + '</i></button>'; }).join('') + '</div>'
+ '<div class="gab__f"><input data-gq type="search" placeholder="chercher un bouton (nom, zone, action)…" value="' + esc(ETAT.q) + '" aria-label="chercher un bouton">'
+ '<button type="button" class="gab__c' + (ETAT.visibles ? ' on' : '') + '" data-gvis aria-pressed="' + ETAT.visibles + '">visibles</button><button type="button" class="gab__c' + (ETAT.restants ? ' on' : '') + '" data-grest aria-pressed="' + ETAT.restants + '">pas encore choisis</button></div>'
+ '<div data-gl>' + (l.slice(0, ETAT.max).map(ligne).join('') || '<div class="gab__vide">rien ici</div>') + '</div>'
+ (l.length > ETAT.max ? '<div class="gab__plus"><button type="button" class="gab__c" data-gplus>+ ' + (l.length - ETAT.max) + ' de plus</button></div>' : '') + '</div>';
}
function majChoix() {
var nb = hote.querySelector('[data-gnb]'); if (nb) nb.textContent = nbChoix() + ' choisis · relevé le ' + String(DONNEES.releve || '').slice(0, 10);
hote.querySelectorAll('[data-gk]').forEach(function (el) {
var ch = choixDe(S, el.getAttribute('data-gk'));
el.querySelectorAll('[data-gc]').forEach(function (g) { var on = g.getAttribute('data-gc') === ch; g.classList.toggle('on', on); g.setAttribute('aria-pressed', on); });
var inp = el.querySelector('[data-gperso]'), perso = ch && ch.indexOf('g:') === 0 && !el.querySelector('[data-gc="' + ch.replace(/"/g, '') + '"]') ? ch.slice(2) : '';
if (inp && document.activeElement !== inp) inp.value = perso; if (inp) inp.parentNode.classList.toggle('on', !!perso);
});
var glob = (S && S.get('_bureau')) || {};
hote.querySelectorAll('[data-gglob]').forEach(function (g) { var on = g.getAttribute('data-gglob') === glob.choix; g.classList.toggle('on', on); g.setAttribute('aria-pressed', on); });
}
function bouton(k) { var B = DONNEES.boutons || []; for (var i = 0; i < B.length; i++) if (cle(B[i]) === k) return B[i]; return null; }
hote.addEventListener('click', function (e) {
var t = e.target.closest('button'); if (!t || !DONNEES) return;
if (t.hasAttribute('data-gz')) { ETAT.zone = t.getAttribute('data-gz'); ETAT.max = 80; return rendre(); }
if (t.hasAttribute('data-gvis')) { ETAT.visibles = !ETAT.visibles; return rendre(); }
if (t.hasAttribute('data-grest')) { ETAT.restants = !ETAT.restants; return rendre(); }
if (t.hasAttribute('data-gplus')) { ETAT.max += 120; return rendre(); }
if (t.hasAttribute('data-gglob') && S) { var g = t.getAttribute('data-gglob'), x = S.get('_bureau'); if (x && x.choix === g) S.remove('_bureau'); else if (x) S.set('_bureau', { choix: g, m: Date.now() }); else S.add({ id: '_bureau', choix: g, m: Date.now() }); return majChoix(); }
var r = t.closest('[data-gk]'); if (r && t.hasAttribute('data-gc')) { var b = bouton(r.getAttribute('data-gk')); if (b) { choisir(S, b, t.getAttribute('data-gc')); majChoix(); if (ETAT.restants) setTimeout(rendre, 400); } }
});
hote.addEventListener('change', function (e) {
var inp = e.target.closest('[data-gperso]'); if (!inp) return; var r = inp.closest('[data-gk]'), b = r && bouton(r.getAttribute('data-gk')), v = inp.value.trim();
if (!b || !S) return; var k = cle(b), x = S.get(k);
if (!v) { if (x && x.choix.indexOf('g:') === 0) S.remove(k); return majChoix(); }
choisir(S, b, 'g:' + v); if (S.get(k) == null) choisir(S, b, 'g:' + v); majChoix();
});
var qT = 0; hote.addEventListener('input', function (e) { if (!e.target.matches('[data-gq]')) return; ETAT.q = e.target.value; clearTimeout(qT); qT = setTimeout(function () { var pos = e.target.selectionStart; rendre(); var n = hote.querySelector('[data-gq]'); if (n) { n.focus(); try { n.setSelectionRange(pos, pos); } catch (x) {} } }, 200); });
return { stop: function () { vivant = false; try { if (off) off(); } catch (e) {} } };
}
window.jOSGlyphedBoutons = { monter: monter, propositions: propositions, svgSur: svgSur, cle: cle };
})();
</script>

167
app.blade.php Normal file
View File

@@ -0,0 +1,167 @@
{{-- PL0XI0N glyphed — L'ATELIER DES GLYPHES (19.10.2026, RS-7 : « un ploxion pour checker les glyphes de chacun et pouvoir les modifier, et
aussi pouvoir ajouter mes propres glyphes, donc un générateur de glyphes et un truc à la joswipe pour confirmer les glyphes et modifier ceux
que je trouve pas corrects »). Remplace l'éditeur pixel-art de l'ancien losange (même id : une seule porte vers les glyphes des ploxions).
Les icônes viennent de ploxi0n (window.jOSIcone : la forme = le type, la couleur = la catégorie, le glyphe = ce qu'il fait).
◇ revue : jOSSwipe — ← ✎ à corriger · → ♥ bon · ↑ ★ parfait (POST /px/icones/avis)
✎ corriger : le glyphe (la bibliothèque + les tiens), la couleur (6 palettes), le cœur, le style ; pour toi, ou pour tous (un admin :
ça part aussi dans le registre, que ploxi0n lit) — PUT /px/icones/{id}
✦ créer : le générateur (forme × marque) et le dessin au trait sur la grille → POST /px/glyphes (reconstruit côté serveur)
Chill-tekk : sombre, usé, sans dégradé, les onglets en bas, au pouce. Peu de texte : des glyphes. window.jOSApps['glyphed']. --}}
@include('ploxions.glyphed._boutons')
<style>
.gat{ --a:#a597cf; --b:#79d9a2; --t:#ddd6ea; --m:#7f7699; --bd:#272036; --bd2:#3a3050; --s:#0f0b18; display:flex; flex-direction:column; height:100%; min-height:0; background:#07050c; color:var(--t); font-family:-apple-system,system-ui,sans-serif; font-size:14px; }
.gat *{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
.gat__h{ flex:0 0 auto; display:flex; align-items:baseline; gap:10px; padding:12px 14px 6px; } .gat__h b{ font:800 15px ui-monospace,Menlo,monospace; letter-spacing:.08em; } .gat__h span{ font:600 11px ui-monospace,Menlo,monospace; color:var(--m); }
.gat__corps{ flex:1; min-height:0; overflow:auto; padding:6px 14px 10px; }
.gat__nav{ flex:0 0 auto; display:flex; gap:5px; margin:0 12px calc(env(safe-area-inset-bottom,0px) + 10px); padding:6px; border-radius:20px; border:2px solid var(--bd2); background:#0a0712; }
.gat__nav button{ flex:1; min-height:52px; border:0; border-radius:14px; background:none; color:var(--m); font:700 9px ui-monospace,Menlo,monospace; text-transform:uppercase; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; cursor:pointer; }
.gat__nav button i{ font-style:normal; font-size:18px; } .gat__nav button.on{ background:#151021; color:var(--t); box-shadow:inset 0 0 0 1.5px var(--b); }
.gat__carte{ display:flex; flex-direction:column; align-items:center; gap:8px; padding:18px 10px; } .gat__carte .ic{ width:min(52vw,190px); height:min(52vw,190px); } .gat__carte .ic svg{ width:100%; height:100%; }
.gat__carte b{ font-size:18px; } .gat__carte small{ font:600 11px ui-monospace,Menlo,monospace; color:var(--m); }
.gat__bt{ min-height:44px; padding:8px 14px; border-radius:14px; border:2px solid var(--bd2); background:#0f0b18; color:var(--t); font:700 12px ui-monospace,Menlo,monospace; cursor:pointer; }
.gat__bt.go{ border-color:var(--b); } .gat__bt.on{ border-color:var(--b); color:var(--b); } .gat__bt[disabled]{ opacity:.4; }
.gat__rang{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:8px 0; }
.gat__lab{ font:700 10px ui-monospace,Menlo,monospace; text-transform:uppercase; letter-spacing:.12em; color:var(--m); margin:12px 0 6px; }
.gat__q{ width:100%; min-height:42px; padding:8px 12px; border-radius:12px; border:2px solid var(--bd2); background:#0f0b18; color:var(--t); font:inherit; }
.gat__liste{ display:grid; grid-template-columns:repeat(auto-fill,minmax(78px,1fr)); gap:6px; }
.gat__px{ display:flex; flex-direction:column; align-items:center; gap:4px; padding:8px 4px; border-radius:14px; border:2px solid var(--bd); background:var(--s); color:var(--t); cursor:pointer; font:600 10px ui-monospace,Menlo,monospace; min-height:86px; }
.gat__px .ic{ width:46px; height:46px; } .gat__px .ic svg{ width:100%; height:100%; } .gat__px.on{ border-color:var(--b); } .gat__px.corr{ border-color:#ef6f8e; } .gat__px span{ max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.gat__ed{ display:grid; grid-template-columns:minmax(0,180px) minmax(0,1fr); gap:14px; align-items:start; } @media (max-width:560px){ .gat__ed{ grid-template-columns:1fr; } }
.gat__apercu{ display:flex; gap:10px; justify-content:center; } .gat__apercu div{ width:84px; height:84px; } .gat__apercu svg{ width:100%; height:100%; }
.gat__gl{ display:grid; grid-template-columns:repeat(auto-fill,minmax(44px,1fr)); gap:5px; max-height:220px; overflow:auto; }
.gat__gl button{ aspect-ratio:1; border-radius:12px; border:2px solid var(--bd); background:#0f0b18; color:var(--t); padding:7px; cursor:pointer; } .gat__gl button.on{ border-color:var(--b); color:var(--b); }
.gat__gl button svg{ width:100%; height:100%; fill:none; stroke:currentColor; stroke-width:7; stroke-linecap:round; stroke-linejoin:round; } .gat__gl button.perso{ border-style:dashed; }
.gat__gl button svg .f{ fill:currentColor; stroke:none; } .gat__gl button svg .p{ stroke-dasharray:7 7; stroke-width:4.5; }
.gat__pal{ width:40px; height:40px; border-radius:12px; border:2px solid var(--bd); cursor:pointer; } .gat__pal.on{ border-color:var(--t); }
.gat__grille{ width:min(78vw,300px); aspect-ratio:1; touch-action:none; border-radius:16px; border:2px solid var(--bd2); background:#0f0b18; display:block; margin:0 auto; }
.gat__grille .pt{ fill:#3a3050; } .gat__grille .pt.on{ fill:var(--b); } .gat__grille .tr{ fill:none; stroke:var(--t); stroke-width:7; stroke-linecap:round; stroke-linejoin:round; }
.gat__msg{ font:600 11px ui-monospace,Menlo,monospace; color:var(--b); min-height:16px; margin-top:6px; }
.gat__vide{ padding:30px 10px; text-align:center; color:var(--m); font:600 12px ui-monospace,Menlo,monospace; }
</style>
<script>
(function () {
'use strict';
var ID = 'glyphed';
function esc(s) { return window.jOSb.esc(s); }
function csrf() { var m = document.querySelector('meta[name=csrf-token]'); return m ? m.content : ''; }
function api(url, methode, corps) {
return fetch(url, { method: methode || 'GET', credentials: 'same-origin', headers: { Accept: 'application/json', 'Content-Type': 'application/json', 'X-CSRF-TOKEN': csrf(), 'X-Requested-With': 'XMLHttpRequest' }, body: corps ? JSON.stringify(corps) : undefined })
.then(function (r) { return r.json().catch(function () { return {}; }).then(function (d) { if (!r.ok) throw new Error(d.message || ('erreur ' + r.status)); return d; }); });
}
function I() { return window.jOSIcone && window.jOSIcone.px ? window.jOSIcone : null; } // nommé « jOSIcone.px » : la page /px inclut le partial des icônes
function pxs() { return (window.__PLOXIONS__ || []).filter(function (p) { return p && p.id && !p.admin; }); }
function inner(svg) { var m = /^<svg[^>]*>([\s\S]*)<\/svg>$/.exec(String(svg || '').trim()); return m ? m[1] : ''; }
function gly(nom) { var g = I() && I().GLYPHES[nom]; return '<svg viewBox="0 0 100 100" aria-hidden="true">' + (g || '') + '</svg>'; }
function mount(c, ctx) {
var gab = null, vivant = true, onglet = (ctx && ctx.params && ctx.params.onglet === 'boutons') || /[?&]onglet=boutons/.test(location.search) ? 'boutons' : 'revue', sel = null, q = '', brouillon = null, swipe = null, msg = '', gen = 0, trait = [], depart = null, outil = 'trait';
if (!I()) { c.innerHTML = '<div class="gat"><div class="gat__vide">◌ les icônes du xerboxion ne sont pas chargées</div></div>'; return { unmount: function () { c.innerHTML = ''; } }; }
function ico() { return I().icones(); }
function specDe(id) { var t = ico().tous[id] || {}, m = ico().mien[id] || {}; var o = {}; [t, m].forEach(function (x) { for (var k in x) o[k] = x[k]; }); return o; }
function rendu(id, sp, style, taille) { return I().px(id, { fond: true, perso: Object.assign({}, sp || {}, style ? { style: style } : {}), size: taille }); }
function aCorriger() { var a = ico().avis || {}; return Object.keys(a).filter(function (k) { return a[k] === 'corriger'; }); }
function dessiner() {
if (!vivant) return;
var tot = pxs().length, vus = Object.keys(ico().avis || {}).length;
c.innerHTML = '<div class="gat"><div class="gat__h"><b>◇ glyphes</b><span>' + vus + ' / ' + tot + ' revus · ✎ ' + aCorriger().length + '</span></div><div class="gat__corps" data-corps>'
+ (onglet === 'revue' ? '<div data-deck></div>' : onglet === 'corriger' ? vueCorriger() : onglet === 'boutons' ? '<div data-gab></div>' : vueCreer()) + '</div>'
+ '<nav class="gat__nav">' + [['revue', '◇', 'revue'], ['corriger', '✎', 'corriger'], ['creer', '✦', 'créer'], ['boutons', '⌗', 'boutons']].map(function (t) { return '<button data-onglet="' + t[0] + '"' + (onglet === t[0] ? ' class="on"' : '') + '><i>' + t[1] + '</i>' + t[2] + '</button>'; }).join('') + '</nav></div>';
try { if (gab) gab.stop(); } catch (e) {} gab = null;
if (onglet === 'boutons' && window.jOSGlyphedBoutons) gab = window.jOSGlyphedBoutons.monter(c.querySelector('[data-gab]')); // (02.11) ⌗ les boutons du xer
if (onglet === 'revue') monterRevue();
if (onglet === 'creer') majGrille();
}
/* ── ◇ revue : le deck (jOSSwipe), les ploxions pas encore revus ── */
function monterRevue() {
var hote = c.querySelector('[data-deck]'); if (!hote) return;
if (!window.jOSSwipe) { hote.innerHTML = '<div class="gat__vide">◌ jOSSwipe manquant</div>'; return; }
var a = ico().avis || {}, items = pxs().filter(function (p) { return !a[p.id]; }).slice(0, 80).map(function (p) {
return { id: p.id, render: function (el) { var s = I().spec ? I().spec({ id: p.id, nom: p.name }) : {}; el.innerHTML = '<div class="gat__carte"><div class="ic">' + rendu(p.id, specDe(p.id)) + '</div><b>' + esc(p.name) + '</b><small>' + esc((s && s.type) || '') + ' · ' + esc((specDe(p.id).glyphe) || (s && s.glyphe) || '') + '</small></div>'; } }; });
if (!items.length) { hote.innerHTML = '<div class="gat__vide">✓ tout est revu · ✎ ' + aCorriger().length + ' à corriger</div>'; return; }
try { if (swipe && swipe.destroy) swipe.destroy(); } catch (e) {}
swipe = window.jOSSwipe.mount(hote, {
items: items, persistNs: 'glyphes-revue', persistKeyOf: function (it) { return 'gr:' + it.id; },
verdicts: [{ key: 'corriger', label: '✎', dir: 'left', color: '#ef6f8e' }, { key: 'bon', label: '♥', dir: 'right', color: '#79d9a2' }, { key: 'parfait', label: '★', dir: 'up', color: '#f0d36c' }],
title: '◇', hint: '← ✎ · → ♥ · ↑ ★',
onVerdict: function (it, v) { ico().avis[it.id] = v; api('/px/icones/avis', 'POST', { ploxion: it.id, avis: v }).catch(function () {}); var h = c.querySelector('.gat__h span'); if (h) h.textContent = Object.keys(ico().avis).length + ' / ' + pxs().length + ' revus · ✎ ' + aCorriger().length; }
});
}
/* ── ✎ corriger ── */
function vueCorriger() {
var corr = aCorriger(), qq = q.trim().toLowerCase();
var liste = qq ? pxs().filter(function (p) { return (p.id + ' ' + p.name).toLowerCase().indexOf(qq) >= 0; }).slice(0, 40) : corr.map(function (id) { return pxs().filter(function (p) { return p.id === id; })[0]; }).filter(Boolean);
var h = '<input class="gat__q" data-q placeholder="⌕ un ploxion" value="' + esc(q) + '">'
+ '<div class="gat__lab">' + (qq ? '⌕ ' + liste.length : '✎ à corriger · ' + liste.length) + '</div>'
+ (liste.length ? '<div class="gat__liste">' + liste.map(function (p) { return '<button class="gat__px' + (sel === p.id ? ' on' : '') + (corr.indexOf(p.id) >= 0 ? ' corr' : '') + '" data-sel="' + esc(p.id) + '"><span class="ic">' + rendu(p.id, specDe(p.id)) + '</span><span>' + esc(p.name) + '</span></button>'; }).join('') + '</div>' : '<div class="gat__vide">' + (qq ? '∅' : '◇ revue : ← pour en mettre ici') + '</div>');
if (sel) h += editeur();
return h;
}
function editeur() {
var p = pxs().filter(function (x) { return x.id === sel; })[0] || { id: sel, name: sel }, b = brouillon || (brouillon = specDe(sel)), base = I().spec ? I().spec({ id: p.id, nom: p.name }) : {};
var noms = Object.keys(I().GLYPHES).filter(function (n) { return !/^(fermer|retour|minimiser|basculer|chercher|plus|moins|valider)$/.test(n); });
var perso = noms.filter(function (n) { return /^g-/.test(n); });
var ad = !!ico().admin;
return '<div class="gat__lab">✎ ' + esc(p.name) + '</div><div class="gat__ed"><div><div class="gat__apercu"><div>' + rendu(p.id, b, 'xerboxion') + '</div><div>' + rendu(p.id, b, 'glyphe') + '</div></div>'
+ '<div class="gat__rang" style="justify-content:center"><button class="gat__bt go" data-poser="moi">✓ moi</button>' + (ad ? '<button class="gat__bt go" data-poser="tous">✓ tous</button>' : '') + '<button class="gat__bt" data-defaut>↺</button></div><div class="gat__msg" data-msg>' + esc(msg) + '</div></div><div>'
+ '<div class="gat__lab" style="margin-top:0">glyphe · ' + esc(b.glyphe || base.glyphe || '') + '</div><div class="gat__gl">' + perso.concat(noms.filter(function (n) { return perso.indexOf(n) < 0; })).map(function (n) { return '<button data-gl="' + esc(n) + '" title="' + esc(n) + '" class="' + ((b.glyphe || base.glyphe) === n ? 'on ' : '') + (/^g-/.test(n) ? 'perso' : '') + '">' + gly(n) + '</button>'; }).join('') + '</div>'
+ '<div class="gat__lab">couleur</div><div class="gat__rang">' + I().GPAL.map(function (P, i) { var on = (b.pal != null ? +b.pal : base.pal) === i; return '<button class="gat__pal' + (on ? ' on' : '') + '" data-pal="' + i + '" title="' + P.n + '" style="background:' + P.bg + ';box-shadow:inset 0 0 0 8px ' + P.a + '"></button>'; }).join('') + '</div>'
+ '<div class="gat__lab">cœur</div><div class="gat__rang">' + [['wormion', '◎'], ['portion', '▣'], ['kion', '◇']].map(function (x) { return '<button class="gat__bt' + ((b.centre || base.centre) === x[0] ? ' on' : '') + '" data-centre="' + x[0] + '">' + x[1] + ' ' + x[0] + '</button>'; }).join('') + '</div>'
+ '</div></div>';
}
/* ── ✦ créer : le générateur et le trait ── */
function vueCreer() {
var cands = []; for (var i = 0; i < 12; i++) cands.push('gen-' + gen + '-' + i);
return '<div class="gat__lab">✦ le générateur · forme × marque</div><div class="gat__gl" style="max-height:none">' + cands.map(function (s) { return '<button data-cand="' + s + '">' + I().genere({ id: s }).replace(/class="[^"]*"/, '') + '</button>'; }).join('') + '</div>'
+ '<div class="gat__rang"><button class="gat__bt" data-gen>⟳ d\'autres</button></div>'
+ '<div class="gat__lab">✎ au trait · touche deux points</div><div class="gat__rang"><button class="gat__bt' + (outil === 'trait' ? ' on' : '') + '" data-outil="trait">╱ trait</button><button class="gat__bt' + (outil === 'rond' ? ' on' : '') + '" data-outil="rond">◯ rond</button><button class="gat__bt' + (outil === 'point' ? ' on' : '') + '" data-outil="point">● point</button><button class="gat__bt" data-annuler>↶</button><button class="gat__bt" data-vider>∅</button></div>'
+ '<svg class="gat__grille" data-grille viewBox="-5 -5 110 110"></svg>'
+ '<div class="gat__rang"><input class="gat__q" data-nom placeholder="nom du glyphe" maxlength="30" style="flex:1"><button class="gat__bt go" data-garder>+ garder</button></div><div class="gat__msg" data-msg>' + esc(msg) + '</div>'
+ mesGlyphes();
}
function mesGlyphes() { var l = (ico().glyphes || []).filter(function (g) { return g.mien; }); if (!l.length) return '';
return '<div class="gat__lab">tes glyphes · ' + l.length + '</div><div class="gat__gl">' + l.map(function (g) { return '<button class="perso" data-suppr-gl="' + g.id + '" title="' + esc(g.nom) + ' · ✕">' + gly(g.nom) + '</button>'; }).join('') + '</div>'; }
function corpsTrait() { return trait.map(function (t) { return t.k === 'trait' ? '<line x1="' + t.a[0] + '" y1="' + t.a[1] + '" x2="' + t.b[0] + '" y2="' + t.b[1] + '"/>' : t.k === 'rond' ? '<circle cx="' + t.a[0] + '" cy="' + t.a[1] + '" r="' + Math.round(Math.hypot(t.b[0] - t.a[0], t.b[1] - t.a[1])) + '"/>' : '<circle cx="' + t.a[0] + '" cy="' + t.a[1] + '" r="6" class="f"/>'; }).join(''); }
function majGrille() {
var g = c.querySelector('[data-grille]'); if (!g) return; var h = '';
for (var y = 0; y <= 100; y += 10) for (var x = 0; x <= 100; x += 10) h += '<circle class="pt' + (depart && depart[0] === x && depart[1] === y ? ' on' : '') + '" cx="' + x + '" cy="' + y + '" r="2.4" data-pt="' + x + ',' + y + '"/>';
g.innerHTML = h + '<g class="tr">' + corpsTrait().replace(/ class="f"/g, ' fill="#ddd6ea" stroke="none"') + '</g>';
}
function garder(corps, nom) {
if (!corps) { msg = '◇ vide'; return dessiner(); }
api('/px/glyphes', 'POST', { nom: nom || ('glyphe ' + Date.now().toString(36)), corps: corps }).then(function (d) { msg = '✓ ' + d.nom; trait = []; depart = null; return I().recharger(); }, function (e) { msg = '◇ ' + e.message; }).then(dessiner);
}
c.addEventListener('click', function (e) {
var b = e.target.closest('button,[data-pt]'); if (!b || !vivant) return; var d = b.dataset;
if (d.onglet) { onglet = d.onglet; msg = ''; return dessiner(); }
if (d.sel) { sel = d.sel; brouillon = null; msg = ''; return dessiner(); }
if (d.gl) { brouillon.glyphe = d.gl; return dessiner(); }
if (d.pal != null) { brouillon.pal = +d.pal; return dessiner(); }
if (d.centre) { brouillon.centre = d.centre; return dessiner(); }
if (d.poser) { var tous = d.poser === 'tous'; api('/px/icones/' + encodeURIComponent(sel), 'PUT', { spec: brouillon, tous: tous }).then(function () { if (!tous) ico().mien[sel] = Object.assign({}, brouillon); else ico().tous[sel] = Object.assign({}, brouillon); ico().avis[sel] = 'bon'; api('/px/icones/avis', 'POST', { ploxion: sel, avis: 'bon' }).catch(function () {}); msg = '✓ ' + (tous ? 'pour tous' : 'pour toi'); return I().recharger(); }, function (er) { msg = '◇ ' + er.message; }).then(dessiner); return; }
if (d.defaut != null) { api('/px/icones/' + encodeURIComponent(sel), 'DELETE').then(function () { delete ico().mien[sel]; brouillon = null; msg = '↺'; return I().recharger(); }).then(dessiner); return; }
if (d.gen != null) { gen++; return dessiner(); }
if (d.cand) { var nm = c.querySelector('[data-nom]'); garder(inner(I().genere({ id: d.cand })), nm && nm.value.trim()); return; }
if (d.outil) { outil = d.outil; depart = null; return dessiner(); }
if (d.annuler != null) { trait.pop(); return majGrille(); }
if (d.vider != null) { trait = []; depart = null; return majGrille(); }
if (d.garder != null) { var n2 = c.querySelector('[data-nom]'); garder(corpsTrait(), n2 && n2.value.trim()); return; }
if (d.supprGl) { api('/px/glyphes/' + d.supprGl, 'DELETE').then(function () { return I().recharger(); }).then(dessiner); return; }
if (d.pt) { var p = d.pt.split(',').map(Number);
if (outil === 'point') { trait.push({ k: 'point', a: p }); return majGrille(); }
if (!depart) { depart = p; return majGrille(); }
if (depart[0] !== p[0] || depart[1] !== p[1]) trait.push({ k: outil, a: depart, b: p }); depart = null; return majGrille(); }
});
c.addEventListener('input', function (e) { if (e.target.matches('[data-q]')) { q = e.target.value; var pos = e.target.selectionStart; dessiner(); var nq = c.querySelector('[data-q]'); if (nq) { nq.focus(); try { nq.setSelectionRange(pos, pos); } catch (er) {} } } });
I().recharger().then(function () { if (vivant) dessiner(); });
dessiner();
return { unmount: function () { vivant = false; try { if (swipe && swipe.destroy) swipe.destroy(); } catch (e) {} try { if (gab) gab.stop(); } catch (e) {} c.innerHTML = ''; } };
}
window.jOSApps = window.jOSApps || {};
window.jOSApps[ID] = { manifest: { id: ID, name: 'Atelier des glyphes', icon: '◇' }, mount: mount };
})();
</script>