Metaprime commited on
Commit
e2688af
ยท
verified ยท
1 Parent(s): ce52a6a

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +92 -13
index.html CHANGED
@@ -1,20 +1,45 @@
1
-
2
  <html>
3
  <head>
4
  <meta charset="utf-8">
5
  <title>Holodeck</title>
6
  <script src="https://aframe.io/releases/1.6.0/aframe.min.js"></script>
7
  <style>
8
- body { margin:0; overflow:hidden; background:#000; }
9
- #bead { position:fixed; bottom:35px; left:30px; width:38px; height:38px; background:rgba(255,30,30,0.08); border:2px solid #ff3366; border-radius:50%; box-shadow:0 0 18px #ff3366, 0 0 35px #ff3366, inset 0 0 12px rgba(255,255,255,0.3); z-index:1000; cursor:pointer; }
10
- #panel { position:fixed; bottom:88px; left:22px; width:205px; background:rgba(20,0,10,0.75); backdrop-filter:blur(18px); border:2px solid #ff3366; box-shadow:0 0 25px #ff3366, 0 0 45px #ff3366; border-radius:16px; padding:12px; display:none; flex-direction:column; gap:8px; z-index:1002; }
11
- button { background:rgba(255,50,50,0.08); color:#ff99aa; border:1px solid #ff3366; box-shadow:0 0 12px #ff3366; padding:11px 12px; border-radius:10px; font-size:15px; margin:4px 0; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  </style>
13
  </head>
14
  <body>
15
 
16
- <a-scene background="color: #000000">
17
- <a-sky id="sky" src="galaxy.jpg"></a-sky>
18
  </a-scene>
19
 
20
  <div id="bead" onclick="togglePanel()"></div>
@@ -22,26 +47,80 @@
22
  <div id="panel">
23
  <button onclick="launchSky()">๐ŸŒŒ Sky Launcher</button>
24
  <button onclick="pickScreenMedia()">๐Ÿ“บ Change Screen Media</button>
 
 
 
 
 
25
  </div>
26
 
 
 
27
  <input type="file" id="skyInput" accept="image/*,video/*" style="display:none;">
 
28
 
29
  <script>
 
 
 
 
30
  function togglePanel() {
31
- const p = document.getElementById('panel');
32
- p.style.display = p.style.display === 'flex' ? 'none' : 'flex';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  }
34
 
35
- function launchSky() {
36
- document.getElementById('skyInput').click();
37
  }
38
 
 
39
  document.getElementById('skyInput').addEventListener('change', function(e) {
40
  const file = e.target.files[0];
41
  if (!file) return;
42
-
43
  const url = URL.createObjectURL(file);
44
- document.getElementById('sky').setAttribute('src', url);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  });
46
  </script>
47
  </body>
 
1
+ <!DOCTYPE html>
2
  <html>
3
  <head>
4
  <meta charset="utf-8">
5
  <title>Holodeck</title>
6
  <script src="https://aframe.io/releases/1.6.0/aframe.min.js"></script>
7
  <style>
8
+ #bead {
9
+ position:fixed; bottom:35px; left:30px; width:38px; height:38px;
10
+ background:rgba(255,30,30,0.08); border:2px solid #ff3366; border-radius:50%;
11
+ box-shadow:0 0 18px #ff3366, 0 0 35px #ff3366, inset 0 0 12px rgba(255,255,255,0.3);
12
+ z-index:1000; cursor:pointer;
13
+ }
14
+ #panel {
15
+ position:fixed; bottom:88px; left:22px; width:205px;
16
+ background:rgba(20,0,10,0.85); backdrop-filter:blur(18px);
17
+ border:2px solid #ff3366; box-shadow:0 0 25px #ff3366, 0 0 45px #ff3366;
18
+ border-radius:16px; padding:12px; display:none; flex-direction:column; gap:8px;
19
+ z-index:1002;
20
+ }
21
+ button {
22
+ background:rgba(255,50,50,0.08);
23
+ color:#ff99aa;
24
+ border:1px solid #ff3366;
25
+ box-shadow:0 0 12px #ff3366;
26
+ padding:11px 12px;
27
+ border-radius:10px;
28
+ font-size:15px;
29
+ margin: 4px 0;
30
+ text-align:left;
31
+ }
32
+ .vr-btn {
33
+ position:fixed; bottom:30px; right:30px; padding:10px 20px;
34
+ background:rgba(255,255,255,0.15); color:white; border:2px solid white;
35
+ border-radius:8px; font-size:15px; z-index:1010;
36
+ }
37
  </style>
38
  </head>
39
  <body>
40
 
41
+ <a-scene background="color: #000000" xr-mode-ui="enabled: true">
42
+ <a-sky id="sky" src="galaxy.jpg" material="side: back"></a-sky>
43
  </a-scene>
44
 
45
  <div id="bead" onclick="togglePanel()"></div>
 
47
  <div id="panel">
48
  <button onclick="launchSky()">๐ŸŒŒ Sky Launcher</button>
49
  <button onclick="pickScreenMedia()">๐Ÿ“บ Change Screen Media</button>
50
+ <button onclick="playSky()">โ–ถ๏ธ Play</button>
51
+ <button onclick="pauseSky()">โธ๏ธ Pause</button>
52
+ <button onclick="toggleMute()">๐Ÿ”‡ Mute / Unmute</button>
53
+ <button onclick="openAIChat()">๐Ÿ’ฌ AI Chat</button>
54
+ <button onclick="openKnowledge()">๐Ÿ“– Knowledge</button>
55
  </div>
56
 
57
+ <button class="vr-btn" onclick="enterVR()">VR</button>
58
+
59
  <input type="file" id="skyInput" accept="image/*,video/*" style="display:none;">
60
+ <input type="file" id="screenInput" accept="video/*,image/*" style="display:none;">
61
 
62
  <script>
63
+ let skyVideo = null;
64
+ const screenVideo = document.getElementById('myVideo');
65
+ const container = document.getElementById('videoContainer');
66
+
67
  function togglePanel() {
68
+ const panel = document.getElementById('panel');
69
+ panel.style.display = (panel.style.display === 'flex') ? 'none' : 'flex';
70
+ }
71
+
72
+ function launchSky() { document.getElementById('skyInput').click(); }
73
+ function pickScreenMedia() { document.getElementById('screenInput').click(); }
74
+ function playSky() { if (skyVideo) skyVideo.play(); }
75
+ function pauseSky() { if (skyVideo) skyVideo.pause(); }
76
+ function toggleMute() {
77
+ if (skyVideo) skyVideo.muted = !skyVideo.muted;
78
+ else if (screenVideo) screenVideo.muted = !screenVideo.muted;
79
+ }
80
+
81
+ function enterVR() {
82
+ const scene = document.querySelector('a-scene');
83
+ if (scene) scene.enterVR();
84
+ }
85
+
86
+ function openAIChat() {
87
+ alert("AI Chat button - we'll wire this to your server later");
88
  }
89
 
90
+ function openKnowledge() {
91
+ alert("Knowledge button - we'll wire this to your server later");
92
  }
93
 
94
+ // Sky Launcher
95
  document.getElementById('skyInput').addEventListener('change', function(e) {
96
  const file = e.target.files[0];
97
  if (!file) return;
 
98
  const url = URL.createObjectURL(file);
99
+ const sky = document.getElementById('sky');
100
+ const isVideo = file.type.startsWith('video/');
101
+
102
+ if (isVideo) {
103
+ if (skyVideo) skyVideo.pause();
104
+ skyVideo = document.createElement('video');
105
+ skyVideo.src = url;
106
+ skyVideo.loop = true;
107
+ skyVideo.muted = true;
108
+ skyVideo.style.display = 'none';
109
+ document.body.appendChild(skyVideo);
110
+
111
+ skyVideo.onloadeddata = () => {
112
+ const mesh = sky.getObject3D('mesh');
113
+ if (mesh && mesh.material) {
114
+ const texture = new THREE.VideoTexture(skyVideo);
115
+ texture.mapping = THREE.EquirectangularReflectionMapping;
116
+ mesh.material.map = texture;
117
+ mesh.material.needsUpdate = true;
118
+ skyVideo.play();
119
+ }
120
+ };
121
+ } else {
122
+ sky.setAttribute('src', url);
123
+ }
124
  });
125
  </script>
126
  </body>