diff options
| author | joonhoekim <26rote@gmail.com> | 2025-11-07 09:48:37 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-11-07 09:48:37 +0900 |
| commit | e21adbaf000c5ca1c2f5211478cac6a2e7fbfdbd (patch) | |
| tree | 9f41b2cccbebc597be2759d005913272bfb2837e | |
| parent | 98e86ada15b2a867374188c79f78f5578018a911 (diff) | |
(김준회) SHI 로그인 화면도 비디오 배경화면 사용하도록 변경, 로그인 화면 비디오 배경 공통컴포넌트로 추출
| -rw-r--r-- | components/login/login-form-shi.tsx | 24 | ||||
| -rw-r--r-- | components/login/login-form.tsx | 62 | ||||
| -rw-r--r-- | components/login/video-background.tsx | 75 |
3 files changed, 81 insertions, 80 deletions
diff --git a/components/login/login-form-shi.tsx b/components/login/login-form-shi.tsx index 0be6709a..fa27e0f3 100644 --- a/components/login/login-form-shi.tsx +++ b/components/login/login-form-shi.tsx @@ -20,9 +20,9 @@ import { sendOtpAction } from "@/lib/users/send-otp"; import { verifyTokenAction } from "@/lib/users/verifyToken"; import { buttonVariants } from "@/components/ui/button" import Link from "next/link" -import Image from 'next/image'; // 추가: Image 컴포넌트 import import { KnoxSSOButton } from './saml-login-button'; // SAML 로그인 버튼 import import Loading from "../common/loading/loading"; +import { VideoBackground } from "./video-background"; export function LoginFormSHI({ className, @@ -363,26 +363,8 @@ export function LoginFormSHI({ </div> </div> - {/* Right BG 이미지 영역 - Image 컴포넌트로 수정 */} - <div className="relative hidden h-full flex-col p-10 text-white dark:border-r md:flex"> - {/* Image 컴포넌트로 대체 */} - <div className="absolute inset-0"> - <Image - src="/images/02.jpg" - alt="Background image" - fill - priority - sizes="(max-width: 1024px) 100vw, 50vw" - className="object-cover" - /> - </div> - <div className="relative z-10 mt-auto"> - <blockquote className="space-y-2"> - <p className="text-sm">“{t("blockquote")}”</p> - {/* <footer className="text-sm">SHI</footer> */} - </blockquote> - </div> - </div> + {/* Right BG 영상 영역 */} + <VideoBackground quote={t("blockquote")} /> </div> ) }
\ No newline at end of file diff --git a/components/login/login-form.tsx b/components/login/login-form.tsx index 51d54531..70a1e775 100644 --- a/components/login/login-form.tsx +++ b/components/login/login-form.tsx @@ -21,17 +21,7 @@ import { import { requestPasswordResetAction } from "@/lib/users/auth/partners-auth"; import { checkEmailAndStartAuth, resendEmailOtp } from "@/lib/users/auth/email-auth"; import Loading from "../common/loading/loading"; - -// 배경 영상 목록 -const BACKGROUND_VIDEOS = [ - '/background-videos/1.yard.mp4', - '/background-videos/2.SN2635_LNGC_CARDIFF.mp4', - '/background-videos/3.SN2628_CONT_WAN HAI.mp4', - '/background-videos/4.SN2612_LNGC_KGL.mp4', - '/background-videos/5.SN2596_LNGC_JP MORGAN.mp4', - '/background-videos/6.2235_FLNG_ENI_CORAL.mp4', - '/background-videos/7.2126_FLNG_PETRONAS.mp4', -]; +import { VideoBackground } from "./video-background"; export function LoginForm() { const params = useParams() || {}; @@ -44,9 +34,6 @@ export function LoginForm() { const { toast } = useToast(); const { data: session, status } = useSession(); - // 배경 영상 상태 - const [currentVideoIndex, setCurrentVideoIndex] = useState(0); - // 상태 관리 const [isFirstAuthLoading, setIsFirstAuthLoading] = useState(false); const [showForgotPassword, setShowForgotPassword] = useState(false); @@ -83,14 +70,11 @@ export function LoginForm() { // 호스트명 확인 상태 추가 const [isDataRoomHost, setIsDataRoomHost] = useState(false); - // 컴포넌트 마운트 시 호스트명 확인 및 랜덤 비디오 선택 + // 컴포넌트 마운트 시 호스트명 확인 useEffect(() => { if (typeof window !== 'undefined') { const hostname = window.location.hostname; setIsDataRoomHost(hostname.includes('shidataroom')); - - // 랜덤한 비디오 인덱스 선택 - setCurrentVideoIndex(Math.floor(Math.random() * BACKGROUND_VIDEOS.length)); } }, []); @@ -168,11 +152,6 @@ export function LoginForm() { router.push(`/${lng}/partners/repository`); }; - // 비디오 종료 시 다음 비디오로 전환 - const handleVideoEnd = () => { - setCurrentVideoIndex((prevIndex) => (prevIndex + 1) % BACKGROUND_VIDEOS.length); - }; - // MFA 카운트다운 효과 useEffect(() => { if (mfaCountdown > 0) { @@ -949,42 +928,7 @@ export function LoginForm() { </div> {/* Right BG 영상 영역 */} - <div className="relative hidden h-full flex-col p-10 text-white dark:border-r md:flex overflow-hidden"> - <div className="absolute inset-0"> - <video - key={currentVideoIndex} - autoPlay - muted - onEnded={handleVideoEnd} - className="w-full h-full object-cover" - playsInline - > - <source src={BACKGROUND_VIDEOS[currentVideoIndex]} type="video/mp4" /> - </video> - {/* 어두운 오버레이 */} - <div className="absolute inset-0 bg-black/30"></div> - </div> - <div className="relative z-10 mt-auto"> - <blockquote className="space-y-2 backdrop-blur-sm bg-black/20 p-4 rounded-lg"> - <p className="text-sm font-medium drop-shadow-lg">“{t("blockquote")}”</p> - </blockquote> - </div> - {/* 비디오 인디케이터 */} - <div className="relative z-10 flex justify-center space-x-2 mb-4"> - {BACKGROUND_VIDEOS.map((_, index) => ( - <div - key={index} - className={cn( - "w-2 h-2 rounded-full transition-all duration-300", - index === currentVideoIndex - ? "bg-white w-8" - : "bg-white/50 hover:bg-white/75 cursor-pointer" - )} - onClick={() => setCurrentVideoIndex(index)} - /> - ))} - </div> - </div> + <VideoBackground quote={t("blockquote")} /> </div> ) }
\ No newline at end of file diff --git a/components/login/video-background.tsx b/components/login/video-background.tsx new file mode 100644 index 00000000..8d524996 --- /dev/null +++ b/components/login/video-background.tsx @@ -0,0 +1,75 @@ +'use client'; + +import { useState, useEffect } from 'react'; +import { cn } from '@/lib/utils'; + +// 배경 영상 목록 +const BACKGROUND_VIDEOS = [ + '/background-videos/1.yard.mp4', + '/background-videos/2.SN2635_LNGC_CARDIFF.mp4', + '/background-videos/3.SN2628_CONT_WAN HAI.mp4', + '/background-videos/4.SN2612_LNGC_KGL.mp4', + '/background-videos/5.SN2596_LNGC_JP MORGAN.mp4', + '/background-videos/6.2235_FLNG_ENI_CORAL.mp4', + '/background-videos/7.2126_FLNG_PETRONAS.mp4', +]; + +interface VideoBackgroundProps { + quote: string; +} + +export function VideoBackground({ quote }: VideoBackgroundProps) { + const [currentVideoIndex, setCurrentVideoIndex] = useState(0); + + // 컴포넌트 마운트 시 랜덤한 비디오 선택 + useEffect(() => { + if (typeof window !== 'undefined') { + setCurrentVideoIndex(Math.floor(Math.random() * BACKGROUND_VIDEOS.length)); + } + }, []); + + // 비디오 종료 시 다음 비디오로 전환 + const handleVideoEnd = () => { + setCurrentVideoIndex((prevIndex) => (prevIndex + 1) % BACKGROUND_VIDEOS.length); + }; + + return ( + <div className="relative hidden h-full flex-col p-10 text-white dark:border-r md:flex overflow-hidden"> + <div className="absolute inset-0"> + <video + key={currentVideoIndex} + autoPlay + muted + onEnded={handleVideoEnd} + className="w-full h-full object-cover" + playsInline + > + <source src={BACKGROUND_VIDEOS[currentVideoIndex]} type="video/mp4" /> + </video> + {/* 어두운 오버레이 */} + <div className="absolute inset-0 bg-black/30"></div> + </div> + <div className="relative z-10 mt-auto"> + <blockquote className="space-y-2 backdrop-blur-sm bg-black/20 p-4 rounded-lg"> + <p className="text-sm font-medium drop-shadow-lg">“{quote}”</p> + </blockquote> + </div> + {/* 비디오 인디케이터 */} + <div className="relative z-10 flex justify-center space-x-2 mb-4"> + {BACKGROUND_VIDEOS.map((_, index) => ( + <div + key={index} + className={cn( + "w-2 h-2 rounded-full transition-all duration-300", + index === currentVideoIndex + ? "bg-white w-8" + : "bg-white/50 hover:bg-white/75 cursor-pointer" + )} + onClick={() => setCurrentVideoIndex(index)} + /> + ))} + </div> + </div> + ); +} + |
