bep40 commited on
Commit
fd4db82
·
verified ·
1 Parent(s): 95f1061

fix: popup hides header, shows only player

Browse files
Files changed (1) hide show
  1. static/yt_live.js +8 -5
static/yt_live.js CHANGED
@@ -160,10 +160,11 @@
160
  .vtv-mini.hidden .vtv-mini-peek{display:block}
161
  .vtv-popup{position:fixed;top:0;left:0;right:0;margin:8px auto 0;background:rgba(0,0,0,.95);z-index:99999;display:none;flex-direction:column;max-height:calc(100vh - 16px);max-width:800px;border-radius:12px;overflow:hidden}
162
  .vtv-popup.show{display:flex}
 
163
  .vtv-popup-header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:#111;border-bottom:1px solid #333}
164
  .vtv-popup-title{font-size:14px;font-weight:700;color:#00ccff}
165
  .vtv-popup-close{background:#333;border:none;color:#fff;font-size:18px;width:32px;height:32px;border-radius:6px;cursor:pointer}
166
- .vtv-popup-frame{flex:1;position:relative;background:#000;min-height:0;aspect-ratio:16/9}
167
  .vtv-popup-frame iframe{position:absolute;inset:0;width:100%;height:100%;border:none}
168
  .vtv-popup-loader{display:flex;align-items:center;justify-content:center;height:280px;color:#00ccff;font-size:12px;flex-direction:column;gap:8px}
169
  .vtv-popup-btn{background:#1a2a3a;border:1px solid #2a3a4a;color:#8ab4d8;font-size:9px;padding:3px 8px;border-radius:6px;cursor:pointer;margin-left:4px}
@@ -849,21 +850,21 @@
849
  // Open any URL in popup (for WC2026 direct links)
850
  window._vtvOpenUrlPopup=function(popupUrl) {
851
  if (!popupUrl) return;
852
- openVtvPopupWithUrl(popupUrl, '📺 VTV Player');
853
  };
854
 
855
  window._vtvOpenPopup=function(chId) {
856
  openVtvPopup(chId);
857
  };
858
 
859
- function openVtvPopupWithUrl(popupUrl, title) {
860
  let popup = document.getElementById('vtv-popup');
861
  if (!popup) {
862
  popup = document.createElement('div');
863
  popup.id = 'vtv-popup';
864
  popup.className = 'vtv-popup';
865
  popup.innerHTML = `
866
- <div class="vtv-popup-header">
867
  <span class="vtv-popup-title" id="vtv-popup-title">📺 VTV Player</span>
868
  <button class="vtv-popup-close" id="vtv-popup-close">✕</button>
869
  </div>
@@ -876,6 +877,8 @@
876
  }
877
 
878
  _vtvPopupActive = true;
 
 
879
  document.getElementById('vtv-popup-title').textContent = title || '📺 VTV Player';
880
  const frame = document.getElementById('vtv-popup-frame');
881
  frame.innerHTML = '<div class="vtv-popup-loader" id="vtv-popup-loader"><div class="vtv-spinner"></div>Đang tải...</div>';
@@ -890,7 +893,7 @@
890
 
891
  // Open TS token URL in popup
892
  window._vtvOpenTsPopup=function(tsUrl) {
893
- openVtvPopupWithUrl(tsUrl, '⚽ WC2026 Replay');
894
  };
895
 
896
  window._vtvClosePopup=function() { closeVtvPopup(); };
 
160
  .vtv-mini.hidden .vtv-mini-peek{display:block}
161
  .vtv-popup{position:fixed;top:0;left:0;right:0;margin:8px auto 0;background:rgba(0,0,0,.95);z-index:99999;display:none;flex-direction:column;max-height:calc(100vh - 16px);max-width:800px;border-radius:12px;overflow:hidden}
162
  .vtv-popup.show{display:flex}
163
+ .vtv-popup:has(#vtv-popup-hdr[style*="none"]) .vtv-popup-frame{height:100%}
164
  .vtv-popup-header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:#111;border-bottom:1px solid #333}
165
  .vtv-popup-title{font-size:14px;font-weight:700;color:#00ccff}
166
  .vtv-popup-close{background:#333;border:none;color:#fff;font-size:18px;width:32px;height:32px;border-radius:6px;cursor:pointer}
167
+ .vtv-popup-frame{flex:1;position:relative;background:#000;min-height:0}
168
  .vtv-popup-frame iframe{position:absolute;inset:0;width:100%;height:100%;border:none}
169
  .vtv-popup-loader{display:flex;align-items:center;justify-content:center;height:280px;color:#00ccff;font-size:12px;flex-direction:column;gap:8px}
170
  .vtv-popup-btn{background:#1a2a3a;border:1px solid #2a3a4a;color:#8ab4d8;font-size:9px;padding:3px 8px;border-radius:6px;cursor:pointer;margin-left:4px}
 
850
  // Open any URL in popup (for WC2026 direct links)
851
  window._vtvOpenUrlPopup=function(popupUrl) {
852
  if (!popupUrl) return;
853
+ openVtvPopupWithUrl(popupUrl, '', true);
854
  };
855
 
856
  window._vtvOpenPopup=function(chId) {
857
  openVtvPopup(chId);
858
  };
859
 
860
+ function openVtvPopupWithUrl(popupUrl, title, hideHeader) {
861
  let popup = document.getElementById('vtv-popup');
862
  if (!popup) {
863
  popup = document.createElement('div');
864
  popup.id = 'vtv-popup';
865
  popup.className = 'vtv-popup';
866
  popup.innerHTML = `
867
+ <div class="vtv-popup-header" id="vtv-popup-hdr">
868
  <span class="vtv-popup-title" id="vtv-popup-title">📺 VTV Player</span>
869
  <button class="vtv-popup-close" id="vtv-popup-close">✕</button>
870
  </div>
 
877
  }
878
 
879
  _vtvPopupActive = true;
880
+ const hdr = document.getElementById('vtv-popup-hdr');
881
+ if (hdr) hdr.style.display = hideHeader ? 'none' : 'flex';
882
  document.getElementById('vtv-popup-title').textContent = title || '📺 VTV Player';
883
  const frame = document.getElementById('vtv-popup-frame');
884
  frame.innerHTML = '<div class="vtv-popup-loader" id="vtv-popup-loader"><div class="vtv-spinner"></div>Đang tải...</div>';
 
893
 
894
  // Open TS token URL in popup
895
  window._vtvOpenTsPopup=function(tsUrl) {
896
+ openVtvPopupWithUrl(tsUrl, '', true);
897
  };
898
 
899
  window._vtvClosePopup=function() { closeVtvPopup(); };