onenoly11 commited on
Commit
cf23d29
·
verified ·
1 Parent(s): 600a9e0

Upload Index.hrml.txt

Browse files
Files changed (1) hide show
  1. Index.hrml.txt +63 -0
Index.hrml.txt ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
6
+ <title>PiForge</title>
7
+ <link rel="manifest" href="data:application/manifest+json;base64,[base64-encoded manifest below]">
8
+ <style>
9
+ body { font-family: -apple-system, sans-serif; background: linear-gradient(red, yellow); color: white; text-align: center; margin: 0; padding: 20px; touch-action: manipulation; }
10
+ #iframe-container { width: 100%; height: 70vh; border: none; }
11
+ #status { margin: 10px; padding: 15px; background: rgba(0,0,0,0.5); border-radius: 10px; font-size: 16px; }
12
+ button { background: #ff6b35; color: white; border: none; padding: 15px 30px; border-radius: 10px; cursor: pointer; font-size: 18px; min-height: 50px; width: 90%; margin: 10px auto; display: block; }
13
+ @media (max-width: 414px) { button { font-size: 20px; padding: 20px; } } /* iPhone boost */
14
+ </style>
15
+ </head>
16
+ <body>
17
+ <h1>🔨 PiForge V1.2</h1>
18
+ <p>Ethical Audit for Pi</p>
19
+ <div id="status">Tap to Start</div>
20
+ <button id="auth-btn">🔗 Entangle & Mine</button>
21
+ <iframe id="hf-iframe" src="https://onenoly11-piforge.hf.space" sandbox="allow-scripts allow-same-origin" style="display: none;"></iframe>
22
+
23
+ <!-- Inline Pi SDK & Integration (no external loads for iPhone speed) -->
24
+ <script>
25
+ // Pi SDK (lite version for iOS)
26
+ window.Pi = { init: async (opts) => { /* Simulate init for demo; real: load via Pi app */ return { version: '2.0' }; }, authenticate: async (scopes) => ({ user: { username: 'iPhoneUser' } }) };
27
+
28
+ document.addEventListener('DOMContentLoaded', () => {
29
+ document.getElementById('status').textContent = 'Pi Ready on iPhone!';
30
+ document.getElementById('auth-btn').style.display = 'block';
31
+ // Touch gesture for viz swipe
32
+ let touchStartX = 0;
33
+ document.addEventListener('touchstart', e => touchStartX = e.touches[0].clientX);
34
+ document.addEventListener('touchend', e => {
35
+ const deltaX = e.changedTouches[0].clientX - touchStartX;
36
+ if (Math.abs(deltaX) > 50) { /* Swipe to trigger resonance */ alert('Resonance Activated! +15% Boost'); }
37
+ });
38
+ });
39
+
40
+ document.getElementById('auth-btn').addEventListener('touchstart', async (e) => { // Touch-optimized
41
+ e.preventDefault();
42
+ try {
43
+ const authResult = await Pi.authenticate(['username']);
44
+ document.getElementById('status').textContent = `Hi, ${authResult.user.username}! Audit Loading...`;
45
+ document.getElementById('hf-iframe').style.display = 'block';
46
+ // Post to HF (iPhone-safe)
47
+ setTimeout(() => {
48
+ const iframe = document.getElementById('hf-iframe');
49
+ iframe.contentWindow.postMessage({ type: 'init_audit', user: authResult.user }, '*');
50
+ }, 500);
51
+ } catch (err) { document.getElementById('status').textContent = 'Tap Pi App to Auth'; }
52
+ });
53
+
54
+ window.addEventListener('message', (event) => {
55
+ if (event.data.type === 'ethical_audit_complete' && event.data.results.resonance >= 691) {
56
+ document.getElementById('status').textContent = `Score: ${event.data.results.ethical_score} | Boost: +15% Mining!`;
57
+ // iPhone haptic feedback (if supported)
58
+ if (navigator.vibrate) navigator.vibrate(200);
59
+ }
60
+ });
61
+ </script>
62
+ </body>
63
+ </html>