Update index.html
Browse files- index.html +38 -37
index.html
CHANGED
|
@@ -13,13 +13,19 @@
|
|
| 13 |
}
|
| 14 |
#panel {
|
| 15 |
position:fixed; bottom:88px; left:22px; width:205px;
|
| 16 |
-
background:rgba(
|
| 17 |
-
|
| 18 |
-
border
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
z-index:1002;
|
| 20 |
}
|
| 21 |
button {
|
| 22 |
-
background:rgba(255,50,50,0.
|
| 23 |
color:#ff99aa;
|
| 24 |
border:1px solid #ff3366;
|
| 25 |
box-shadow:0 0 12px #ff3366;
|
|
@@ -28,26 +34,30 @@
|
|
| 28 |
font-size:15px;
|
| 29 |
text-align:left;
|
| 30 |
}
|
| 31 |
-
.
|
| 32 |
position: fixed;
|
| 33 |
-
bottom:
|
| 34 |
left: 50%;
|
| 35 |
transform: translateX(-50%);
|
| 36 |
-
display:
|
| 37 |
gap: 12px;
|
|
|
|
|
|
|
| 38 |
z-index: 1001;
|
|
|
|
| 39 |
}
|
| 40 |
.video-wrapper {
|
| 41 |
-
width:
|
| 42 |
-
background: rgba(0,0,0,0.
|
|
|
|
| 43 |
border-radius: 12px;
|
| 44 |
padding: 6px;
|
| 45 |
-
|
| 46 |
}
|
| 47 |
.close-btn {
|
| 48 |
-
position:absolute; top:
|
| 49 |
background:rgba(255,60,60,0.9); width:26px; height:26px; border-radius:50%;
|
| 50 |
-
display:flex; align-items:center; justify-content:center;
|
| 51 |
}
|
| 52 |
</style>
|
| 53 |
</head>
|
|
@@ -67,13 +77,11 @@
|
|
| 67 |
<button onclick="toggleMuteAll()">๐ Mute All</button>
|
| 68 |
</div>
|
| 69 |
|
| 70 |
-
<div id="
|
| 71 |
|
| 72 |
<input type="file" id="skyInput" accept="image/*,video/*" style="display:none;">
|
| 73 |
|
| 74 |
<script>
|
| 75 |
-
let panels = [];
|
| 76 |
-
|
| 77 |
function togglePanel() {
|
| 78 |
const panel = document.getElementById('panel');
|
| 79 |
panel.style.display = panel.style.display === 'flex' ? 'none' : 'flex';
|
|
@@ -84,18 +92,15 @@
|
|
| 84 |
}
|
| 85 |
|
| 86 |
function addMediaPanel() {
|
| 87 |
-
const container = document.getElementById('
|
| 88 |
|
| 89 |
const wrapper = document.createElement('div');
|
| 90 |
wrapper.className = 'video-wrapper';
|
| 91 |
|
| 92 |
-
const
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
if (wrapper.video) wrapper.video.pause();
|
| 97 |
-
wrapper.remove();
|
| 98 |
-
};
|
| 99 |
|
| 100 |
const video = document.createElement('video');
|
| 101 |
video.controls = true;
|
|
@@ -103,27 +108,23 @@
|
|
| 103 |
video.style.width = '100%';
|
| 104 |
video.style.borderRadius = '8px';
|
| 105 |
|
| 106 |
-
wrapper.appendChild(
|
| 107 |
wrapper.appendChild(video);
|
| 108 |
container.appendChild(wrapper);
|
| 109 |
container.style.display = 'flex';
|
| 110 |
|
| 111 |
-
wrapper.video = video;
|
| 112 |
-
|
| 113 |
-
// Auto open file picker when adding new panel
|
| 114 |
const input = document.createElement('input');
|
| 115 |
input.type = 'file';
|
| 116 |
input.accept = 'video/*,image/*';
|
| 117 |
input.onchange = (e) => {
|
| 118 |
const file = e.target.files[0];
|
| 119 |
-
if (file)
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
}
|
| 127 |
}
|
| 128 |
};
|
| 129 |
input.click();
|
|
@@ -139,8 +140,8 @@
|
|
| 139 |
|
| 140 |
function toggleMuteAll() {
|
| 141 |
const videos = document.querySelectorAll('video');
|
| 142 |
-
const
|
| 143 |
-
videos.forEach(v => v.muted =
|
| 144 |
}
|
| 145 |
|
| 146 |
// Sky Launcher
|
|
|
|
| 13 |
}
|
| 14 |
#panel {
|
| 15 |
position:fixed; bottom:88px; left:22px; width:205px;
|
| 16 |
+
background:rgba(10,0,20,0.45);
|
| 17 |
+
backdrop-filter:blur(20px);
|
| 18 |
+
border:2px solid #ff3366;
|
| 19 |
+
box-shadow:0 0 25px #ff3366, 0 0 45px #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 {
|
| 28 |
+
background:rgba(255,50,50,0.15);
|
| 29 |
color:#ff99aa;
|
| 30 |
border:1px solid #ff3366;
|
| 31 |
box-shadow:0 0 12px #ff3366;
|
|
|
|
| 34 |
font-size:15px;
|
| 35 |
text-align:left;
|
| 36 |
}
|
| 37 |
+
.media-panels {
|
| 38 |
position: fixed;
|
| 39 |
+
bottom: 190px;
|
| 40 |
left: 50%;
|
| 41 |
transform: translateX(-50%);
|
| 42 |
+
display: flex;
|
| 43 |
gap: 12px;
|
| 44 |
+
flex-wrap: wrap;
|
| 45 |
+
justify-content: center;
|
| 46 |
z-index: 1001;
|
| 47 |
+
max-width: 95%;
|
| 48 |
}
|
| 49 |
.video-wrapper {
|
| 50 |
+
width: 170px;
|
| 51 |
+
background: rgba(0,0,0,0.6);
|
| 52 |
+
border: 1px solid #ff3366;
|
| 53 |
border-radius: 12px;
|
| 54 |
padding: 6px;
|
| 55 |
+
position: relative;
|
| 56 |
}
|
| 57 |
.close-btn {
|
| 58 |
+
position:absolute; top:4px; right:4px; color:white; font-size:22px;
|
| 59 |
background:rgba(255,60,60,0.9); width:26px; height:26px; border-radius:50%;
|
| 60 |
+
display:flex; align-items:center; justify-content:center;
|
| 61 |
}
|
| 62 |
</style>
|
| 63 |
</head>
|
|
|
|
| 77 |
<button onclick="toggleMuteAll()">๐ Mute All</button>
|
| 78 |
</div>
|
| 79 |
|
| 80 |
+
<div id="mediaPanels" class="media-panels"></div>
|
| 81 |
|
| 82 |
<input type="file" id="skyInput" accept="image/*,video/*" style="display:none;">
|
| 83 |
|
| 84 |
<script>
|
|
|
|
|
|
|
| 85 |
function togglePanel() {
|
| 86 |
const panel = document.getElementById('panel');
|
| 87 |
panel.style.display = panel.style.display === 'flex' ? 'none' : 'flex';
|
|
|
|
| 92 |
}
|
| 93 |
|
| 94 |
function addMediaPanel() {
|
| 95 |
+
const container = document.getElementById('mediaPanels');
|
| 96 |
|
| 97 |
const wrapper = document.createElement('div');
|
| 98 |
wrapper.className = 'video-wrapper';
|
| 99 |
|
| 100 |
+
const close = document.createElement('div');
|
| 101 |
+
close.className = 'close-btn';
|
| 102 |
+
close.textContent = 'ร';
|
| 103 |
+
close.onclick = () => wrapper.remove();
|
|
|
|
|
|
|
|
|
|
| 104 |
|
| 105 |
const video = document.createElement('video');
|
| 106 |
video.controls = true;
|
|
|
|
| 108 |
video.style.width = '100%';
|
| 109 |
video.style.borderRadius = '8px';
|
| 110 |
|
| 111 |
+
wrapper.appendChild(close);
|
| 112 |
wrapper.appendChild(video);
|
| 113 |
container.appendChild(wrapper);
|
| 114 |
container.style.display = 'flex';
|
| 115 |
|
|
|
|
|
|
|
|
|
|
| 116 |
const input = document.createElement('input');
|
| 117 |
input.type = 'file';
|
| 118 |
input.accept = 'video/*,image/*';
|
| 119 |
input.onchange = (e) => {
|
| 120 |
const file = e.target.files[0];
|
| 121 |
+
if (!file) return;
|
| 122 |
+
const url = URL.createObjectURL(file);
|
| 123 |
+
if (file.type.startsWith('video/')) {
|
| 124 |
+
video.src = url;
|
| 125 |
+
video.play();
|
| 126 |
+
} else {
|
| 127 |
+
video.outerHTML = `<img src="${url}" style="width:100%; border-radius:8px;">`;
|
|
|
|
| 128 |
}
|
| 129 |
};
|
| 130 |
input.click();
|
|
|
|
| 140 |
|
| 141 |
function toggleMuteAll() {
|
| 142 |
const videos = document.querySelectorAll('video');
|
| 143 |
+
const isMuted = videos[0] ? videos[0].muted : false;
|
| 144 |
+
videos.forEach(v => v.muted = !isMuted);
|
| 145 |
}
|
| 146 |
|
| 147 |
// Sky Launcher
|