Files
v10/apps/sandbox/templates/spf-background-looping-video/index.html
T

270 lines
6.7 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sandbox — SPF Background Looping Video</title>
<style>
html,
body {
height: 100%;
padding: 0;
margin: 0;
font-family:
'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
color: #fff;
background: #000;
}
.stage {
position: relative;
width: 100vw;
height: 100vh;
overflow: hidden;
}
#bg-video {
position: absolute;
inset: 0;
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
.scrim {
position: absolute;
inset: 0;
pointer-events: none;
background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.2) 35%, rgba(0, 0, 0, 0.7) 100%);
}
.hero {
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
justify-content: center;
max-width: 720px;
padding: 0 8vw;
}
.hero h1 {
margin: 0 0 16px;
font-size: clamp(36px, 6vw, 72px);
font-weight: 600;
line-height: 1.05;
letter-spacing: -0.02em;
}
.hero p {
max-width: 540px;
margin: 0 0 24px;
font-size: 17px;
line-height: 1.5;
opacity: 0.88;
}
.hero .links {
font-size: 13px;
opacity: 0.75;
}
.hero .links a {
padding-bottom: 1px;
margin-right: 18px;
color: inherit;
text-decoration: none;
border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}
.hero .links a:hover {
border-bottom-color: rgba(255, 255, 255, 0.9);
opacity: 1;
}
/* Top-right diagnostic strip — surfaces the three Phase 1 review-focus
signals: loadActivated, the picker result, and the absence of audio-
side context. */
.diag {
position: absolute;
top: 16px;
right: 16px;
min-width: 240px;
padding: 12px 14px;
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 12px;
line-height: 1.6;
background: rgba(0, 0, 0, 0.55);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 8px;
-webkit-backdrop-filter: blur(8px);
backdrop-filter: blur(8px);
}
.diag .diag-title {
margin-bottom: 8px;
font-size: 10px;
text-transform: uppercase;
letter-spacing: 0.12em;
opacity: 0.55;
}
.diag .row {
display: flex;
gap: 12px;
justify-content: space-between;
}
.diag .row .key {
opacity: 0.65;
}
.diag .row .val {
text-align: right;
}
.diag .row .val.ok {
color: #7ee787;
}
.diag .row .val.absent {
color: #ffa657;
}
/* Bottom-right control card — reviewer affordances + roadmap. */
.controls {
position: absolute;
right: 16px;
bottom: 16px;
min-width: 260px;
padding: 14px 16px;
font-size: 13px;
background: rgba(0, 0, 0, 0.55);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 8px;
-webkit-backdrop-filter: blur(8px);
backdrop-filter: blur(8px);
}
.controls label {
display: block;
margin-bottom: 6px;
font-size: 10px;
text-transform: uppercase;
letter-spacing: 0.12em;
opacity: 0.6;
}
.controls select {
width: 100%;
padding: 6px 8px;
font: inherit;
color: inherit;
background: rgba(255, 255, 255, 0.08);
border: 1px solid rgba(255, 255, 255, 0.15);
border-radius: 4px;
}
.controls .picker-section {
margin-top: 14px;
}
.rendition-buttons {
display: flex;
flex-direction: column;
gap: 4px;
}
.rendition-buttons .rendition {
width: 100%;
padding: 6px 8px;
font: inherit;
font-size: 12px;
color: inherit;
text-align: left;
background: rgba(255, 255, 255, 0.06);
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: 4px;
}
.rendition-buttons .rendition.selected {
color: #7ee787;
background: rgba(126, 231, 135, 0.12);
border-color: rgba(126, 231, 135, 0.4);
}
.controls .load-btn {
width: 100%;
padding: 8px 10px;
margin-top: 10px;
font: inherit;
font-size: 12px;
font-weight: 600;
color: inherit;
text-transform: uppercase;
letter-spacing: 0.04em;
cursor: pointer;
background: rgba(126, 231, 135, 0.16);
border: 1px solid rgba(126, 231, 135, 0.4);
border-radius: 4px;
}
.controls .load-btn:hover {
background: rgba(126, 231, 135, 0.24);
}
</style>
</head>
<body>
<div class="stage">
<video id="bg-video" playsinline muted></video>
<div class="scrim"></div>
<div class="hero">
<h1>Background Looping Video</h1>
<p>
Subtractive engine variant — audio, text tracks, ABR, and preload monitoring are composed out; a max-resolution
picker is composed in. The SPF foundation for <code>&lt;mux-background-video&gt;</code>.
</p>
</div>
<div class="diag" id="diag">
<div class="diag-title">Engine state</div>
<div class="row"><span class="key">loadActivated</span><span class="val" id="diag-load"></span></div>
<div class="row"><span class="key">selected rendition</span><span class="val" id="diag-rendition"></span></div>
<div class="row"><span class="key">context keys</span><span class="val" id="diag-context"></span></div>
<div class="row"><span class="key">audio side</span><span class="val absent">subtracted</span></div>
</div>
<div class="controls">
<label for="source-select">Source</label>
<select id="source-select"></select>
<div class="picker-section">
<label for="max-resolution-select">maxResolution</label>
<select id="max-resolution-select">
<option value="">— none —</option>
<option value="240p">240p</option>
<option value="360p">360p</option>
<option value="480p">480p</option>
<option value="720p">720p</option>
<option value="1080p">1080p</option>
<option value="1440p">1440p</option>
<option value="2160p">2160p</option>
</select>
<button type="button" id="load-btn" class="load-btn">Load</button>
</div>
<div class="picker-section">
<label>Rendition</label>
<div id="rendition-buttons" class="rendition-buttons"></div>
</div>
</div>
</div>
<script type="module" src="./main.ts"></script>
</body>
</html>