Update index.html
Browse files- index.html +136 -3
index.html
CHANGED
|
@@ -2,12 +2,145 @@
|
|
| 2 |
<html>
|
| 3 |
<head>
|
| 4 |
<meta charset="utf-8">
|
| 5 |
-
<title>
|
| 6 |
<script src="https://aframe.io/releases/1.6.0/aframe.min.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
</head>
|
| 8 |
<body>
|
| 9 |
-
|
| 10 |
-
|
|
|
|
| 11 |
</a-scene>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
</body>
|
| 13 |
</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:12px 14px;
|
| 27 |
+
border-radius:10px;
|
| 28 |
+
font-size:15px;
|
| 29 |
+
text-align:left;
|
| 30 |
+
}
|
| 31 |
+
#videoContainer {
|
| 32 |
+
position:fixed; bottom:170px; left:50%; transform:translateX(-50%);
|
| 33 |
+
width:90%; max-width:380px; display:none; z-index:1000;
|
| 34 |
+
background:rgba(0,0,0,0.85); border-radius:12px; padding:8px;
|
| 35 |
+
}
|
| 36 |
+
#myVideo { width:100%; border-radius:8px; }
|
| 37 |
+
.close-btn {
|
| 38 |
+
position:absolute; top:8px; right:8px; color:white; font-size:28px;
|
| 39 |
+
background:rgba(255,60,60,0.9); width:32px; height:32px; border-radius:50%;
|
| 40 |
+
display:flex; align-items:center; justify-content:center; z-index:1001;
|
| 41 |
+
}
|
| 42 |
+
</style>
|
| 43 |
</head>
|
| 44 |
<body>
|
| 45 |
+
|
| 46 |
+
<a-scene background="color: #000000">
|
| 47 |
+
<a-sky id="sky" src="galaxy.jpg"></a-sky>
|
| 48 |
</a-scene>
|
| 49 |
+
|
| 50 |
+
<div id="bead" onclick="togglePanel()"></div>
|
| 51 |
+
|
| 52 |
+
<div id="panel">
|
| 53 |
+
<button onclick="launchSky()">๐ Sky Launcher</button>
|
| 54 |
+
<button onclick="pickScreenMedia()">๐บ Change Screen Media</button>
|
| 55 |
+
<button onclick="playSky()">โถ๏ธ Play</button>
|
| 56 |
+
<button onclick="pauseSky()">โธ๏ธ Pause</button>
|
| 57 |
+
<button onclick="toggleMute()">๐ Mute / Unmute</button>
|
| 58 |
+
<button onclick="alert('AI Chat - Coming soon')">๐ฌ AI Chat</button>
|
| 59 |
+
<button onclick="alert('Knowledge Base - Coming soon')">๐ Knowledge</button>
|
| 60 |
+
</div>
|
| 61 |
+
|
| 62 |
+
<div id="videoContainer">
|
| 63 |
+
<div class="close-btn" onclick="closeVideo()">ร</div>
|
| 64 |
+
<video id="myVideo" controls loop></video>
|
| 65 |
+
</div>
|
| 66 |
+
|
| 67 |
+
<input type="file" id="skyInput" accept="image/*,video/*" style="display:none;">
|
| 68 |
+
<input type="file" id="screenInput" accept="video/*,image/*" style="display:none;">
|
| 69 |
+
|
| 70 |
+
<script>
|
| 71 |
+
let skyVideo = null;
|
| 72 |
+
const screenVideo = document.getElementById('myVideo');
|
| 73 |
+
const container = document.getElementById('videoContainer');
|
| 74 |
+
|
| 75 |
+
function togglePanel() {
|
| 76 |
+
const panel = document.getElementById('panel');
|
| 77 |
+
panel.style.display = panel.style.display === 'flex' ? 'none' : 'flex';
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
function launchSky() { document.getElementById('skyInput').click(); }
|
| 81 |
+
function pickScreenMedia() { document.getElementById('screenInput').click(); }
|
| 82 |
+
|
| 83 |
+
function playSky() {
|
| 84 |
+
if (skyVideo) skyVideo.play();
|
| 85 |
+
else screenVideo.play();
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
function pauseSky() {
|
| 89 |
+
if (skyVideo) skyVideo.pause();
|
| 90 |
+
else screenVideo.pause();
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
function toggleMute() {
|
| 94 |
+
if (skyVideo) skyVideo.muted = !skyVideo.muted;
|
| 95 |
+
else screenVideo.muted = !screenVideo.muted;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
function closeVideo() {
|
| 99 |
+
screenVideo.pause();
|
| 100 |
+
container.style.display = 'none';
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
// Sky Launcher
|
| 104 |
+
document.getElementById('skyInput').addEventListener('change', function(e) {
|
| 105 |
+
const file = e.target.files[0];
|
| 106 |
+
if (!file) return;
|
| 107 |
+
const url = URL.createObjectURL(file);
|
| 108 |
+
const sky = document.getElementById('sky');
|
| 109 |
+
|
| 110 |
+
if (file.type.startsWith('video/')) {
|
| 111 |
+
if (skyVideo) skyVideo.pause();
|
| 112 |
+
skyVideo = document.createElement('video');
|
| 113 |
+
skyVideo.src = url;
|
| 114 |
+
skyVideo.loop = true;
|
| 115 |
+
skyVideo.muted = true;
|
| 116 |
+
skyVideo.style.display = 'none';
|
| 117 |
+
document.body.appendChild(skyVideo);
|
| 118 |
+
|
| 119 |
+
skyVideo.onloadeddata = () => {
|
| 120 |
+
const mesh = sky.getObject3D('mesh');
|
| 121 |
+
if (mesh && mesh.material) {
|
| 122 |
+
const texture = new THREE.VideoTexture(skyVideo);
|
| 123 |
+
texture.mapping = THREE.EquirectangularReflectionMapping;
|
| 124 |
+
mesh.material.map = texture;
|
| 125 |
+
mesh.material.needsUpdate = true;
|
| 126 |
+
skyVideo.play();
|
| 127 |
+
}
|
| 128 |
+
};
|
| 129 |
+
skyVideo.load();
|
| 130 |
+
} else {
|
| 131 |
+
sky.setAttribute('src', url);
|
| 132 |
+
}
|
| 133 |
+
});
|
| 134 |
+
|
| 135 |
+
// Screen Media
|
| 136 |
+
document.getElementById('screenInput').addEventListener('change', function(e) {
|
| 137 |
+
const file = e.target.files[0];
|
| 138 |
+
if (!file) return;
|
| 139 |
+
const url = URL.createObjectURL(file);
|
| 140 |
+
screenVideo.src = url;
|
| 141 |
+
container.style.display = 'block';
|
| 142 |
+
screenVideo.play();
|
| 143 |
+
});
|
| 144 |
+
</script>
|
| 145 |
</body>
|
| 146 |
</html>
|