mirror of
https://git.j0bot.ch/admin_j0bot/ploxion-ios.git
synced 2026-11-29 06:45:12 +00:00
synchro du labo (0bf0da65) : app.blade.php, README.md
This commit is contained in:
parent
3c20699c00
commit
08c4ce5a72
22
README.md
22
README.md
@ -1,3 +1,21 @@
|
||||
# ploxion-ios
|
||||
# 🍏 iOS
|
||||
|
||||
PLOXION · Les capacités natives iOS dans le xerboxion : installer sur l'écran d'accueil, partage natif, écran allumé (wake lock), scanner à la caméra, notifications push, safe-areas. Panneau de contrôle + test, via le bion jOSiOS. · fournit: ios, partage, camera, push, install, wakelock
|
||||
Les capacités natives iOS dans le xerboxion : installer sur l'écran d'accueil, partage natif, écran allumé (wake lock), scanner à la caméra, notifications push, safe-areas. Panneau de contrôle + test, via le bion jOSiOS.
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| id | `ios` |
|
||||
| fournit | `ios` `partage` `camera` `push` `install` `wakelock` |
|
||||
| bions qu'il nomme | `jOSApps` |
|
||||
| fichiers | `app.blade.php` |
|
||||
| dans le labo | `resources/views/ploxions/ios/` (dépôt `my_website2`) |
|
||||
|
||||
## Contribuer
|
||||
|
||||
- **Dans le xer** : https://labo.j0bot.ch/px/atelier?ploxion=ios — prends-le, modifie-le, vois-le tourner, « ⧗ envoyer le tsoin ».
|
||||
- **Dans VS Code** : `xb prendre ios` (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 @@
|
||||
{{-- Ploxion iOS 🍏 — showcase + panneau de contrôle des capacités iOS (jOSiOS).
|
||||
Chaque capacité = un bouton + un badge dispo/indispo + un retour live. Tout
|
||||
passe par window.jOSiOS (feature-détecté, ne casse rien hors iOS). --}}
|
||||
<style>
|
||||
.iosx { display:flex; flex-direction:column; gap:12px; height:100%; overflow:auto; padding:14px;
|
||||
background:#070b13; color:#e7eefb; font-family:ui-sans-serif,system-ui,-apple-system,sans-serif; -webkit-overflow-scrolling:touch; }
|
||||
.iosx__hd { display:flex; align-items:baseline; gap:9px; flex-wrap:wrap; }
|
||||
.iosx__hd b { font-size:1.15rem; }
|
||||
.iosx__sub { font-size:.78rem; color:#8ea6c8; }
|
||||
.iosx__state { display:flex; flex-wrap:wrap; gap:7px; font-size:.72rem; }
|
||||
.iosx__state span { background:rgba(120,160,230,.12); border:1px solid rgba(120,160,230,.22); border-radius:8px; padding:4px 9px; color:#bcd2f2; }
|
||||
.iosx__grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(155px,1fr)); gap:10px; }
|
||||
.iosx__c { text-align:left; cursor:pointer; display:flex; flex-direction:column; gap:3px; padding:12px; border-radius:13px;
|
||||
background:rgba(14,22,38,.7); border:1px solid rgba(120,160,230,.2); color:inherit; font:inherit; position:relative; }
|
||||
.iosx__c:hover { border-color:rgba(120,160,230,.45); }
|
||||
.iosx__c.active { border-color:#3fe0d0; background:rgba(63,224,208,.12); }
|
||||
.iosx__ic { font-size:1.4rem; }
|
||||
.iosx__c b { font-size:.9rem; }
|
||||
.iosx__d { font-size:.68rem; color:#8ea6c8; line-height:1.35; }
|
||||
.iosx__b { align-self:flex-start; margin-top:5px; font-size:.58rem; text-transform:uppercase; letter-spacing:.04em; padding:2px 7px; border-radius:6px; }
|
||||
.iosx__b.on { background:rgba(0,255,159,.15); color:#7effc0; border:1px solid rgba(0,255,159,.3); }
|
||||
.iosx__b.off { background:rgba(255,120,120,.12); color:#ffb0b0; border:1px solid rgba(255,120,120,.28); }
|
||||
.iosx__shot { max-width:180px; border-radius:11px; border:1px solid rgba(120,160,230,.3); display:block; }
|
||||
.iosx__out { font-size:.8rem; color:#9fd; min-height:1.2em; padding:2px 0; }
|
||||
</style>
|
||||
<script>
|
||||
(function () {
|
||||
function badge(ok) { return '<span class="iosx__b ' + (ok ? 'on' : 'off') + '">' + (ok ? 'dispo' : 'indispo') + '</span>'; }
|
||||
|
||||
function mount(container) {
|
||||
var ios = window.jOSiOS || null;
|
||||
container.innerHTML = '';
|
||||
var root = document.createElement('div'); root.className = 'iosx'; container.appendChild(root);
|
||||
var sa = ios ? ios.safeArea() : { top: 0, right: 0, bottom: 0, left: 0 };
|
||||
|
||||
function card(ic, t, d, act, ok) {
|
||||
return '<button type="button" class="iosx__c" data-act="' + act + '"><span class="iosx__ic">' + ic + '</span><b>' + t + '</b><span class="iosx__d">' + d + '</span>' + badge(ok) + '</button>';
|
||||
}
|
||||
|
||||
root.innerHTML =
|
||||
'<div class="iosx__hd"><b>🍏 iOS</b><span class="iosx__sub">les capacités natives, dans le xerboxion</span></div>'
|
||||
+ '<div class="iosx__state">'
|
||||
+ '<span>' + (ios && ios.isIOS() ? '📱 iPhone / iPad' : '🖥 pas iOS') + '</span>'
|
||||
+ '<span>' + (ios && ios.isStandalone() ? '✓ installé · plein écran' : '🌐 dans le navigateur') + '</span>'
|
||||
+ '<span>encoche ' + Math.round(sa.top) + 'px · bas ' + Math.round(sa.bottom) + 'px</span>'
|
||||
+ '</div>'
|
||||
+ '<div class="iosx__grid">'
|
||||
+ card('📲', 'Installer', 'Sur l\'écran d\'accueil, plein écran comme une app', 'install', !!(ios && ios.canInstall()))
|
||||
+ card('📤', 'Partager', 'Ouvre la feuille de partage native', 'share', !!(ios && ios.canShare()))
|
||||
+ card('☀️', 'Écran allumé', 'Garde l\'écran allumé (recette, présentation)', 'wake', !!(ios && ios.wakeSupported()))
|
||||
+ card('📷', 'Scanner', 'Prend une photo via l\'appareil (reçu, doc)', 'scan', true)
|
||||
+ card('🔔', 'Notifications', 'Push, même app fermée', 'push', !!(ios && ios.pushSupported()))
|
||||
+ card('📳', 'Vibrer', 'Retour haptique (Android ; iOS ne l\'expose pas)', 'vibe', !!navigator.vibrate)
|
||||
+ '</div>'
|
||||
+ '<div class="iosx__out" data-out>Touche une carte pour tester la capacité.</div>';
|
||||
|
||||
var out = root.querySelector('[data-out]');
|
||||
function say(m) { out.textContent = m; }
|
||||
var waking = false;
|
||||
|
||||
function showImg(f) {
|
||||
try {
|
||||
var url = URL.createObjectURL(f);
|
||||
var img = root.querySelector('.iosx__shot');
|
||||
if (!img) { img = document.createElement('img'); img.className = 'iosx__shot'; out.parentNode.insertBefore(img, out); }
|
||||
img.src = url;
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
root.querySelectorAll('[data-act]').forEach(function (b) {
|
||||
b.addEventListener('click', function () {
|
||||
var a = b.getAttribute('data-act');
|
||||
if (!ios) { say('jOSiOS indisponible sur cette page.'); return; }
|
||||
if (a === 'install') { ios.install().then(function (ok) { say(ok ? '✓ installé' : 'suis les instructions à l\'écran'); }); }
|
||||
else if (a === 'share') { ios.share({ title: 'XERBOXION', text: 'Un OS, un jeu, le zoom infini.', url: location.origin }).then(function (ok) { say(ok ? '✓ partagé' : 'copié dans le presse-papier (ou annulé)'); }); }
|
||||
else if (a === 'wake') {
|
||||
if (!waking) { ios.wake().then(function (ok) { waking = ok; b.classList.toggle('active', ok); say(ok ? '☀️ écran gardé allumé' : 'wake lock indisponible ici'); }); }
|
||||
else { ios.releaseWake(); waking = false; b.classList.remove('active'); say('écran relâché'); }
|
||||
}
|
||||
else if (a === 'scan') { ios.capture().then(function (f) { if (f) { showImg(f); say('📷 ' + f.name + ' · ' + Math.round(f.size / 1024) + ' Ko'); } else { say('annulé'); } }); }
|
||||
else if (a === 'push') { ios.enablePush().then(function (ok) { say(ok ? '🔔 notifications activées' : 'refusé ou indisponible (installe la PWA pour iOS)'); if (ok) { ios.notify('XERBOXION', 'Notifications activées 🎉'); } }); }
|
||||
else if (a === 'vibe') { var ok = ios.vibrate(25); say(ok ? '📳 vibré' : 'vibration non exposée par iOS Safari'); }
|
||||
});
|
||||
});
|
||||
|
||||
return { unmount: function () { try { if (ios) ios.releaseWake(); } catch (e) {} container.innerHTML = ''; } };
|
||||
}
|
||||
|
||||
window.jOSApps = window.jOSApps || {};
|
||||
window.jOSApps['ios'] = { manifest: { id: 'ios', name: 'iOS', icon: '🍏' }, mount: mount };
|
||||
})();
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user