Overlays refresh themselves after updates; media URLs versioned; frameless (transparent) alerts
- Overlay\Build id (plugin version + admin epoch) in X-SG-Build; overlay.js reloads once on mismatch (loop-guarded); 'Refresh all overlays now' - Media URLs carry ?v=<mtime> - Alert option 'Frameless' (schema v5): no box so transparent PNG/GIF/WebP and VP9-alpha WebM show through; admin preview with checkerboard and ffmpeg help Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9249b80cb6
commit
afa768fa42
21 files changed
+287
-16
No files matched your search
@@ -21,3 +21,13 @@
|
||||
.sga-alert-media img,.sga-alert-media video{max-height:180px}
|
||||
.sga-media .button{min-height:40px}
|
||||
}
|
||||
|
||||
/* Frameless alerts: preview backdrops and card without the box */
|
||||
.sga-bg-light{background:repeating-conic-gradient(#e8e8ee 0 25%,#fff 0 50%) 0 0/20px 20px;color:#111}
|
||||
.sga-bg-scene{background:linear-gradient(135deg,#1e6f3c 0 33%,#c2410c 33% 66%,#1d4ed8 66%)}
|
||||
.sga-alert.sga-frameless{background:none;border:0;padding:0}
|
||||
.sga-frameless .sga-alert-head{text-shadow:0 0 3px #000,0 0 6px #000,0 1px 4px #000}
|
||||
.sga-bg-light .sga-frameless .sga-alert-head{text-shadow:0 0 3px #fff,0 0 6px #fff;color:#111}
|
||||
.sga-howto{margin-top:8px}
|
||||
.sga-howto pre{overflow-x:auto;max-width:100%;padding:8px;background:#f0f0f1}
|
||||
.sga-bg-pick{margin-left:12px}
|
||||
@@ -110,7 +110,8 @@
|
||||
var vals = { name: 'Alex', amount: money( amt || 500 ), reward: reward };
|
||||
var msg = render( form.elements.message.value, vals );
|
||||
|
||||
var card = el( 'div', 'sga-alert' );
|
||||
var frameless = !! ( visUrl && form.elements.frameless && form.elements.frameless.checked );
|
||||
var card = el( 'div', 'sga-alert' + ( frameless ? ' sga-frameless' : '' ) );
|
||||
var isVideo = /^video\//.test( visMime ), video = null;
|
||||
if ( visUrl ) {
|
||||
var box = el( 'div', 'sga-alert-media' );
|
||||
@@ -145,6 +146,10 @@
|
||||
timers.push( setTimeout( end, dur ) );
|
||||
}
|
||||
}
|
||||
/* Preview backdrop: dark / light checkerboard or a busy "scene" so transparency is visible. */
|
||||
var bgSel = document.getElementById( 'sga-bg' );
|
||||
function setBg() { stage.className = 'sga-stage' + ( bgSel && bgSel.value !== 'dark' ? ' sga-bg-' + bgSel.value : '' ); }
|
||||
if ( bgSel ) { bgSel.addEventListener( 'change', setBg ); }
|
||||
playBtn.addEventListener( 'click', play );
|
||||
stage.appendChild( el( 'span', 'sga-idle', 'Press "Play preview".' ) );
|
||||
}() );
|
||||
Reference in new issue
Block a user