Update index.html
Browse files27 unmodified lines28293031323334353637383940414243444546474849509 unmodified lines606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031 unmodified line10510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713827 unmodified linesfont-size:15px;text-align:left;}#videoContainer {position:fixed; bottom:180px; left:50%; transform:translateX(-50%);width:90%; max-width:400px; display:none; z-index:1000;background:rgba(0,0,0,0.85); border-radius:12px; padding:8px;}#myVideo { width:100%; border-radius:8px; }.close-btn {position:absolute; top:8px; right:8px; color:white; font-size:28px;background:rgba(255,60,60,0.9); width:32px; height:32px; border-radius:50%;display:flex; align-items:center; justify-content:center; z-index:1001;}</style></head><body><!-- This line enables A-Frame's built-in VR button --><a-scene background="color: #000000" vr-mode-ui="enabled: true"><a-sky id="sky" src="galaxy.jpg"></a-sky></a-scene>9 unmodified lines<button onclick="alert('Knowledge Base - Coming soon')">๐ Knowledge</button></div><div id="videoContainer"><div class="close-btn" onclick="closeVideo()">ร</div><video id="myVideo" controls loop></video></div><input type="file" id="skyInput" accept="image/*,video/*" style="display:none;"><input type="file" id="screenInput" accept="video/*,image/*" style="display:none;"><script>let skyVideo = null;const screenVideo = document.getElementById('myVideo');const container = document.getElementById('videoContainer');function togglePanel() {const panel = document.getElementById('panel');panel.style.display = panel.style.display === 'flex' ? 'none' : 'flex';}function launchSky() { document.getElementById('skyInput').click(); }function pickScreenMedia() { document.getElementById('screenInput').click(); }function playSky() {if (skyVideo) skyVideo.play();else screenVideo.play();}function pauseSky() {if (skyVideo) skyVideo.pause();else screenVideo.pause();}function toggleMute() {if (skyVideo) skyVideo.muted = !skyVideo.muted;else screenVideo.muted = !screenVideo.muted;}function closeVideo() {screenVideo.pause();container.style.display = 'none';}// Sky Launcher1 unmodified lineconst file = e.target.files[0];if (!file) return;const url = URL.createObjectURL(file);const sky = document.getElementById('sky');if (file.type.startsWith('video/')) {if (skyVideo) skyVideo.pause();skyVideo = document.createElement('video');skyVideo.src = url;skyVideo.loop = true;skyVideo.muted = true;skyVideo.style.display = 'none';document.body.appendChild(skyVideo);const texture = new THREE.VideoTexture(skyVideo);texture.mapping = THREE.EquirectangularReflectionMapping;sky.setAttribute('material', { src: texture, shader: 'flat', side: 'back' });skyVideo.play();} else {sky.setAttribute('src', url);}});// Screen Mediadocument.getElementById('screenInput').addEventListener('change', function(e) {const file = e.target.files[0];if (!file) return;const url = URL.createObjectURL(file);screenVideo.src = url;container.style.display = 'block';screenVideo.play();});</script></body>27 unmodified lines282930313233343536373839404142439 unmodified lines5354555657585960616263646566676869707172737475767778798081828384851 unmodified line8788899091929327 unmodified linesfont-size:15px;text-align:left;}.vr-btn {position:fixed; bottom:30px; right:30px; padding:10px 20px; font-size:15px;background:rgba(255,255,255,0.15); color:white; border:2px solid white;border-radius:8px; z-index:1010; cursor:pointer;}</style></head><body><a-scene background="color: #000000"><a-sky id="sky" src="galaxy.jpg"></a-sky></a-scene>9 unmodified lines<button onclick="alert('Knowledge Base - Coming soon')">๐ Knowledge</button></div><button class="vr-btn" onclick="startVR()">VR</button><input type="file" id="skyInput" accept="image/*,video/*" style="display:none;"><script>function togglePanel() {const panel = document.getElementById('panel');panel.style.display = panel.style.display === 'flex' ? 'none' : 'flex';}function launchSky() { document.getElementById('skyInput').click(); }function startVR() {const scene = document.querySelector('a-scene');if (!scene) return;if (navigator.xr && navigator.xr.isSessionSupported) {navigator.xr.isSessionSupported('immersive-vr').then(supported => {if (supported) {scene.enterVR();} else {alert("Your browser or device does not support immersive VR");}});} else {scene.enterVR();}}// Sky Launcher1 unmodified lineconst file = e.target.files[0];if (!file) return;const url = URL.createObjectURL(file);document.getElementById('sky').setAttribute('src', url);});</script></body>
index.html+21-66