ploxion-higgs/app.blade.php

354 lines
20 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.

{{-- PL0XI0N higgs ⚛️ — LE boson de Higgs réel, interactif et pédagogique : champ-moquette sur canvas,
slider de la valeur du vide (0 → 246 GeV → au-delà), chapeau mexicain, fiches CERN.
Source OneNote 2020 de RS-7 (« Protagonistes ») : « construis tout, le boson de higgs, tous ces trucs » ;
« On peut par contre imaginer où le boson de Higgs est nul, ce qui fait qu'on n'a pas de masse » ;
« le boson de Higgs définit le numéro de l'univers » — le nôtre : H702. --}}
<style>
.px-higgs{display:flex;flex-direction:column;height:100%;background:var(--xr-bg,#0a0d16);color:var(--xr-fg,#e8ecf8);font-family:var(--xr-font-ui,ui-sans-serif,system-ui);-webkit-tap-highlight-color:transparent}
.px-higgs .hd{display:flex;align-items:center;gap:8px;padding:11px 13px;border-bottom:1px solid var(--xr-line,#1b2540);font-weight:700}
.px-higgs .hd .badge{margin-left:auto;font-size:.72rem;font-weight:700;color:var(--xr-accent,#3fe0d0);border:1px solid var(--xr-line,#1b2540);border-radius:999px;padding:3px 10px;background:var(--xr-card,#111a30)}
.px-higgs .body{flex:1;overflow-y:auto;overflow-x:hidden;padding:12px;display:flex;flex-direction:column;gap:10px}
.px-higgs .card{border:1px solid var(--xr-line,#1b2540);border-radius:13px;padding:11px 13px;background:var(--xr-card,#111a30)}
.px-higgs .card h3{margin:0 0 6px;font-size:.82rem;color:var(--xr-fg,#e8ecf8)}
.px-higgs .muted{color:var(--xr-muted,#7f93c8);font-size:.74rem;line-height:1.45}
.px-higgs canvas{display:block;width:100%;height:236px;border-radius:10px;background:rgba(0,0,0,.18);touch-action:pan-y}
.px-higgs .leg{display:flex;flex-direction:column;gap:6px;margin-top:9px}
.px-higgs .leg .row{display:flex;align-items:center;gap:8px;font-size:.74rem}
.px-higgs .leg .dotc{width:10px;height:10px;border-radius:50%;flex:0 0 auto}
.px-higgs .leg .nm{width:86px;flex:0 0 auto;font-weight:700}
.px-higgs .leg .ms{width:84px;flex:0 0 auto;color:var(--xr-muted,#7f93c8)}
.px-higgs .leg .barw{flex:1;height:7px;border-radius:99px;background:var(--xr-line,#1b2540);overflow:hidden}
.px-higgs .leg .bar{height:100%;width:100%;border-radius:99px;transform-origin:0 50%;transition:transform .25s ease}
.px-higgs .leg .pc{width:56px;text-align:right;color:var(--xr-muted,#7f93c8);flex:0 0 auto}
.px-higgs .vrow{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.px-higgs .vgev{font-size:1.35rem;font-weight:800;color:var(--xr-accent,#3fe0d0)}
.px-higgs .uni{margin-left:auto;font-size:.95rem;font-weight:800}
.px-higgs .unidesc{font-size:.72rem;color:var(--xr-muted,#7f93c8);margin-top:2px}
.px-higgs input[type=range]{width:100%;margin:8px 0 4px;accent-color:var(--xr-accent,#3fe0d0);height:40px}
.px-higgs .presets{display:flex;gap:7px;flex-wrap:wrap;margin-top:8px}
.px-higgs .pbtn{flex:1;min-width:96px;min-height:44px;border:1px solid var(--xr-line,#1b2540);border-radius:11px;background:var(--xr-bg,#0a0d16);color:var(--xr-fg,#e8ecf8);font-weight:700;font-size:.78rem;cursor:pointer;padding:8px}
.px-higgs .pbtn:active{opacity:.7}
.px-higgs .mvbtn{margin-top:9px;width:100%;min-height:46px;border:0;border-radius:11px;background:var(--xr-accent,#2a5ad0);color:#fff;font-weight:800;font-size:.86rem;cursor:pointer}
.px-higgs .mvbtn:active{opacity:.8}
.px-higgs .prog{margin-top:8px;font-size:.7rem;color:var(--xr-muted,#7f93c8)}
.px-higgs .prog b{color:var(--xr-accent,#3fe0d0)}
.px-higgs svg{display:block;width:100%;height:auto}
.px-higgs details{border:1px solid var(--xr-line,#1b2540);border-radius:12px;background:var(--xr-card,#111a30);padding:0}
.px-higgs details summary{cursor:pointer;padding:12px 13px;font-weight:700;font-size:.8rem;list-style:none;min-height:44px;display:flex;align-items:center;gap:8px}
.px-higgs details summary::-webkit-details-marker{display:none}
.px-higgs details .fx{padding:0 13px 12px;font-size:.76rem;line-height:1.5;color:var(--xr-muted,#7f93c8)}
.px-higgs details .fx b{color:var(--xr-fg,#e8ecf8)}
.px-higgs .quote{border-left:3px solid var(--xr-accent,#3fe0d0);padding-left:10px;font-style:italic}
@media (prefers-reduced-motion: reduce){ .px-higgs .leg .bar{transition:none} }
</style>
<script>
(function () {
'use strict';
function esc(s){
try { if (window.jOSb && window.jOSb.esc) return window.jOSb.esc(s); } catch (e) {}
var d = document.createElement('div'); d.textContent = s == null ? '' : s; return d.innerHTML;
}
// Particules : c = couplage visuel au champ de Higgs, m0 = masse réelle à 246 GeV (en GeV)
var PARTS = [
{ sym: 'γ', nom: 'photon', c: 0, col: '#ffd75e', m0: 0 },
{ sym: 'e', nom: 'électron', c: 0.5, col: '#5ec8ff', m0: 0.000511 },
{ sym: 'W·Z', nom: 'bosons W/Z', c: 2.4, col: '#c78bff', m0: 85.7 },
{ sym: 't', nom: 'quark top', c: 6, col: '#ff6e6e', m0: 172.8 }
];
var VMAX = 600, NB = 12; // GeV max du slider, zones d'exploration
function fmtMass(g) {
if (g <= 0) return 'sans masse';
if (g < 0.001) return (g * 1e6).toFixed(0) + ' keV';
if (g < 1) return (g * 1000).toFixed(g * 1000 < 10 ? 2 : 1) + ' MeV';
return (g < 10 ? g.toFixed(2) : g < 100 ? g.toFixed(1) : Math.round(g)) + ' GeV';
}
function describe() {
var v = 246, awarded = false;
try { var raw = localStorage.getItem('jos:higgs'); if (raw) { var o = JSON.parse(raw); if (o && typeof o.v === 'number') v = o.v; if (o && o.awarded) awarded = true; } } catch (e) {}
var items = [{ p: 1, kind: 'stat', label: 'champ (GeV)', value: v }];
if (awarded) items.push({ p: 3, kind: 'stat', label: 'découverte', value: '✓' });
return { v: 1, id: 'higgs', title: 'Boson de Higgs', icon: '⚛️', items: items };
}
function mount(container, ctx) {
var stopped = false, raf = 0, saveT = 0, lastT = 0;
var reduced = false;
try { reduced = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; } catch (e) {}
// -- état persisté ---------------------------------------------------
var st = { v: 246, buckets: [], awarded: false };
try {
var raw = localStorage.getItem('jos:higgs');
if (raw) { var o = JSON.parse(raw); if (o && typeof o.v === 'number') st.v = o.v; if (o && o.buckets) st.buckets = o.buckets; if (o && o.awarded) st.awarded = true; }
} catch (e) {}
function save() {
clearTimeout(saveT);
saveT = setTimeout(function () {
try { localStorage.setItem('jos:higgs', JSON.stringify(st)); } catch (e) {}
try { if (window.jOSBoxion && window.jOSBoxion.saveSoon) window.jOSBoxion.saveSoon('higgs', st); } catch (e) {}
}, 400);
}
try {
if (window.jOSBoxion && window.jOSBoxion.load) {
window.jOSBoxion.load('higgs').then(function (o) {
if (stopped || !o) return;
if (o.awarded) st.awarded = true;
if (o.buckets) for (var i = 0; i < o.buckets.length; i++) if (o.buckets[i]) st.buckets[i] = 1;
paintProg();
}).catch(function () {});
}
} catch (e) {}
// -- DOM ---------------------------------------------------------------
var legHtml = PARTS.map(function (p, i) {
return '<div class="row">' +
'<span class="dotc" style="background:' + p.col + '"></span>' +
'<span class="nm" style="color:' + p.col + '">' + esc(p.nom) + '</span>' +
'<span class="ms" data-m="' + i + '"></span>' +
'<span class="barw"><span class="bar" data-b="' + i + '" style="background:' + p.col + '"></span></span>' +
'<span class="pc" data-p="' + i + '"></span></div>';
}).join('');
container.innerHTML =
'<div class="px-higgs">' +
'<div class="hd">⚛️ Boson de Higgs <span class="badge" data-uni-badge>H702</span></div>' +
'<div class="body">' +
'<div class="card muted">Le champ de Higgs remplit TOUT l\'univers, comme une foule ou la surface de la mer. ' +
'Une célébrité (le quark top) se fait agglutiner par la foule et avance lentement : c\'est ça, la masse. ' +
'Un inconnu (le photon) traverse sans que personne ne le remarque → jamais ralenti, il file à c.</div>' +
'<div class="card"><h3>Le champ (la moquette) + les particules qui le traversent</h3>' +
'<canvas data-cv></canvas><div class="leg">' + legHtml + '</div></div>' +
'<div class="card"><h3>Valeur du champ de Higgs</h3>' +
'<div class="vrow"><span class="vgev" data-gev>246 GeV</span><span class="uni" data-uni>H702</span></div>' +
'<div class="unidesc" data-desc></div>' +
'<input type="range" min="0" max="' + VMAX + '" step="1" value="246" data-slider aria-label="Valeur du champ de Higgs en GeV">' +
'<div class="presets">' +
'<button class="pbtn" data-preset="0">💥 Big Bang<br><span class="muted">champ nul</span></button>' +
'<button class="pbtn" data-preset="246">🌍 Notre univers<br><span class="muted">H702</span></button>' +
'<button class="pbtn" data-preset="' + VMAX + '">🪨 Univers massif<br><span class="muted">tout fige</span></button>' +
'</div>' +
'<div class="prog" data-prog></div>' +
'<button class="mvbtn" data-mv>🌌 Voyager dans ces univers → ploxion multivers</button></div>' +
'<div class="card"><h3>Le potentiel « chapeau mexicain » + la brisure spontanée</h3>' +
'<svg viewBox="0 0 320 150" aria-hidden="true">' +
'<path data-hat fill="none" stroke="var(--xr-accent,#3fe0d0)" stroke-width="2.5" stroke-linecap="round"></path>' +
'<line x1="160" y1="10" x2="160" y2="142" stroke="var(--xr-line,#1b2540)" stroke-dasharray="3 4"></line>' +
'<circle data-ball r="7" fill="#ffd75e" stroke="rgba(0,0,0,.35)"></circle>' +
'</svg>' +
'<div class="muted quote">« Lorsque l\'Univers a commencé à se refroidir… le champ s\'est développé spontanément, ' +
'si bien que toutes les particules interagissant avec ce champ ont acquis une masse. »</div>' +
'<div class="muted" style="margin-top:6px">Au centre : symétrie parfaite, champ nul, tout est sans masse. ' +
'En refroidissant, la bille roule dans la vallée → la symétrie se brise toute seule, le champ prend une valeur (246 GeV chez nous) — et les masses apparaissent.</div></div>' +
'<details><summary>💧 Et si les photons avaient une masse ?</summary><div class="fx">' +
'Dans le vide, le photon ne couple pas au champ de Higgs → masse nulle → toujours à c. ' +
'Mais dans <b>l\'eau</b>, la lumière est ralentie (environ 225 000 km/s). Une particule chargée assez rapide peut alors ' +
'aller <b>plus vite que la lumière dans l\'eau</b> : elle crée une onde de choc lumineuse, la <b>radiation Cherenkov</b> — ' +
'la fameuse lueur bleue des piscines de réacteurs nucléaires.</div></details>' +
'<details><summary>🚀 Pourquoi pas la vitesse de la lumière ?</summary><div class="fx">' +
'Plus un objet massif s\'approche de c, plus l\'énergie qu\'il faut pour l\'accélérer explose. ' +
'Atteindre c exactement demanderait une énergie <b>infinie</b>. Seules les particules sans masse (photon, gluon) ' +
'vont à c — et elles n\'ont pas le choix : c\'est leur seule vitesse possible.</div></details>' +
'<details><summary>🏆 La découverte — CERN, 2012</summary><div class="fx">' +
'Prédit en <b>1964</b> (Brout, Englert, Higgs), traqué pendant presque 50 ans. Le <b>4 juillet 2012</b>, ' +
'les expériences <b>ATLAS</b> et <b>CMS</b> du LHC au CERN annoncent un boson à <b>~125 GeV</b>, ' +
'compatible avec le boson de Higgs. Prix Nobel de physique 2013 pour Englert et Higgs.</div></details>' +
'<div class="muted" style="text-align:center;padding:2px 0 8px">le boson de Higgs définit le numéro de l\'univers — le nôtre : H702</div>' +
'</div>' +
'</div>';
var root = container.querySelector('.px-higgs');
var cv = root.querySelector('[data-cv]');
var g = cv.getContext('2d');
var slider = root.querySelector('[data-slider]');
var elGev = root.querySelector('[data-gev]');
var elUni = root.querySelector('[data-uni]');
var elBadge = root.querySelector('[data-uni-badge]');
var elDesc = root.querySelector('[data-desc]');
var elProg = root.querySelector('[data-prog]');
var elHat = root.querySelector('[data-hat]');
var elBall = root.querySelector('[data-ball]');
slider.value = String(st.v);
// -- simulation canvas ---------------------------------------------------
var W = 0, H = 0, dpr = 1, dots = [], sim = [];
for (var i = 0; i < PARTS.length; i++) sim.push({ x: 40 + i * 60, y: 0 });
function fit() {
dpr = Math.min(window.devicePixelRatio || 1, 1.5);
W = cv.clientWidth || 300; H = cv.clientHeight || 236;
cv.width = Math.round(W * dpr); cv.height = Math.round(H * dpr);
g.setTransform(dpr, 0, 0, dpr, 0, 0);
dots = [];
var step = 26;
for (var y = step * 0.7; y < H; y += step)
for (var x = step * 0.6; x < W; x += step) dots.push({ x: x, y: y });
for (var k = 0; k < PARTS.length; k++) {
sim[k].y = H * (k + 0.5) / PARTS.length;
if (reduced) sim[k].x = W * (0.2 + 0.185 * k);
}
}
function speedOf(p) { return 1 / (1 + p.c * (st.v / 246)); }
function draw() {
g.clearRect(0, 0, W, H);
var f = st.v / 246, R2 = 48 * 48;
// la moquette : chaque point du champ s'agglutine autour des particules qui couplent
for (var d = 0; d < dots.length; d++) {
var pt = dots[d], ox = 0, oy = 0, glow = 0;
for (var k = 0; k < PARTS.length; k++) {
var amp = 12 * Math.min(PARTS[k].c * f / 6, 1);
if (amp <= 0) continue;
var dx = sim[k].x - pt.x, dy = sim[k].y - pt.y;
var d2 = dx * dx + dy * dy;
var pull = amp * R2 / (d2 + R2);
var dist = Math.sqrt(d2) + 0.001;
ox += dx / dist * pull; oy += dy / dist * pull; glow += pull;
}
g.globalAlpha = Math.min(0.22 + glow * 0.06, 0.85);
g.fillStyle = '#7f93c8';
g.fillRect(pt.x + ox - 1, pt.y + oy - 1, 2.2, 2.2);
}
g.globalAlpha = 1;
// les particules
for (var j = 0; j < PARTS.length; j++) {
var p = PARTS[j], s = sim[j];
var cf = Math.min(p.c * f / 6, 1);
if (cf > 0.02) { // anneaux d'agglutination (la foule qui colle)
g.strokeStyle = p.col;
g.globalAlpha = 0.35 * cf; g.beginPath(); g.arc(s.x, s.y, 13, 0, 6.2832); g.stroke();
g.globalAlpha = 0.16 * cf; g.beginPath(); g.arc(s.x, s.y, 19, 0, 6.2832); g.stroke();
g.globalAlpha = 1;
}
g.fillStyle = p.col;
g.beginPath(); g.arc(s.x, s.y, 8, 0, 6.2832); g.fill();
g.fillStyle = '#0a0d16'; g.font = 'bold 8px ui-sans-serif,system-ui';
g.textAlign = 'center'; g.textBaseline = 'middle';
g.fillText(p.sym, s.x, s.y + 0.5);
}
try { if (window.jGlyph && window.jGlyph.prim) window.jGlyph.prim(g, 'wormion', W - 18, 16, 7, 'rgba(127,147,200,.45)', 2); } catch (e) {}
}
function frame(t) {
if (stopped) return;
var dt = lastT ? Math.min((t - lastT) / 1000, 0.05) : 0.016;
lastT = t;
for (var k = 0; k < PARTS.length; k++) {
sim[k].x += 95 * speedOf(PARTS[k]) * dt;
if (sim[k].x > W + 14) sim[k].x = -14;
}
draw();
raf = requestAnimationFrame(frame);
}
// -- chapeau mexicain ------------------------------------------------------
function paintHat() {
var s = Math.min(st.v / 246, 1.25), phiMax = 1.6, N = 48;
var vals = [], vm = 0;
for (var i = 0; i <= N; i++) {
var phi = -phiMax + 2 * phiMax * i / N;
var V = Math.pow(phi * phi - s * s, 2);
vals.push(V); if (V > vm) vm = V;
}
if (vm <= 0) vm = 1;
var d = '';
for (var j = 0; j <= N; j++) {
var x = 10 + 300 * j / N, y = 138 - 118 * (vals[j] / vm);
d += (j === 0 ? 'M' : 'L') + x.toFixed(1) + ' ' + y.toFixed(1);
}
elHat.setAttribute('d', d);
var bx = 160 + 150 * (s / phiMax); // la bille roule dans la vallée (brisure) ; à s=0 elle reste au centre
elBall.setAttribute('cx', bx.toFixed(1));
elBall.setAttribute('cy', '132');
}
// -- numéro d'univers + fiches vivantes -------------------------------------
function uniNum() { return Math.round(702 * st.v / 246); }
function descFor() {
if (st.v === 0) return 'juste après le Big Bang : champ nul, AUCUNE particule n\'a de masse — tout file à c';
if (st.v < 180) return 'univers léger : masses minuscules, atomes fragiles, chimie exotique';
if (st.v === 246) return '246 GeV = la valeur du vide chez nous. Bienvenue à la maison.';
if (st.v <= 300) return 'presque chez nous — les constantes vacillent un peu';
return 'univers massif : tout est lourd, les particules rampent, tout fige';
}
function paintStats() {
elGev.textContent = st.v + ' GeV';
var n = uniNum();
var label = 'H' + n + (st.v === 246 ? ' (le nôtre)' : '');
elUni.textContent = label; elBadge.textContent = label;
elDesc.textContent = descFor();
for (var i = 0; i < PARTS.length; i++) {
var p = PARTS[i], sp = speedOf(p);
root.querySelector('[data-m="' + i + '"]').textContent = fmtMass(p.m0 * st.v / 246);
root.querySelector('[data-p="' + i + '"]').textContent = Math.round(sp * 100) + '% c';
root.querySelector('[data-b="' + i + '"]').style.transform = 'scaleX(' + sp.toFixed(3) + ')';
}
}
function paintProg() {
var got = 0; for (var i = 0; i < NB; i++) if (st.buckets[i]) got++;
elProg.innerHTML = st.awarded
? '🏆 <b>higgs-compris</b> — tu as balayé tout le champ, du Big Bang à l\'univers figé'
: 'exploration du champ : <b>' + got + '/' + NB + '</b> zones (balaie le slider de 0 à ' + VMAX + ' GeV)';
}
function checkAward() {
var idx = Math.min(NB - 1, Math.floor(st.v / VMAX * NB));
if (!st.buckets[idx]) { st.buckets[idx] = 1; paintProg(); }
if (st.awarded) return;
for (var i = 0; i < NB; i++) if (!st.buckets[i]) return;
st.awarded = true; paintProg(); save();
try { if (window.jOSGame && window.jOSGame.award) window.jOSGame.award('higgs-compris', { label: 'Higgs compris', icon: '⚛️', toast: '⚛️ higgs-compris — tu as balayé tout le champ de Higgs !' }); } catch (e) {}
try { if (window.jOSb && window.jOSb.toast) window.jOSb.toast('⚛️ higgs-compris débloqué !'); } catch (e) {}
}
function applyV(nv) {
st.v = Math.max(0, Math.min(VMAX, Math.round(nv)));
paintStats(); paintHat(); checkAward(); save();
if (reduced) draw();
}
slider.addEventListener('input', function () { applyV(parseInt(slider.value, 10) || 0); });
var pbs = root.querySelectorAll('[data-preset]');
for (var b = 0; b < pbs.length; b++) {
pbs[b].addEventListener('click', function (ev) {
var nv = parseInt(ev.currentTarget.getAttribute('data-preset'), 10) || 0;
slider.value = String(nv); applyV(nv);
try { if (window.jOSGame && window.jOSGame.event) window.jOSGame.event('higgs.preset', { v: nv, univers: 'H' + uniNum() }); } catch (e) {}
});
}
root.querySelector('[data-mv]').addEventListener('click', function () {
try { if (window.jOSOp && window.jOSOp.openPloxion) { window.jOSOp.openPloxion('multivers'); return; } } catch (e) {}
try { if (window.jOSMobile && window.jOSMobile.open) { window.jOSMobile.open('multivers'); return; } } catch (e) {}
try { if (window.jOS && window.jOS.openPloxion) { window.jOS.openPloxion('multivers'); return; } } catch (e) {}
try { location.href = '/local#px=multivers'; } catch (e) {}
});
function onRes() { fit(); if (reduced) draw(); }
window.addEventListener('resize', onRes);
fit(); paintStats(); paintHat(); paintProg();
var idx0 = Math.min(NB - 1, Math.floor(st.v / VMAX * NB));
if (!st.buckets[idx0]) { st.buckets[idx0] = 1; paintProg(); }
if (reduced) { draw(); } else { raf = requestAnimationFrame(frame); }
return {
unmount: function () {
stopped = true;
try { cancelAnimationFrame(raf); } catch (e) {}
clearTimeout(saveT);
window.removeEventListener('resize', onRes);
container.innerHTML = '';
}
};
}
window.jOSApps = window.jOSApps || {};
window.jOSApps['higgs'] = { manifest: { id: 'higgs', name: 'Boson de Higgs', icon: '⚛️' }, mount: mount, describe: describe };
})();
</script>