custom terminal video player
This commit is contained in:
+40
-3
@@ -304,13 +304,50 @@ footer a:hover {
|
|||||||
border-bottom-color: transparent;
|
border-bottom-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* self-hosted video — native element, same-origin so the custom cursor works */
|
/* self-hosted video — custom terminal-style player (no native controls, so
|
||||||
.video {
|
only our own cursor shows; same-origin keeps the pixel cursor working) */
|
||||||
|
.player {
|
||||||
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
aspect-ratio: 16 / 9;
|
aspect-ratio: 16 / 9;
|
||||||
display: block;
|
|
||||||
background: #000;
|
background: #000;
|
||||||
|
font-family: var(--font-family-mono);
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
.player video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
|
||||||
|
.player__big {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 2.4rem;
|
||||||
|
color: #fff;
|
||||||
|
background: none;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
.player.is-playing .player__big { display: none; }
|
||||||
|
.player__bar {
|
||||||
|
position: absolute;
|
||||||
|
left: 0; right: 0; bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1ch;
|
||||||
|
padding: 0.5rem 1ch;
|
||||||
|
color: #fff;
|
||||||
|
font-size: var(--font-size-small);
|
||||||
|
background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.2s ease;
|
||||||
|
}
|
||||||
|
.player:hover .player__bar,
|
||||||
|
.player:not(.is-playing) .player__bar { opacity: 1; }
|
||||||
|
.player__bar button { font: inherit; color: #fff; background: none; border: 0; padding: 0 0.4ch; line-height: 1; }
|
||||||
|
.player__bar button:hover { background: #fff; color: #000; }
|
||||||
|
.player__scrub { flex: 1; height: 3px; background: rgba(255, 255, 255, 0.3); position: relative; }
|
||||||
|
.player__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #fff; }
|
||||||
|
.player__time { white-space: nowrap; font-variant-numeric: tabular-nums; }
|
||||||
|
.player:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; }
|
||||||
|
|
||||||
/* all images always in colour (selection drives what's shown, not hover) */
|
/* all images always in colour (selection drives what's shown, not hover) */
|
||||||
img { filter: none; }
|
img { filter: none; }
|
||||||
|
|||||||
Reference in New Issue
Block a user