35 lines
1.9 KiB
HTML
35 lines
1.9 KiB
HTML
<!DOCTYPE html>
|
|
<html><head><meta charset="utf-8"><title>Zap</title>
|
|
<style>
|
|
body { font: 16px system-ui, sans-serif; margin: 24px; background: #fafafa; color: #222; }
|
|
.zap-ad { background: repeating-linear-gradient(45deg, #f4c542 0 12px, #e0a800 12px 24px); color: #000;
|
|
font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 12px 0; }
|
|
.row { display: flex; gap: 12px; }
|
|
.row .zap-ad { width: 260px; height: 140px; }
|
|
#ad-wide { height: 110px; }
|
|
#ad-tiny { width: 10px; height: 10px; }
|
|
.video-js { position: relative; width: 320px; height: 180px; background: #111; }
|
|
.video-js video { width: 100%; height: 100%; }
|
|
.video-js .zap-ad { position: absolute; left: 8px; bottom: 8px; width: 140px; height: 40px; margin: 0; }
|
|
#spacer { height: 3000px; }
|
|
</style></head>
|
|
<body>
|
|
<h1>Ad removal test</h1>
|
|
<p id="p1">Text above the ads.</p>
|
|
<div class="zap-ad" id="ad-wide">AD wide</div>
|
|
<div class="row"><div class="zap-ad" id="ad-left">AD left</div><div class="zap-ad" id="ad-right">AD right</div></div>
|
|
<p id="p2">Text below the ads: it moves up when their slots close.</p>
|
|
<div class="zap-ad" id="ad-tiny"></div>
|
|
<div class="video-js" id="player"><video id="vid" muted></video><div class="zap-ad" id="ad-in-player">AD in player</div></div>
|
|
<div class="zap-ad" id="ad-with-video" style="width:200px;height:100px"><video muted style="width:100px;height:60px"></video></div>
|
|
<div id="spacer"></div>
|
|
<div class="zap-ad" id="ad-offscreen" style="height:120px">AD off-screen</div>
|
|
<script>
|
|
// What the test reads: where p2 started, whether an overlay ever showed.
|
|
window.p2Top = document.getElementById('p2').getBoundingClientRect().top;
|
|
window.ovSeen = false;
|
|
new MutationObserver(() => { if (document.querySelector('.__nz_ov')) window.ovSeen = true; })
|
|
.observe(document.documentElement, { childList: true, subtree: true });
|
|
window.shown = id => getComputedStyle(document.getElementById(id)).display !== 'none';
|
|
</script>
|
|
</body></html>
|