synchro du labo (0bf0da65) : app.blade.php, README.md
This commit is contained in:
22
README.md
22
README.md
@@ -1,3 +1,21 @@
|
||||
# ploxion-apparence
|
||||
# 🖼 UI ploxions
|
||||
|
||||
PLOXION · Le UI des ploxions (José : « un ploxion pour le ui des ploxion »). Studio : liste tous les ploxions, MONTE le sélectionné en preview LIVE (son vrai mount()), et expose les tokens de thème --xr-* pour le restyler en direct — sur la preview seule ou partout. + ses ports (in/out). · fournit: ploxion-ui, preview, theme
|
||||
Alias de Thème › palette (ultimate-theme étape C : un vrai ploxion monté dans l'aperçu vivant, les couleurs) — le studio d'avant revient sous xb:theme.ploxion=off : liste tous les ploxions, MONTE le sélectionné en preview LIVE (son vrai mount()), et expose les tokens de thème --xr-* pour le restyler en direct. + ses ports (in/out).
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| id | `apparence` |
|
||||
| fournit | `ploxion-ui` `preview` `theme` |
|
||||
| bions qu'il nomme | `jOSApps` `jOSTheme` |
|
||||
| fichiers | `app.blade.php` |
|
||||
| dans le labo | `resources/views/ploxions/apparence/` (dépôt `my_website2`) |
|
||||
|
||||
## Contribuer
|
||||
|
||||
- **Dans le xer** : https://labo.j0bot.ch/px/atelier?ploxion=apparence — prends-le, modifie-le, vois-le tourner, « ⧗ envoyer le tsoin ».
|
||||
- **Dans VS Code** : `xb prendre apparence` (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
|
||||
|
||||
123
app.blade.php
Normal file
123
app.blade.php
Normal file
@@ -0,0 +1,123 @@
|
||||
{{-- PL0XI0N apparence — le UI DES PLOXIONS (RS-7 : « un ploxion pour le ui des
|
||||
ploxion »). Studio : liste tous les ploxions (window.__PLOXIONS__), MONTE le
|
||||
sélectionné en preview LIVE (window.jOSApps[id].mount), et expose les tokens de
|
||||
thème --xr-* pour le restyler en direct — sur la preview seule ou partout. + ses
|
||||
ports (/ploxion-io.json). Réutilise le contrat ploxion (mount→{unmount}). --}}
|
||||
<style>
|
||||
.pu{height:100%;display:flex;flex-direction:column;background:var(--xr-bg,#0a0c12);color:var(--xr-text,#e6ecf6);font-family:var(--xr-font,ui-sans-serif,system-ui);font-size:.84rem}
|
||||
.pu__hd{flex:0 0 auto;display:flex;align-items:center;gap:8px;padding:7px 12px;border-bottom:1px solid var(--xr-border,rgba(150,170,255,.16))}
|
||||
.pu__hd b{color:var(--xr-accent,#7aa0ff)} .pu__hd .dim{color:var(--xr-muted,#8590a8);font-size:.72rem}
|
||||
.pu__body{flex:1;display:flex;min-height:0}
|
||||
.pu__list{flex:0 0 150px;border-right:1px solid var(--xr-border,rgba(150,170,255,.14));overflow-y:auto;padding:6px}
|
||||
.pu__list input{width:100%;background:#06080f;border:1px solid var(--xr-border,rgba(150,170,255,.25));color:#e6ecf6;border-radius:6px;padding:4px 7px;font-size:.74rem;outline:none;margin-bottom:6px}
|
||||
.pu__i{display:flex;align-items:center;gap:6px;padding:4px 6px;border-radius:6px;cursor:pointer;font-size:.76rem}
|
||||
.pu__i:hover{background:rgba(150,170,255,.1)} .pu__i.on{background:rgba(122,160,255,.18);color:var(--xr-accent,#7aa0ff);font-weight:600}
|
||||
.pu__mid{flex:1;display:flex;flex-direction:column;min-width:0;background:#06080f}
|
||||
.pu__frame{flex:1;min-height:0;margin:10px;border:1px solid var(--xr-border,rgba(150,170,255,.25));border-radius:10px;overflow:hidden;position:relative;background:var(--xr-bg,#0a0c12)}
|
||||
.pu__frame .ph{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--xr-muted,#8590a8);text-align:center;padding:20px}
|
||||
.pu__host{position:absolute;inset:0}
|
||||
.pu__side{flex:0 0 188px;border-left:1px solid var(--xr-border,rgba(150,170,255,.14));overflow-y:auto;padding:9px}
|
||||
.pu__side h4{margin:8px 0 5px;font-size:.64rem;text-transform:uppercase;color:var(--xr-muted,#8590a8)}
|
||||
.pu__tok{display:flex;align-items:center;gap:6px;margin-bottom:5px;font-size:.72rem} .pu__tok label{flex:1;color:var(--xr-muted,#aab4cc)} .pu__tok input[type=color]{width:26px;height:20px;border:0;background:none;padding:0;cursor:pointer}
|
||||
.pu__btn{width:100%;background:none;border:1px solid var(--xr-border,rgba(150,170,255,.3));color:var(--xr-accent,#7aa0ff);border-radius:7px;padding:5px;cursor:pointer;font-size:.74rem;margin-top:5px}
|
||||
.pu__info{font-size:.72rem;color:var(--xr-muted,#aab4cc);line-height:1.4} .pu__info b{color:var(--xr-text,#e6ecf6)}
|
||||
.pu__port{font:0.66rem ui-monospace,monospace} .pu__port .i{color:#7CFFB2} .pu__port .o{color:#ffae7a}
|
||||
</style>
|
||||
<script>
|
||||
(function(){
|
||||
var ID='apparence';
|
||||
var TOKENS=[['--xr-bg','fond'],['--xr-text','texte'],['--xr-accent','accent'],['--xr-accent2','accent 2'],['--xr-muted','atténué'],['--xr-border','bordure']];
|
||||
{{-- ULTIMATE-THEME ÉTAPE C (docs/dev/44-theme.md §12) : ALIAS de Thème › palette — le même geste (un favori, un lien, un tsoin ancien) ouvre la
|
||||
section qui le reprend ; seul, sur /px/apparence, l'adresse devient /px/theme?section=palette. Kill-switch localStorage xb:theme.ploxion=off : le studio d'avant, tel quel. --}}
|
||||
function versTheme(container, ctx) {
|
||||
var T = window.jOSTheme, A = window.jOSApps, c = Object.assign({}, ctx || {}, { section: 'palette', alias: 'apparence' });
|
||||
if (!(T && T.ploxion && T.ploxion()) || !A) return null;
|
||||
if (A.theme && A.theme.mount) return A.theme.mount(container, c);
|
||||
if (A.monter && A.peut && A.peut('theme')) return A.monter('theme', container, c);
|
||||
if (ctx && ctx.standalone) { try { window.location.replace('/px/theme?section=palette'); } catch (e) {} return { unmount: function () {} }; }
|
||||
return null;
|
||||
}
|
||||
function mount(container, ctx){
|
||||
var th=versTheme(container, ctx); if(th) return th;
|
||||
var alive=true, cur=null, curUnmount=null, IO={}, q='';
|
||||
container.innerHTML='<div class="pu"><div class="pu__hd"><b>🖼 UI des ploxions</b><span class="dim">preview live + thème --xr-* en direct</span></div>'
|
||||
+'<div class="pu__body">'
|
||||
+' <div class="pu__list"><input data-q placeholder="filtrer…"><div data-list></div></div>'
|
||||
+' <div class="pu__mid"><div class="pu__frame" data-frame><div class="ph" data-ph>← choisis un ploxion pour le prévisualiser</div><div class="pu__host" data-host style="display:none"></div></div></div>'
|
||||
+' <div class="pu__side">'
|
||||
+' <h4>thème (--xr-*)</h4><div data-tokens></div>'
|
||||
+' <button class="pu__btn" data-apply-all>appliquer partout</button><button class="pu__btn" data-reset>réinitialiser</button>'
|
||||
+' <h4>infos</h4><div class="pu__info" data-info>—</div>'
|
||||
+' </div>'
|
||||
+'</div></div>';
|
||||
var R=container.querySelector('.pu'), listEl=R.querySelector('[data-list]'), frame=R.querySelector('[data-frame]'),
|
||||
host=R.querySelector('[data-host]'), ph=R.querySelector('[data-ph]'), tokEl=R.querySelector('[data-tokens]'),
|
||||
infoEl=R.querySelector('[data-info]'), qin=R.querySelector('[data-q]');
|
||||
function esc(s) { return window.jOSb.esc(s); }
|
||||
function plist(){ return (window.__PLOXIONS__||[]).filter(function(p){ return p.id!==ID; }); }
|
||||
|
||||
fetch('/ploxion-io.json').then(function(r){return r.json();}).then(function(d){ var io=d.ploxions||d; if(Array.isArray(io)){var m={};io.forEach(function(x){if(x.id)m[x.id]=x;});io=m;} IO=io||{}; }).catch(function(){});
|
||||
|
||||
function renderList(){
|
||||
var ps=plist().filter(function(p){ return !q || (p.name||p.id).toLowerCase().indexOf(q)>=0; });
|
||||
listEl.innerHTML=ps.map(function(p){ return '<div class="pu__i'+(cur===p.id?' on':'')+'" data-p="'+esc(p.id)+'">'+(p.icon||'▣')+' '+esc(p.name||p.id)+'</div>'; }).join('')||'<div style="color:var(--xr-muted,#8590a8);font-size:.72rem">aucun</div>';
|
||||
}
|
||||
function renderTokens(){
|
||||
var cs=getComputedStyle(frame);
|
||||
tokEl.innerHTML=TOKENS.map(function(t){ var v=(cs.getPropertyValue(t[0])||'').trim(); var hex=toHex(v); return '<div class="pu__tok"><label>'+t[1]+'</label><input type="color" data-tok="'+t[0]+'" value="'+hex+'"></div>'; }).join('');
|
||||
}
|
||||
function toHex(v){ v=(v||'').trim(); if(/^#([0-9a-f]{6})$/i.test(v))return v.toLowerCase(); if(/^#([0-9a-f]{3})$/i.test(v))return '#'+v.slice(1).split('').map(function(c){return c+c;}).join('').toLowerCase(); var m=v.match(/rgba?\(([^)]+)\)/); if(m){ var p=m[1].split(',').map(function(x){return parseInt(x);}); return '#'+p.slice(0,3).map(function(n){return ('0'+((n||0)&255).toString(16)).slice(-2);}).join(''); } return '#888888'; }
|
||||
|
||||
function unmountCur(){ if(curUnmount){ try{ curUnmount(); }catch(e){} curUnmount=null; } host.innerHTML=''; }
|
||||
function preview(id){
|
||||
unmountCur(); cur=id; renderList();
|
||||
var app=window.jOSApps&&window.jOSApps[id];
|
||||
if(!app||!app.mount){ ph.style.display=''; host.style.display='none'; ph.textContent='ce ploxion n\'expose pas de mount() (rien à prévisualiser)'; info(id); return; }
|
||||
ph.style.display='none'; host.style.display='';
|
||||
try{ var r=app.mount(host,{preview:true}); curUnmount=r&&r.unmount; }
|
||||
catch(e){ ph.style.display=''; host.style.display='none'; ph.textContent='✗ mount a échoué : '+e; }
|
||||
info(id); history(id);
|
||||
}
|
||||
// 🕘 HISTORIQUE des UI (RS-7 : « chaque modif d'un ploxion accessible depuis le ploxion ui,
|
||||
// pour recommencer de zéro ou reprendre un UI ») — git log généré au ship (/ui-history.json)
|
||||
// + les 5 dernières versions du blade téléchargeables (/ui-history/<id>-<hash>.txt).
|
||||
var HIST=null;
|
||||
function history(id){
|
||||
var el=document.getElementById('pu-hist');
|
||||
if(!el){ el=document.createElement('div'); el.id='pu-hist'; el.style.cssText='padding:10px 12px;border-top:1px solid rgba(150,120,235,.2);font-size:.72rem;line-height:1.7'; infoEl.parentNode.appendChild(el); }
|
||||
function paint(){
|
||||
var vs=(HIST&&HIST[id])||[];
|
||||
if(!vs.length){ el.innerHTML='<b>🕘 historique du UI</b><div style="opacity:.5">aucune version enregistrée</div>'; return; }
|
||||
el.innerHTML='<b>🕘 historique du UI · '+vs.length+' version'+(vs.length>1?'s':'')+'</b>'
|
||||
+vs.slice(0,10).map(function(v){ return '<div>'+v.date+' · <span style="opacity:.75">'+v.subject.replace(/</g,'<')+'</span>'
|
||||
+(v.blob?' <a href="/ui-history/'+id+'-'+v.h+'.txt" target="_blank" style="color:#b58cff">voir</a> · <a href="/ui-history/'+id+'-'+v.h+'.txt" download="'+id+'-'+v.h+'.blade.php" style="color:#b58cff">⬇ reprendre</a>':'')
|
||||
+'</div>'; }).join('')
|
||||
+'<div style="opacity:.5;margin-top:4px">⬇ reprendre = repartir de cette version du blade (ou de zéro depuis la plus ancienne)</div>';
|
||||
}
|
||||
if(HIST) return paint();
|
||||
fetch('/ui-history.json').then(function(r){return r.json();}).then(function(j){ HIST=j; paint(); }).catch(function(){ el.innerHTML='<b>🕘 historique</b><div style="opacity:.5">indisponible</div>'; });
|
||||
}
|
||||
function info(id){
|
||||
var p=plist().filter(function(x){return x.id===id;})[0]||{}; var io=IO[id]||{};
|
||||
var ins=(io.in||[]).map(function(x){return '<span class="i">'+esc(x.t||'?')+'</span>';}).join(' ')||'—';
|
||||
var outs=(io.out||[]).map(function(x){return '<span class="o">'+esc(x.t||'?')+'</span>';}).join(' ')||'—';
|
||||
infoEl.innerHTML='<b>'+(p.icon||'')+' '+esc(p.name||id)+'</b><div>id : '+esc(id)+'</div>'
|
||||
+(p.provides&&p.provides.length?'<div>fournit : '+esc(p.provides.join(', '))+'</div>':'')
|
||||
+'<div class="pu__port" style="margin-top:4px">in : '+ins+'</div><div class="pu__port">out : '+outs+'</div>';
|
||||
}
|
||||
|
||||
R.addEventListener('click',function(e){
|
||||
var it=e.target.closest('[data-p]'); if(it){ preview(it.getAttribute('data-p')); return; }
|
||||
if(e.target.closest('[data-apply-all]')){ TOKENS.forEach(function(t){ var inp=tokEl.querySelector('[data-tok="'+t[0]+'"]'); if(inp) document.documentElement.style.setProperty(t[0],inp.value); }); return; }
|
||||
if(e.target.closest('[data-reset]')){ TOKENS.forEach(function(t){ frame.style.removeProperty(t[0]); document.documentElement.style.removeProperty(t[0]); }); renderTokens(); return; }
|
||||
});
|
||||
tokEl.addEventListener('input',function(e){ var inp=e.target.closest('[data-tok]'); if(inp){ frame.style.setProperty(inp.getAttribute('data-tok'), inp.value); } });
|
||||
qin.addEventListener('input',function(){ q=qin.value.toLowerCase().trim(); renderList(); });
|
||||
|
||||
renderList(); renderTokens();
|
||||
return { unmount:function(){ alive=false; unmountCur(); container.innerHTML=''; } };
|
||||
}
|
||||
window.jOSApps=window.jOSApps||{};
|
||||
window.jOSApps[ID]={manifest:{id:ID,name:'UI ploxions',icon:'🖼'},mount:mount};
|
||||
})();
|
||||
</script>
|
||||
Reference in New Issue
Block a user