Metaprime commited on
Commit
c60afad
·
verified ·
1 Parent(s): ee941fa

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +79 -13
index.html CHANGED
@@ -13,15 +13,9 @@
13
  }
14
  #panel {
15
  position:fixed; bottom:88px; left:22px; width:205px;
16
- background:rgba(15,0,25,0.4);
17
- backdrop-filter:blur(22px);
18
- border:2px solid #ff3366;
19
- box-shadow:0 0 30px #ff3366;
20
- border-radius:16px;
21
- padding:12px;
22
- display:none;
23
- flex-direction:column;
24
- gap:8px;
25
  z-index:1002;
26
  }
27
  button {
@@ -34,6 +28,31 @@
34
  font-size:15px;
35
  text-align:left;
36
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  </style>
38
  </head>
39
  <body>
@@ -42,19 +61,23 @@
42
  <a-sky id="sky" src="galaxy.jpg"></a-sky>
43
  </a-scene>
44
 
45
- <div id="bead" onclick="togglePanel()">🔴</div>
46
 
47
  <div id="panel">
48
  <button onclick="launchSky()">🌌 Sky Launcher</button>
49
  <button onclick="addFloatingPlayer()">📺 Add Floating Player</button>
 
 
50
  </div>
51
 
 
 
52
  <input type="file" id="skyInput" accept="image/*,video/*" style="display:none;">
53
 
54
  <script>
55
  function togglePanel() {
56
  const panel = document.getElementById('panel');
57
- panel.style.display = (panel.style.display === 'flex') ? 'none' : 'flex';
58
  }
59
 
60
  function launchSky() {
@@ -62,14 +85,57 @@
62
  }
63
 
64
  function addFloatingPlayer() {
65
- alert("Add Floating Player clicked - we'll add the windows next");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  }
67
 
68
  document.getElementById('skyInput').addEventListener('change', function(e) {
69
  const file = e.target.files[0];
70
  if (!file) return;
71
  const url = URL.createObjectURL(file);
72
- document.getElementById('sky').setAttribute('src', url);
 
73
  });
74
  </script>
75
  </body>
 
13
  }
14
  #panel {
15
  position:fixed; bottom:88px; left:22px; width:205px;
16
+ background:rgba(15,0,25,0.4); backdrop-filter:blur(22px);
17
+ border:2px solid #ff3366; box-shadow:0 0 30px #ff3366;
18
+ border-radius:16px; padding:12px; display:none; flex-direction:column; gap:8px;
 
 
 
 
 
 
19
  z-index:1002;
20
  }
21
  button {
 
28
  font-size:15px;
29
  text-align:left;
30
  }
31
+ .media-panels {
32
+ position: fixed;
33
+ top: 80px;
34
+ left: 50%;
35
+ transform: translateX(-50%);
36
+ display: flex;
37
+ gap: 12px;
38
+ flex-wrap: wrap;
39
+ justify-content: center;
40
+ z-index: 1001;
41
+ max-width: 95%;
42
+ }
43
+ .video-wrapper {
44
+ width: 200px;
45
+ background: rgba(0,0,0,0.7);
46
+ border: 2px solid #ff3366;
47
+ border-radius: 12px;
48
+ padding: 6px;
49
+ position: relative;
50
+ }
51
+ .close-btn {
52
+ position:absolute; top:6px; right:6px; color:white; font-size:24px;
53
+ background:rgba(255,60,60,0.9); width:28px; height:28px; border-radius:50%;
54
+ display:flex; align-items:center; justify-content:center;
55
+ }
56
  </style>
57
  </head>
58
  <body>
 
61
  <a-sky id="sky" src="galaxy.jpg"></a-sky>
62
  </a-scene>
63
 
64
+ <div id="bead" onclick="togglePanel()"></div>
65
 
66
  <div id="panel">
67
  <button onclick="launchSky()">🌌 Sky Launcher</button>
68
  <button onclick="addFloatingPlayer()">📺 Add Floating Player</button>
69
+ <button onclick="playAll()">▶️ Play All</button>
70
+ <button onclick="pauseAll()">⏸️ Pause All</button>
71
  </div>
72
 
73
+ <div id="mediaPanels" class="media-panels"></div>
74
+
75
  <input type="file" id="skyInput" accept="image/*,video/*" style="display:none;">
76
 
77
  <script>
78
  function togglePanel() {
79
  const panel = document.getElementById('panel');
80
+ panel.style.display = panel.style.display === 'flex' ? 'none' : 'flex';
81
  }
82
 
83
  function launchSky() {
 
85
  }
86
 
87
  function addFloatingPlayer() {
88
+ const container = document.getElementById('mediaPanels');
89
+ const wrapper = document.createElement('div');
90
+ wrapper.className = 'video-wrapper';
91
+
92
+ const close = document.createElement('div');
93
+ close.className = 'close-btn';
94
+ close.textContent = '×';
95
+ close.onclick = () => wrapper.remove();
96
+
97
+ const video = document.createElement('video');
98
+ video.controls = true;
99
+ video.loop = true;
100
+ video.style.width = '100%';
101
+ video.style.borderRadius = '8px';
102
+
103
+ wrapper.appendChild(close);
104
+ wrapper.appendChild(video);
105
+ container.appendChild(wrapper);
106
+ container.style.display = 'flex';
107
+
108
+ const input = document.createElement('input');
109
+ input.type = 'file';
110
+ input.accept = 'video/*,image/*';
111
+ input.onchange = (e) => {
112
+ const file = e.target.files[0];
113
+ if (!file) return;
114
+ const url = URL.createObjectURL(file);
115
+ if (file.type.startsWith('video/')) {
116
+ video.src = url;
117
+ video.play();
118
+ } else {
119
+ video.outerHTML = `<img src="${url}" style="width:100%; border-radius:8px;">`;
120
+ }
121
+ };
122
+ input.click();
123
+ }
124
+
125
+ function playAll() {
126
+ document.querySelectorAll('video').forEach(v => v.play());
127
+ }
128
+
129
+ function pauseAll() {
130
+ document.querySelectorAll('video').forEach(v => v.pause());
131
  }
132
 
133
  document.getElementById('skyInput').addEventListener('change', function(e) {
134
  const file = e.target.files[0];
135
  if (!file) return;
136
  const url = URL.createObjectURL(file);
137
+ const sky = document.getElementById('sky');
138
+ sky.setAttribute('src', url);
139
  });
140
  </script>
141
  </body>