ploxion-noyau/app.blade.php

94 lines
8.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{-- PL0XION noyau ⚙🎛 — LES KNOBS DU SYSTÈME (rs-4, RS-7 : « on va dans le core, changer le code
entier du système avec des knobs du système »). Les tokens --xr-* du NOYAU que TOUS les ploxions
héritent : tourne un knob → le xerboxion ENTIER se retune en direct (les 380 ploxions d'un coup).
Réutilise jOSKnob + jOSCore (boot _core_knobs_boot). Persisté 'xb:core', appliqué pré-paint partout. --}}
<style>
.nyx{display:flex;flex-direction:column;height:100%;background:var(--xr-bg,#070a12);color:var(--xr-text,#dce7f7);font-family:var(--xr-font-ui,ui-sans-serif,system-ui);overflow:auto;padding:14px}
.nyx__h{display:flex;align-items:center;gap:8px;margin-bottom:4px}
.nyx__h b{color:var(--xr-accent,#5fe0c0);font-size:1rem}
.nyx__sub{font-size:.72rem;color:var(--xr-muted,#8aa);margin-bottom:12px}
.nyx h6{font-size:.62rem;text-transform:uppercase;letter-spacing:.06em;color:var(--xr-muted,#7f93c8);margin:12px 0 6px}
.nyx__row{display:flex;flex-wrap:wrap;gap:10px}
.nyx__toggles{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
.nyx__tg{cursor:pointer;border:1px solid var(--xr-border,#2b3a5a);background:var(--xr-bg2,rgba(20,34,52,.5));color:var(--xr-text,#dbe7f7);border-radius:9px;padding:7px 11px;font-size:.76rem}
.nyx__tg.on{background:var(--xr-accent,#5fe0c0);color:#04120e;border:0;font-weight:800}
.nyx__acts{display:flex;gap:8px;margin-top:16px}
.nyx__b{cursor:pointer;border:0;border-radius:9px;background:var(--xr-accent,#5fe0c0);color:#04120e;font:inherit;font-weight:800;font-size:.78rem;padding:9px 15px}
.nyx__b.sec{background:rgba(30,48,84,.7);color:#dbe9ff;border:1px solid #2a3a62;font-weight:600}
.nyx__warn{font-size:.66rem;color:var(--xr-muted,#7f93c8);margin-top:12px;line-height:1.5}
</style>
<script>
(function () {
'use strict';
function describe() {
if (!window.jOSCore) return { v: 1, id: 'noyau', title: 'Noyau', icon: '⚙', items: [{ p: 1, kind: 'text', label: 'noyau', value: 'jOSCore absent' }] };
var cfg = jOSCore.get();
return { v: 1, id: 'noyau', title: 'Noyau', icon: '⚙', items: [
{ p: 1, kind: 'stat', label: 'accent (teinte)', value: Math.round(cfg.accentH) + '°' }
] };
}
{{-- 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/noyau, l'adresse devient /px/theme?section=palette. Kill-switch localStorage xb:theme.ploxion=off : les knobs d'avant, tels quels. --}}
function versTheme(container, ctx) {
var T = window.jOSTheme, A = window.jOSApps, c = Object.assign({}, ctx || {}, { section: 'palette', alias: 'noyau' });
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;
if (!window.jOSCore || !window.jOSKnob) { container.innerHTML = '<div style="padding:16px;color:#8aa">jOSCore / jOSKnob absents.</div>'; return { unmount: function () { container.innerHTML = ''; } }; }
var cfg = jOSCore.get();
container.innerHTML = '<div class="nyx"><div class="nyx__h"><b>⚙ noyau</b></div>'
+ '<div class="nyx__sub">les knobs du SYSTÈME — tourne, TOUT le xerboxion se retune en direct (les 380 ploxions héritent de ces tokens).</div>'
+ '<h6>△ couleur du noyau</h6><div class="nyx__row" data-col></div>'
+ '<h6>△ forme & densité</h6><div class="nyx__row" data-shape></div>'
+ '<h6>△ mouvement & matière</h6><div class="nyx__row" data-motion></div>'
+ '<h6>interrupteurs système</h6><div class="nyx__toggles" data-tg></div>'
+ '<div class="nyx__acts"><button class="nyx__b" data-save>💾 graver dans le noyau</button><button class="nyx__b sec" data-reset>↺ réinitialiser</button></div>'
+ '<div class="nyx__warn">« graver » persiste (localStorage xb:core) et s\'applique AVANT le paint sur toutes les pages. Ces knobs surchargent le thème actif. Réinitialiser = revenir au thème.</div></div>';
function live() { jOSCore.apply(cfg); }
jOSKnob.panel(container.querySelector('[data-col]'), [
{ key: 'accentH', label: 'accent teinte', min: 0, max: 360, value: cfg.accentH, step: 2, fmt: function (v) { return v.toFixed(0) + '°'; } },
{ key: 'accentS', label: 'accent satur.', min: 0, max: 100, value: cfg.accentS, fmt: pct },
{ key: 'accentL', label: 'accent lum.', min: 25, max: 85, value: cfg.accentL, fmt: pct },
{ key: 'bgH', label: 'fond teinte', min: 0, max: 360, value: cfg.bgH, step: 2, fmt: function (v) { return v.toFixed(0) + '°'; } },
{ key: 'bgL', label: 'fond lum.', min: 2, max: 24, value: cfg.bgL, fmt: pct }
], function (v) { assign(v); live(); }, { shape: 'koin' });
jOSKnob.panel(container.querySelector('[data-shape]'), [
{ key: 'radius', label: 'arrondi', min: 0, max: 26, value: cfg.radius, fmt: px },
{ key: 'dens', label: 'densité', min: 13, max: 20, value: cfg.dens, fmt: px }
], function (v) { assign(v); live(); }, { shape: 'koin' });
jOSKnob.panel(container.querySelector('[data-motion]'), [
{ key: 'spd', label: 'vitesse', min: 0.2, max: 3, value: cfg.spd },
{ key: 'blur', label: 'flou', min: 0, max: 20, value: cfg.blur, fmt: px },
{ key: 'glow', label: 'lueur', min: 0, max: 2, value: cfg.glow }
], function (v) { assign(v); live(); }, { shape: 'koin' });
function pct(v) { return v.toFixed(0) + '%'; } function px(v) { return v.toFixed(0) + 'px'; }
function assign(v) { for (var k in v) cfg[k] = v[k]; }
// interrupteurs système réels
var toggles = [
{ key: 'cubion', label: '🧊 cubion (cube 3D)', get: function () { return localStorage.getItem('xb-cubion') === 'on'; }, set: function (on) { localStorage.setItem('xb-cubion', on ? 'on' : 'off'); document.documentElement.classList.toggle('cubion-off', !on); } },
{ key: 'reduce', label: '🐢 mouvement réduit', get: function () { return document.documentElement.classList.contains('xb-reduce'); }, set: function (on) { var T = window.jOSTheme; if (T && T.regler) { T.regler('reduire', on, { par: 'noyau' }); return; } document.documentElement.classList.toggle('xb-reduce', on); try { localStorage.setItem('xb-reduce', on ? '1' : '0'); } catch (e) {} } } // l'écrivain de jOSTheme (docs/dev/44, réparation « mouvement » : restauré au chargement, et le signal commun html.xb-no-anim)
];
var tg = container.querySelector('[data-tg]');
tg.innerHTML = toggles.map(function (t) { return '<button class="nyx__tg' + (t.get() ? ' on' : '') + '" data-k="' + t.key + '">' + t.label + '</button>'; }).join('');
tg.addEventListener('click', function (e) { var b = e.target.closest('[data-k]'); if (!b) return; var t = toggles.filter(function (x) { return x.key === b.getAttribute('data-k'); })[0]; if (!t) return; var on = !t.get(); t.set(on); b.classList.toggle('on', on); });
container.querySelector('[data-save]').addEventListener('click', function (e) { jOSCore.set(cfg); e.target.textContent = '✓ gravé'; setTimeout(function () { e.target.textContent = '💾 graver dans le noyau'; }, 1000); });
container.querySelector('[data-reset]').addEventListener('click', function () { jOSCore.reset(); cfg = jOSCore.get(); container.querySelector('.nyx').remove(); mount(container); });
return { unmount: function () { container.innerHTML = ''; } };
}
window.jOSApps = window.jOSApps || {};
window.jOSApps['noyau'] = { manifest: { id: 'noyau', name: 'Noyau', icon: '⚙' }, mount: mount, describe: describe };
})();
</script>