diff --git a/css/style.css b/css/style.css
index dffc482a..5d6ded57 100644
--- a/css/style.css
+++ b/css/style.css
@@ -247,14 +247,19 @@ header img {
#playerModal {
position: fixed;
inset: 0;
- background-color: rgb(0 0 0 / 0.9); /* You can adjust opacity if needed */
- z-index: 50;
- display: none; /* Hidden by default */
+ z-index: 100;
+ display: none;
flex-direction: column;
+ align-items: stretch;
+ justify-content: stretch;
+ width: 100vw;
+ height: 100vh;
+ background-color: #0f172a;
+ color: #e2e8f0;
+ overflow-x: hidden;
overflow-y: auto;
overscroll-behavior: contain;
- backdrop-filter: blur(0.625rem);
- -webkit-backdrop-filter: blur(0.625rem); /* For Safari support */
+ -webkit-overflow-scrolling: touch;
}
#nostrFormModal,
@@ -269,6 +274,69 @@ header img {
display: flex;
}
+#playerModal .player-modal__container {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ height: 100%;
+ min-height: 100vh;
+ padding: 0;
+ margin: 0;
+}
+
+#playerModal .player-modal__content {
+ position: relative;
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ min-height: 100%;
+ max-width: none;
+ background-color: #0f172a;
+ overflow: visible;
+ box-shadow: none;
+ animation: fadeIn var(--modal-motion-duration) ease-out;
+}
+
+#playerModal .player-modal__video {
+ width: 100%;
+ background-color: #000;
+ position: sticky;
+ top: 0;
+ z-index: 51;
+ flex-shrink: 0;
+}
+
+#playerModal .player-modal__video video {
+ width: 100%;
+ aspect-ratio: 16 / 9;
+ background-color: #000;
+}
+
+#playerModal .player-modal__info {
+ flex: 0 0 auto;
+ padding: 1.5rem;
+ padding-bottom: 3rem;
+}
+
+html.modal-open {
+ overflow: hidden;
+}
+
+body.modal-open {
+ overflow: hidden;
+}
+
+html.modal-open,
+body.modal-open {
+ height: 100%;
+}
+
+body.modal-open #app {
+ overflow: hidden;
+}
+
/* Modal Content Container */
.modal-content {
width: 100%;
@@ -296,15 +364,6 @@ header img {
}
}
-/* Video Container */
-.video-container {
- width: 100%;
- background-color: black;
- position: sticky;
- top: 0;
- z-index: 51;
-}
-
/* Modal Video */
#modalVideo {
width: 100%;
@@ -312,21 +371,8 @@ header img {
background-color: black;
}
-/* Video Info Section */
-.video-info {
- padding: 1rem;
- flex: 1;
- overflow-y: auto;
-}
-
/* Responsive Adjustments */
@media (min-width: 768px) {
- #playerModal {
- padding: 2rem;
- align-items: center;
- justify-content: center;
- }
-
.modal-content {
max-width: 64rem;
max-height: calc(100vh - 4rem); /* Account for padding */
@@ -334,8 +380,9 @@ header img {
overflow: visible;
}
- .video-container {
- position: relative;
+ #playerModal .player-modal__content {
+ max-width: none;
+ border-radius: 0;
}
}
@@ -595,7 +642,7 @@ footer a:hover {
}
/* Video info cards */
-.video-info .bg-gray-800\/50 {
+.player-modal__info .bg-gray-800\/50 {
background-color: rgb(31 41 55 / 0.5);
backdrop-filter: blur(0.25rem);
}
diff --git a/js/app.js b/js/app.js
index 8f3ec6f9..e160c6d1 100644
--- a/js/app.js
+++ b/js/app.js
@@ -1004,9 +1004,11 @@ class bitvidApp {
if (!modalNav || !playerModal) {
throw new Error("Modal nav (#modalNav) or #playerModal not found!");
}
+ const scrollRegion =
+ playerModal.querySelector(".player-modal__content") || playerModal;
let lastScrollY = 0;
- playerModal.addEventListener("scroll", (e) => {
- const currentScrollY = e.target.scrollTop;
+ scrollRegion.addEventListener("scroll", () => {
+ const currentScrollY = scrollRegion.scrollTop;
const shouldShowNav =
currentScrollY <= lastScrollY || currentScrollY < 50;
modalNav.style.transform = shouldShowNav
@@ -1145,6 +1147,12 @@ class bitvidApp {
if (this.playerModal) {
this.playerModal.style.display = "flex";
this.playerModal.classList.remove("hidden");
+ document.body.classList.add("modal-open");
+ document.documentElement.classList.add("modal-open");
+ const scrollRegion =
+ this.playerModal.querySelector(".player-modal__content") ||
+ this.playerModal;
+ scrollRegion.scrollTop = 0;
}
this.applyModalLoadingPoster();
}
@@ -5775,6 +5783,8 @@ class bitvidApp {
this.playerModal.style.display = "none";
this.playerModal.classList.add("hidden");
}
+ document.body.classList.remove("modal-open");
+ document.documentElement.classList.remove("modal-open");
if (typeof this.modalPosterCleanup === "function") {
this.modalPosterCleanup();
this.modalPosterCleanup = null;