mirror of
https://git.j0bot.ch/admin_j0bot/ploxion-kion-3d.git
synced 2026-11-29 06:45:14 +00:00
synchro du labo (0bf0da65) : app.blade.php, README.md
This commit is contained in:
parent
77c0e90ec3
commit
d5ace140ff
22
README.md
22
README.md
@ -1,3 +1,21 @@
|
|||||||
# ploxion-kion-3d
|
# 🔷 Kions 3D
|
||||||
|
|
||||||
PLOXION · LES PREMIERS KIONS & XERKIONS EN 3D (rs-4, test UI 3D) — sur le terrain jOS3D : la rangée des premiers kions (koin/3kion/4kion=xer/6kion/wormion/kion) qui tournent + un XERKION 3D radial (octogone + 8 koins cliquables = un LANCEUR 3D). Survol = le koin se lève et brille, clic = ouvre le ploxion (raycast). Ploxion de test pour évaluer une UI 3D. Réutilise jOS3D. · fournit: 3d, kion, xerkion, ui, test, lanceur
|
LES PREMIERS KIONS & XERKIONS EN 3D (rs-4, test UI 3D) — sur le terrain jOS3D : la rangée des premiers kions (koin/3kion/4kion=xer/6kion/wormion/kion) qui tournent + un XERKION 3D radial (octogone + 8 koins cliquables = un LANCEUR 3D). Survol = le koin se lève et brille, clic = ouvre le ploxion (raycast). Ploxion de test pour évaluer une UI 3D. Réutilise jOS3D.
|
||||||
|
|
||||||
|
| | |
|
||||||
|
| --- | --- |
|
||||||
|
| id | `kion-3d` |
|
||||||
|
| fournit | `3d` `kion` `xerkion` `ui` `test` `lanceur` |
|
||||||
|
| bions qu'il nomme | `jOSApps` `jOSPorts` |
|
||||||
|
| fichiers | `app.blade.php` |
|
||||||
|
| dans le labo | `resources/views/ploxions/kion-3d/` (dépôt `my_website2`) |
|
||||||
|
|
||||||
|
## Contribuer
|
||||||
|
|
||||||
|
- **Dans le xer** : https://labo.j0bot.ch/px/atelier?ploxion=kion-3d — prends-le, modifie-le, vois-le tourner, « ⧗ envoyer le tsoin ».
|
||||||
|
- **Dans VS Code** : `xb prendre kion-3d` (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
|
||||||
|
|||||||
92
app.blade.php
Normal file
92
app.blade.php
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
{{-- PL0XION kion-3d 🔷 — LES PREMIERS KIONS & XERKIONS EN 3D (rs-4, RS-7 : « fais les premiers kions
|
||||||
|
et xerkions, des ploxions de test pour voir si on peut améliorer le UI en 3D »). Sur le terrain
|
||||||
|
jOS3D : la rangée des premiers kions (koin/3kion/4kion=xer/6kion/wormion) qui tournent + un
|
||||||
|
XERKION 3D radial (octogone + 8 koins cliquables = un LANCEUR 3D). Survol = le koin se lève et
|
||||||
|
brille ; clic = ouvre le ploxion. Test d'UI 3D interactive (raycast). Réutilise jOS3D. --}}
|
||||||
|
<style>
|
||||||
|
.k3{display:flex;flex-direction:column;height:100%;background:#05070e;color:#dfe7ff;font-family:var(--xr-font-ui,ui-sans-serif,system-ui);overflow:hidden}
|
||||||
|
.k3__stage{flex:1;min-height:0;position:relative}
|
||||||
|
.k3__stage canvas{width:100%;height:100%;display:block;touch-action:none}
|
||||||
|
.k3__hud{position:absolute;left:10px;top:8px;font:.72rem ui-monospace,monospace;color:#9fb0e0;background:rgba(5,7,14,.5);padding:4px 9px;border-radius:7px;pointer-events:none}
|
||||||
|
.k3__msg{flex:0 0 auto;padding:8px 12px;border-top:1px solid #17233c;font-size:.72rem;color:#9fb0e0}
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
'use strict';
|
||||||
|
var KOINS = [
|
||||||
|
{ app: 'home', label: 'accueil', icon: '🏠' }, { app: 'notes', label: 'notes', icon: '📝' },
|
||||||
|
{ app: 'social', label: 'social', icon: '🎉' }, { app: 'machine', label: 'tsoins', icon: '⧗' },
|
||||||
|
{ app: 'beats', label: 'beats', icon: '🥁' }, { app: 'spiderion-sim', label: 'spider', icon: '🕷️' },
|
||||||
|
{ app: 'vue-3d', label: '3D', icon: '🧊' }, { app: 'trouver', label: 'trouver', icon: '⚡' }
|
||||||
|
];
|
||||||
|
function describe() {
|
||||||
|
return { v: 1, id: 'kion-3d', title: 'Kions 3D', icon: '🔷', items: [
|
||||||
|
{ p: 1, kind: 'stat', label: 'lanceur radial 3D', value: KOINS.length + ' koins' }
|
||||||
|
] };
|
||||||
|
}
|
||||||
|
function mount(container) {
|
||||||
|
container.innerHTML = '<div class="k3"><div class="k3__stage"><canvas></canvas><div class="k3__hud" data-hud>chargement 3D…</div></div>'
|
||||||
|
+ '<div class="k3__msg" data-msg>un XERKION en 3D = un lanceur radial. Survole un koin (il se lève), clique pour ouvrir. Glisse = tourner.</div></div>';
|
||||||
|
var cv = container.querySelector('canvas'), hud = container.querySelector('[data-hud]'), msg = container.querySelector('[data-msg]');
|
||||||
|
if (!window.jOS3D) { hud.textContent = 'jOS3D absent.'; return { unmount: function () { container.innerHTML = ''; } }; }
|
||||||
|
var pick = [], hovered = null, ray = null, ndc = null, hoverName = '';
|
||||||
|
|
||||||
|
var world = jOS3D.world(cv, { targetY: 3, dist: 30, groundColor: 0x0a1628,
|
||||||
|
onReady: function (w) { build(w); },
|
||||||
|
onFrame: function (dt, w) { tick(dt, w); },
|
||||||
|
onError: function () { hud.textContent = '3D indisponible (Three.js non chargé).'; }
|
||||||
|
});
|
||||||
|
|
||||||
|
function build(w) {
|
||||||
|
var T = w.THREE; ray = new T.Raycaster(); ndc = new T.Vector2(); hud.textContent = 'xerkion 3D · ' + KOINS.length + ' koins';
|
||||||
|
function mat(c, e) { return new T.MeshStandardMaterial({ color: c, metalness: .35, roughness: .45, emissive: e || c, emissiveIntensity: .15 }); }
|
||||||
|
|
||||||
|
// ---- les PREMIERS KIONS (rangée du haut, décoratifs, tournent) ----
|
||||||
|
var firsts = [
|
||||||
|
{ g: new T.TetrahedronGeometry(1.5), n: 'koin (△)' },
|
||||||
|
{ g: new T.CylinderGeometry(1.5, 1.5, 1.2, 3), n: '3kion' },
|
||||||
|
{ g: new T.BoxGeometry(2.2, 2.2, 2.2), n: '4kion = xer (▢)' },
|
||||||
|
{ g: new T.CylinderGeometry(1.6, 1.6, 1.2, 6), n: '6kion' },
|
||||||
|
{ g: new T.TorusGeometry(1.3, 0.5, 14, 30), n: 'wormion (○)' },
|
||||||
|
{ g: new T.OctahedronGeometry(1.6), n: 'kion' }
|
||||||
|
];
|
||||||
|
firsts.forEach(function (f, i) { var m = new T.Mesh(f.g, mat(0x8f7bff, 0x2a1f6a)); m.position.set((i - (firsts.length - 1) / 2) * 4.4, 11, 0); m.castShadow = true; m.userData = { first: true, name: f.n, base: m.position.y }; w.add(m); pick.push(m); });
|
||||||
|
|
||||||
|
// ---- le XERKION 3D : octogone central + 8 koins = un LANCEUR RADIAL ----
|
||||||
|
var octo = new T.Mesh(new T.CylinderGeometry(5, 5.4, 1.4, 8), mat(0x14263c, 0x0a1a2c)); octo.position.y = 2; octo.castShadow = true; octo.receiveShadow = true; w.add(octo);
|
||||||
|
var glyph = new T.Mesh(new T.OctahedronGeometry(1.6), mat(0x5fe0c0, 0x145040)); glyph.position.y = 3.4; w.add(glyph); octo._glyph = glyph;
|
||||||
|
KOINS.forEach(function (k, i) { var a = i / KOINS.length * Math.PI * 2 - Math.PI / 2;
|
||||||
|
var koin = new T.Mesh(new T.TetrahedronGeometry(1.15), mat(0x2b6f5f, 0x0e3b30));
|
||||||
|
koin.position.set(Math.cos(a) * 5.6, 2.6, Math.sin(a) * 5.6); koin.rotation.y = -a; koin.castShadow = true;
|
||||||
|
koin.userData = { koin: true, app: k.app, label: k.label, icon: k.icon, base: 2.6, ang: a }; w.add(koin); pick.push(koin);
|
||||||
|
});
|
||||||
|
world._octo = octo;
|
||||||
|
|
||||||
|
// raycast hover + clic
|
||||||
|
function setNdc(e) { var r = cv.getBoundingClientRect(); ndc.x = (e.clientX - r.left) / r.width * 2 - 1; ndc.y = -((e.clientY - r.top) / r.height * 2 - 1); }
|
||||||
|
cv.addEventListener('pointermove', function (e) { setNdc(e); ray.setFromCamera(ndc, w.camera); var hit = ray.intersectObjects(pick)[0];
|
||||||
|
hovered = hit ? hit.object : null; hoverName = hovered ? (hovered.userData.icon ? hovered.userData.icon + ' ' + hovered.userData.label : hovered.userData.name) : '';
|
||||||
|
cv.style.cursor = hovered && hovered.userData.koin ? 'pointer' : 'grab'; });
|
||||||
|
cv.addEventListener('click', function (e) { setNdc(e); ray.setFromCamera(ndc, w.camera); var hit = ray.intersectObjects(pick)[0];
|
||||||
|
if (hit && hit.object.userData.koin) { var app = hit.object.userData.app; msg.textContent = '→ ouverture de « ' + hit.object.userData.label +' »';
|
||||||
|
try { window.jOSPorts && jOSPorts.emit('kion', 'select', { app: app }); } catch (x) {}
|
||||||
|
try { window.jOS && jOS.openPloxion && jOS.openPloxion(app); } catch (x) {} }
|
||||||
|
else if (hit && hit.object.userData.first) { msg.textContent = hit.object.userData.name; } });
|
||||||
|
}
|
||||||
|
|
||||||
|
function tick(dt, w) {
|
||||||
|
for (var i = 0; i < pick.length; i++) { var m = pick[i], u = m.userData;
|
||||||
|
if (u.first) { m.rotation.y += dt * 0.7; m.rotation.x += dt * 0.25; m.position.y = u.base + Math.sin(performance.now() / 700 + i) * 0.3; }
|
||||||
|
if (u.koin) { var lift = (m === hovered) ? 1.2 : 0; m.position.y += ((u.base + lift) - m.position.y) * Math.min(1, dt * 8);
|
||||||
|
m.material.emissiveIntensity += (((m === hovered) ? 0.7 : 0.15) - m.material.emissiveIntensity) * Math.min(1, dt * 8);
|
||||||
|
m.rotation.y += dt * 0.4; }
|
||||||
|
}
|
||||||
|
if (w._octo) { w._octo.rotation.y += dt * 0.15; if (w._octo._glyph) { w._octo._glyph.rotation.y -= dt * 0.5; w._octo._glyph.position.y = 3.4 + Math.sin(performance.now() / 500) * 0.2; } }
|
||||||
|
hud.textContent = hoverName || 'xerkion 3D · survole un koin';
|
||||||
|
}
|
||||||
|
return { unmount: function () { try { world.dispose(); } catch (e) {} container.innerHTML = ''; } };
|
||||||
|
}
|
||||||
|
window.jOSApps = window.jOSApps || {};
|
||||||
|
window.jOSApps['kion-3d'] = { manifest: { id: 'kion-3d', name: 'Kions 3D', icon: '🔷' }, mount: mount, describe: describe };
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user