mirror of
https://git.j0bot.ch/admin_j0bot/ploxion-random.git
synced 2026-11-29 07:05:09 +00:00
synchro du labo (0bf0da65) : app.blade.php, README.md
This commit is contained in:
parent
0ef313ddf7
commit
7aa296ecb1
22
README.md
22
README.md
@ -1,3 +1,21 @@
|
||||
# ploxion-random
|
||||
# 🎲 Random
|
||||
|
||||
PLOXION · Ouvre un ploxion au hasard — la machine à sous du xerboxion. Laisse-toi surprendre. · fournit: random, discover, game
|
||||
Ouvre un ploxion au hasard — la machine à sous du xerboxion. Laisse-toi surprendre.
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| id | `random` |
|
||||
| fournit | `random` `discover` `game` |
|
||||
| bions qu'il nomme | `jOSApps` `jOSGame` `jOSMobile` `jOSOp` |
|
||||
| fichiers | `app.blade.php` |
|
||||
| dans le labo | `resources/views/ploxions/random/` (dépôt `my_website2`) |
|
||||
|
||||
## Contribuer
|
||||
|
||||
- **Dans le xer** : https://labo.j0bot.ch/px/atelier?ploxion=random — prends-le, modifie-le, vois-le tourner, « ⧗ envoyer le tsoin ».
|
||||
- **Dans VS Code** : `xb prendre random` (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
|
||||
|
||||
75
app.blade.php
Normal file
75
app.blade.php
Normal file
@ -0,0 +1,75 @@
|
||||
{{-- PL0XI0N random 🎲 — RS-7 : « il faut un ploxion random, ça m'ouvre un ploxion au hasard ». Machine à
|
||||
sous : défile les ploxions du registre, ralentit, tombe sur un → l'ouvre (séquence d'ouverture
|
||||
canonique). Exclut les admin si pas admin, les idées/stubs, et lui-même. Fun de découverte. --}}
|
||||
<style>
|
||||
.px-rd{display:flex;flex-direction:column;height:100%;background:radial-gradient(circle at 50% 20%,#1a2140,#06080f 72%);color:var(--xr-text,#e8ecf8);font-family:var(--xr-font-ui,ui-sans-serif,system-ui);align-items:center;justify-content:center;gap:18px;padding:20px}
|
||||
.px-rd .slot{width:min(300px,86vw);background:linear-gradient(160deg,rgba(30,40,70,.7),rgba(14,18,34,.9));border:1px solid rgba(120,160,230,.3);border-radius:20px;padding:30px 18px;text-align:center;box-shadow:0 16px 50px #000a}
|
||||
.px-rd .slot .ic{font-size:4rem;line-height:1;transition:transform .05s}
|
||||
.px-rd .slot .nm{font-size:1.4rem;font-weight:800;color:#fff;margin-top:10px;min-height:1.4em}
|
||||
.px-rd .slot .cat{font-size:.7rem;color:var(--xr-muted,#8aa0c8);margin-top:3px}
|
||||
.px-rd .btn{width:min(300px,86vw);padding:15px;border:0;border-radius:13px;background:linear-gradient(135deg,#6a2ad0,#b04aff);color:#fff;font-weight:800;font-size:1.1rem;cursor:pointer;box-shadow:0 8px 24px #0008}
|
||||
.px-rd .btn:disabled{opacity:.6}
|
||||
.px-rd .open{background:linear-gradient(135deg,#1a3a7a,#2a5ad0);display:none}
|
||||
.px-rd .open.on{display:block}
|
||||
.px-rd .hint{font-size:.66rem;color:#5a6a90}
|
||||
</style>
|
||||
<script>
|
||||
(function () {
|
||||
'use strict';
|
||||
function mount(container, ctx) {
|
||||
container.innerHTML =
|
||||
'<div class="px-rd">' +
|
||||
'<div class="slot"><div class="ic" data-ic>🎲</div><div class="nm" data-nm>Ploxion au hasard</div><div class="cat" data-cat></div></div>' +
|
||||
'<button class="btn" data-roll>🎲 Ouvre un ploxion au hasard</button>' +
|
||||
'<button class="btn open" data-open>▶ Ouvrir</button>' +
|
||||
'<div class="hint">le xerboxion te surprend</div>' +
|
||||
'</div>';
|
||||
var root = container.querySelector('.px-rd');
|
||||
var icEl = root.querySelector('[data-ic]'), nmEl = root.querySelector('[data-nm]'), catEl = root.querySelector('[data-cat]');
|
||||
var rollBtn = root.querySelector('[data-roll]'), openBtn = root.querySelector('[data-open]');
|
||||
var pool = [], picked = null, rolling = false, aborted = false;
|
||||
|
||||
function isAdmin() { var m = document.querySelector('meta[name="user-admin"]'); return m && m.content === '1'; }
|
||||
fetch('/px/registry.json', { cache: 'no-store' }).then(function (r) { return r.ok ? r.json() : null; }).then(function (d) {
|
||||
if (aborted || !d) return;
|
||||
var adm = isAdmin();
|
||||
pool = (d.ploxions || []).filter(function (p) {
|
||||
if (p.status !== 'live') return false;
|
||||
if (p.id === 'random' || p.id === 'ideas') return false;
|
||||
if (p.admin && !adm) return false;
|
||||
return true;
|
||||
});
|
||||
}).catch(function () {});
|
||||
|
||||
function openPx(p) {
|
||||
try { if (window.jOSOp && window.jOSOp.openPloxion) { var r = window.jOSOp.openPloxion(p.id); if (r && r.ok) return; } } catch (e) {}
|
||||
try { if (window.jOSMobile && window.jOSMobile.open && window.jOSMobile.open(p.id, p.name)) return; } catch (e) {}
|
||||
try { if (window.jOS && window.jOS.openPloxion && window.jOS.openPloxion(p.id)) return; } catch (e) {}
|
||||
location.href = '/local#px=' + encodeURIComponent(p.id);
|
||||
}
|
||||
|
||||
function paint(p) { icEl.textContent = p.icon || '▣'; nmEl.textContent = p.name || p.id; catEl.textContent = p.cat_label || ''; }
|
||||
|
||||
rollBtn.onclick = function () {
|
||||
if (rolling || !pool.length) return;
|
||||
rolling = true; openBtn.classList.remove('on'); rollBtn.disabled = true;
|
||||
var n = 0, total = 22 + Math.floor(Math.random() * 10), delay = 45;
|
||||
(function tick() {
|
||||
if (aborted) return;
|
||||
var p = pool[Math.floor(Math.random() * pool.length)]; paint(p); picked = p;
|
||||
icEl.style.transform = 'scale(1.1)'; setTimeout(function () { icEl.style.transform = ''; }, 40);
|
||||
if (navigator.vibrate) navigator.vibrate(5);
|
||||
n++;
|
||||
if (n < total) { delay = n > total - 8 ? delay * 1.28 : delay; setTimeout(tick, delay); }
|
||||
else { rolling = false; rollBtn.disabled = false; openBtn.classList.add('on'); if (navigator.vibrate) navigator.vibrate([20, 40, 20]);
|
||||
try { if (window.jOSGame && window.jOSGame.event) window.jOSGame.event('open', picked.id); } catch (e) {} }
|
||||
})();
|
||||
};
|
||||
openBtn.onclick = function () { if (picked) openPx(picked); };
|
||||
|
||||
return { unmount: function () { aborted = true; container.innerHTML = ''; } };
|
||||
}
|
||||
window.jOSApps = window.jOSApps || {};
|
||||
window.jOSApps['random'] = { manifest: { id: 'random', name: 'Random', icon: '🎲' }, mount: mount };
|
||||
})();
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user