reels-controls/controls.css
Tronax f64bf994b4
fix: Steuerleiste bleibt bei kleinen Fenstern/Reels im Rahmen
Bei schmalen Reels ragte die Leiste über die Video-Ränder hinaus,
weil (a) width:100% + padding ohne explizites box-sizing die Leiste
über die Reel-Breite trieb und (b) die fixbreiten Elemente (Buttons,
Slider, Zeit-Label) den verfügbaren Platz überstiegen.

- Eigener box-sizing: border-box Reset für alle Extension-Elemente
- min-width:0 an der Leiste + schrumpfbarer Slider (flex:0 1)
- Container-Query (orientiert an der Reel-Breite, nicht am Viewport)
  verkleinert Buttons/Slider/Padding bei schmalen Reels und blendet
  das Zeit-Label bei sehr schmalen Reels aus
2026-08-08 11:40:27 +02:00

248 lines
5.4 KiB
CSS

/* ============================================================
Reels Controls — controls.css
============================================================ */
/* Eigener Box-Sizing-Reset: nicht auf Instagrams globales
Reset vertrauen — unsere Elemente müssen immer border-box sein,
sonst wird die Leiste (width:100% + padding) breiter als das Reel. */
.rc-wrapper,
.rc-wrapper *,
.rc-wrapper *::before,
.rc-wrapper *::after {
box-sizing: border-box;
}
.rc-wrapper {
position: absolute;
left: 0;
right: 0;
bottom: 0;
z-index: 9999;
pointer-events: none; /* nur die Leiste selbst ist klickbar */
display: flex;
justify-content: center;
padding: 0 12px 14px;
/* Container-Query: erlaubt, die Leisten-Elemente an der
REEL-Breite (nicht am Viewport) auszurichten — wichtig,
damit auf schmalen Reels nichts über den Rand ragt. */
container-type: inline-size;
container-name: rc;
}
.rc-bar {
pointer-events: auto;
display: flex;
align-items: center;
gap: 10px;
width: 100%;
max-width: 460px;
/* min-width:0 erlaubt flex-Kindern (Slider/Progress) zu
schrumpfen, statt über den Rand zu drücken. */
min-width: 0;
padding: 9px 12px;
border-radius: 14px;
background: rgba(0, 0, 0, 0.62);
backdrop-filter: blur(10px) saturate(140%);
-webkit-backdrop-filter: blur(10px) saturate(140%);
border: 1px solid rgba(255, 255, 255, 0.12);
box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
sans-serif;
opacity: 0.35;
transform: translateY(2px);
transition: opacity 0.18s ease, transform 0.18s ease;
}
.rc-wrapper:hover .rc-bar,
.rc-bar:focus-within {
opacity: 1;
transform: translateY(0);
}
/* --- Buttons ------------------------------------------------ */
.rc-btn {
flex: 0 0 auto;
width: 34px;
height: 34px;
display: grid;
place-items: center;
padding: 0;
border: none;
border-radius: 9px;
background: rgba(255, 255, 255, 0.08);
cursor: pointer;
transition: background 0.15s ease, transform 0.1s ease;
}
.rc-btn:hover {
background: rgba(255, 255, 255, 0.2);
}
.rc-btn:active {
transform: scale(0.92);
}
.rc-btn svg {
width: 20px;
height: 20px;
fill: #fff;
display: block;
}
/* --- Fortschrittsbalken ------------------------------------- */
.rc-progress {
position: relative;
flex: 1 1 auto;
height: 16px; /* großzügige Klickfläche */
display: flex;
align-items: center;
cursor: pointer;
}
.rc-progress::before {
content: "";
position: absolute;
left: 0;
right: 0;
height: 4px;
border-radius: 4px;
background: rgba(255, 255, 255, 0.25);
}
.rc-progress-fill {
position: absolute;
left: 0;
height: 4px;
width: 0;
border-radius: 4px;
background: linear-gradient(90deg, #f58529, #dd2a7b, #8134af);
}
.rc-progress-knob {
position: absolute;
left: 0;
width: 12px;
height: 12px;
border-radius: 50%;
background: #fff;
transform: translateX(-50%);
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
opacity: 0;
transition: opacity 0.15s ease;
}
.rc-progress:hover .rc-progress-knob,
.rc-bar:focus-within .rc-progress-knob {
opacity: 1;
}
/* --- Zeitanzeige -------------------------------------------- */
.rc-time {
flex: 0 0 auto;
font-size: 11px;
font-variant-numeric: tabular-nums;
color: rgba(255, 255, 255, 0.85);
white-space: nowrap;
user-select: none;
}
/* --- Lautstärke-Slider ------------------------------------- */
.rc-vol-slider {
flex: 0 1 70px; /* darf schrumpfen, statt zu überlaufen */
min-width: 0;
height: 16px;
-webkit-appearance: none;
appearance: none;
background: transparent;
cursor: pointer;
}
.rc-vol-slider::-webkit-slider-runnable-track {
height: 4px;
border-radius: 4px;
background: linear-gradient(
to right,
#fff 0%,
#fff var(--rc-fill, 100%),
rgba(255, 255, 255, 0.25) var(--rc-fill, 100%)
);
}
.rc-vol-slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
margin-top: -4px;
width: 12px;
height: 12px;
border-radius: 50%;
background: #fff;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.rc-vol-slider::-moz-range-track {
height: 4px;
border-radius: 4px;
background: rgba(255, 255, 255, 0.25);
}
.rc-vol-slider::-moz-range-progress {
height: 4px;
border-radius: 4px;
background: #fff;
}
.rc-vol-slider::-moz-range-thumb {
width: 12px;
height: 12px;
border: none;
border-radius: 50%;
background: #fff;
}
/* ============================================================
Responsiv — orientiert an der REEL-Breite (Container-Query),
nicht am Viewport. So bleibt die Leiste auch bei schmalen
Reels / kleinen Fenstern sauber im Video-Rahmen.
============================================================ */
/* Schmale Reels: Elemente verkleinern, Padding/Gap reduzieren. */
@container rc (max-width: 380px) {
.rc-wrapper {
padding: 0 8px 10px;
}
.rc-bar {
gap: 6px;
padding: 7px 9px;
border-radius: 12px;
}
.rc-btn {
width: 28px;
height: 28px;
}
.rc-btn svg {
width: 16px;
height: 16px;
}
.rc-vol-slider {
flex-basis: 50px;
}
.rc-time {
font-size: 10px;
}
}
/* Sehr schmale Reels: Zeit-Label ausblenden, Slider weiter
schrumpfen, damit Buttons + Progress + Slider garantierter
in die Breite passen. */
@container rc (max-width: 260px) {
.rc-bar {
gap: 4px;
padding: 6px 7px;
}
.rc-time {
display: none;
}
.rc-vol-slider {
flex-basis: 40px;
}
}