Redesign video player styling

This commit is contained in:
Mert Uyanık
2025-10-30 04:14:28 +03:00
parent 183cc65455
commit 1113ca891c
11 changed files with 265 additions and 511 deletions
+47 -167
View File
@@ -1,14 +1,8 @@
/* ============================================
VIDEO ELEMENT
Modern & Clean Design
============================================ */
.video-container {
position: relative;
width: 100%;
height: 100%;
z-index: var(--player-z-video);
overflow: visible;
pointer-events: none;
}
@@ -18,12 +12,9 @@
display: block;
object-fit: contain;
pointer-events: auto;
background-color: #000;
}
/* ============================================
HIDE NATIVE CONTROLS
============================================ */
.video-element::-webkit-media-controls,
.video-element::-webkit-media-controls-enclosure,
.video-element::-webkit-media-controls-panel {
@@ -34,106 +25,79 @@
display: none !important;
}
/* ============================================
SUBTITLE STYLING - Clean & Modern
Cross-browser compatible
============================================ */
/* Base subtitle appearance */
::cue {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
font-size: 1.4rem !important;
font-weight: 600 !important;
line-height: 1.4 !important;
color: #ffffff !important;
background-color: rgba(0, 0, 0, 0.85) !important;
padding: 0.3em 0.65em !important;
border-radius: 4px !important;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
white-space: pre-line !important;
}
::cue,
.video-element::cue {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
font-size: 1.4rem !important;
font-weight: 600 !important;
line-height: 1.4 !important;
font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI',
'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
font-size: 1.28rem !important;
font-weight: 500 !important;
line-height: 1.45 !important;
letter-spacing: 0.01em !important;
color: #ffffff !important;
background-color: rgba(0, 0, 0, 0.85) !important;
padding: 0.3em 0.65em !important;
border-radius: 4px !important;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
background-color: rgba(15, 15, 15, 0.78) !important;
padding: 0.35em 0.75em !important;
border-radius: var(--player-radius-sm) !important;
text-shadow: none !important;
white-space: pre-line !important;
}
/* Firefox specific */
::-moz-cue,
video::-moz-cue,
.video-element::-moz-cue {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
font-size: 1.4rem !important;
font-weight: 600 !important;
line-height: 1.4 !important;
font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI',
'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
font-size: 1.28rem !important;
font-weight: 500 !important;
line-height: 1.45 !important;
letter-spacing: 0.01em !important;
color: #ffffff !important;
background-color: rgba(0, 0, 0, 0.85) !important;
padding: 0.3em 0.65em !important;
border-radius: 4px !important;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
background-color: rgba(15, 15, 15, 0.78) !important;
padding: 0.35em 0.75em !important;
border-radius: var(--player-radius-sm) !important;
text-shadow: none !important;
white-space: pre-line !important;
}
/* Text formatting */
::cue(b), ::cue(strong),
.video-element::cue(b), .video-element::cue(strong) {
::cue(b),
::cue(strong),
.video-element::cue(b),
.video-element::cue(strong),
::-moz-cue(b),
::-moz-cue(strong) {
font-weight: 700 !important;
}
::cue(i), ::cue(em),
.video-element::cue(i), .video-element::cue(em) {
::cue(i),
::cue(em),
.video-element::cue(i),
.video-element::cue(em),
::-moz-cue(i),
::-moz-cue(em) {
font-style: italic !important;
}
::cue(u),
.video-element::cue(u) {
text-decoration: underline !important;
}
::-moz-cue(b), ::-moz-cue(strong) {
font-weight: 700 !important;
}
::-moz-cue(i), ::-moz-cue(em) {
font-style: italic !important;
}
.video-element::cue(u),
::-moz-cue(u) {
text-decoration: underline !important;
}
/* ============================================
SUBTITLE POSITIONING - Chromium
============================================ */
.video-element::-webkit-media-text-track-container {
position: absolute !important;
bottom: var(--player-subtitle-bottom) !important;
left: 0 !important;
right: 0 !important;
bottom: var(--player-subtitle-bottom) !important;
width: 100% !important;
height: auto !important;
display: flex !important;
flex-direction: column !important;
align-items: center !important;
justify-content: center !important;
padding: 0 16px !important;
padding: 0 18px !important;
margin: 0 !important;
overflow: visible !important;
z-index: 10 !important;
z-index: var(--player-z-subtitle) !important;
pointer-events: none !important;
transition: bottom 0.2s ease !important;
transition: bottom var(--player-transition-fast) ease !important;
}
/* When controls are hidden, move subtitles down */
.video-player.controls-hidden .video-element::-webkit-media-text-track-container {
bottom: var(--player-subtitle-bottom-hidden) !important;
}
@@ -150,119 +114,35 @@ video::-moz-cue,
text-align: center !important;
}
/* ============================================
SUBTITLE POSITIONING - Firefox
============================================ */
video::-moz-text-track-display,
.video-element::-moz-text-track-display {
position: absolute !important;
bottom: var(--player-subtitle-bottom) !important;
left: 0 !important;
right: 0 !important;
bottom: var(--player-subtitle-bottom) !important;
width: 100% !important;
display: flex !important;
flex-direction: column !important;
align-items: center !important;
justify-content: center !important;
padding: 0 16px !important;
padding: 0 18px !important;
margin: 0 !important;
text-align: center !important;
z-index: 10 !important;
z-index: var(--player-z-subtitle) !important;
pointer-events: none !important;
transition: bottom 0.2s ease !important;
transition: bottom var(--player-transition-fast) ease !important;
}
/* When controls are hidden, move subtitles down */
.video-player.controls-hidden video::-moz-text-track-display,
.video-player.controls-hidden .video-element::-moz-text-track-display {
bottom: var(--player-subtitle-bottom-hidden) !important;
}
/* ============================================
FULLSCREEN
============================================ */
.video-element:fullscreen::cue,
:fullscreen .video-element::cue {
font-size: 1.8rem !important;
padding: 0.4em 0.8em !important;
}
:fullscreen .video-element::cue,
::-moz-cue:fullscreen,
video:fullscreen::-moz-cue,
.video-element:fullscreen::-moz-cue,
:fullscreen ::-moz-cue,
:fullscreen video::-moz-cue,
:fullscreen .video-element::-moz-cue {
font-size: 1.8rem !important;
padding: 0.4em 0.8em !important;
}
.video-element:fullscreen::-webkit-media-text-track-container,
:fullscreen .video-element::-webkit-media-text-track-container {
bottom: calc(var(--player-subtitle-bottom) + 20px) !important;
}
video:fullscreen::-moz-text-track-display,
.video-element:fullscreen::-moz-text-track-display,
:fullscreen video::-moz-text-track-display,
:fullscreen .video-element::-moz-text-track-display {
bottom: calc(var(--player-subtitle-bottom) + 20px) !important;
}
/* ============================================
RESPONSIVE
============================================ */
@media (max-width: 768px) {
::cue,
.video-element::cue,
::-moz-cue,
video::-moz-cue,
.video-element::-moz-cue {
font-size: 1.25rem !important;
}
.video-player {
--player-subtitle-bottom: 85px;
}
}
@media (max-width: 640px) {
::cue,
.video-element::cue,
::-moz-cue,
video::-moz-cue,
.video-element::-moz-cue {
font-size: 1.1rem !important;
padding: 0.25em 0.55em !important;
}
.video-player {
--player-subtitle-bottom: 75px;
}
.video-element::-webkit-media-text-track-container {
padding: 0 12px !important;
}
video::-moz-text-track-display,
.video-element::-moz-text-track-display {
padding: 0 12px !important;
}
}
@media (max-width: 375px) {
::cue,
.video-element::cue,
::-moz-cue,
video::-moz-cue,
.video-element::-moz-cue {
font-size: 1rem !important;
}
.video-player {
--player-subtitle-bottom: 65px;
}
:fullscreen ::-moz-cue {
font-size: 1.6rem !important;
padding: 0.4em 0.85em !important;
}