Skip to content

Commit 029b93a

Browse files
committed
opti affichage
1 parent 3016184 commit 029b93a

File tree

2 files changed

+13
-35
lines changed

2 files changed

+13
-35
lines changed

static/style.css

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ body {
2626
font-family: 'Inter', system-ui, -apple-system, sans-serif;
2727
line-height: 1.5;
2828
-webkit-font-smoothing: antialiased;
29+
min-height: 100vh;
30+
display: flex;
31+
flex-direction: column;
2932
}
3033

3134
.topbar {
@@ -208,6 +211,7 @@ body {
208211

209212
main {
210213
padding: .6rem 1.2rem 1rem 1.2rem;
214+
flex: 1;
211215
}
212216

213217
.grid {
@@ -581,22 +585,15 @@ h3 {
581585
/* --- iOS/Android landscape optimisations --- */
582586
@media (orientation: landscape) {
583587
#v {
584-
max-height: 80dvh;
585-
height: auto;
588+
max-height: 85vh;
586589
width: 100%;
587590
}
588591
}
589592

590593
@supports (-webkit-touch-callout: none) {
591594
@media (orientation: landscape) {
592-
593-
html,
594-
body {
595-
height: 100dvh;
596-
}
597-
598595
#v {
599-
max-height: 80dvh;
596+
max-height: 80vh;
600597
}
601598
}
602599
}

templates/watch.html

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -432,36 +432,17 @@
432432

433433
if (currentZoom === 1) {
434434
playerWrap.style.width = '100%';
435-
playerWrap.style.maxWidth = '1400px';
435+
playerWrap.style.maxWidth = '1400px';
436+
v.style.maxHeight = '80vh'; // Restore height constraint
436437
} else {
437-
// Calculate Native Dimensions
438-
const nativeW = v.videoWidth || 1920;
439-
const watchContainer = document.querySelector('.watch');
440-
const containerW = watchContainer ? watchContainer.clientWidth : window.innerWidth;
441-
442-
// Target width based on container width * zoom factor
443-
let targetW = containerW * currentZoom;
444-
445-
// Cap at native video width to prevent upscaling blurriness,
446-
// unless native is smaller than container, then allow up to native.
447-
// Actually user wants x1.5 / x2 of "origin size" AND "window size".
448-
// Let's interpret: expand player to 1.5x or 2x of current view, limited by Native.
449-
450-
// Simply: apply width % on player-wrap.
451-
// But player-wrap has max-width 1400px.
452-
// We override max-width to allow expansion.
438+
// Zoom logic: Scale relative to viewport width
439+
// We remove constraints to allow "true" zoom (upscaling)
440+
const viewportW = window.innerWidth;
441+
let targetW = viewportW * currentZoom;
453442

454443
playerWrap.style.maxWidth = 'none';
455-
456-
// If we strictly follow "according to native size", we should cap.
457-
if (targetW > nativeW) {
458-
targetW = nativeW;
459-
}
460-
461-
// If targetW is still smaller than containerW (small video), we just set it to targetW.
462-
// But if it's larger, it will overflow.
463-
464444
playerWrap.style.width = targetW + 'px';
445+
v.style.maxHeight = 'none'; // Uncap height to allow proportional growth
465446
}
466447
}
467448

0 commit comments

Comments
 (0)