From 4d22f2ca0b95f7c854eaafe880fa0c93d64eca5f Mon Sep 17 00:00:00 2001 From: NekoVari Date: Sat, 3 May 2025 00:18:12 +0700 Subject: [PATCH] make video can change position and js handle select character --- src/css/video.css | 27 +++-- src/pages/components/playVideo.jsx | 4 +- src/pages/introductionPage.jsx | 156 ++++++++++++++++++++++++----- 3 files changed, 149 insertions(+), 38 deletions(-) diff --git a/src/css/video.css b/src/css/video.css index 7d9c93e..225004d 100644 --- a/src/css/video.css +++ b/src/css/video.css @@ -3,18 +3,27 @@ overflow: hidden; } */ .video-container { + position: fixed; + top: 50%; + left: 0; + transform: translateY(-50%); + width: 100%; height: 100vh; overflow: hidden; } - -@media (orientation: landscape) { - .video-container { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - width: 100%; - height: 100%; +@media only screen and (max-device-width: 600px) { + .video-container.middle { + width: 200%; + height: 150vh; + left: 0%; + } + .video-container.left { + width: 300%; + left: 0%; + } + .video-container.right { + width: 200%; + left: -100%; } } diff --git a/src/pages/components/playVideo.jsx b/src/pages/components/playVideo.jsx index b6422c9..9ec11a6 100644 --- a/src/pages/components/playVideo.jsx +++ b/src/pages/components/playVideo.jsx @@ -1,10 +1,10 @@ import '../../css/video.css'; -function PlayVideo({ src = "hallway_FFF.mp4", onVideoReady }) { +function PlayVideo({ src = "hallway_MMM.mp4" ,side = "middle", onVideoReady }) { const urlSource = `${import.meta.env.VITE_ASSETS_URL}/${src}`; return ( -
+