diff --git a/assets/pasted-20260415-150837-fa591359.png b/assets/pasted-20260415-150837-fa591359.png deleted file mode 100644 index 6654b4c..0000000 Binary files a/assets/pasted-20260415-150837-fa591359.png and /dev/null differ diff --git a/backend/src/config.js b/backend/src/config.js index 19259af..fef0a57 100644 --- a/backend/src/config.js +++ b/backend/src/config.js @@ -69,7 +69,7 @@ const config = { config.pexelsKey = process.env.PEXELS_KEY || ''; -config.pexelsQuery = 'cozy home cinema tv popcorn'; +config.pexelsQuery = 'Neon-lit cinema hallway'; config.host = process.env.NODE_ENV === "production" ? config.remote : "http://localhost"; config.apiUrl = `${config.host}${config.port ? `:${config.port}` : ``}/api`; config.swaggerUrl = `${config.swaggerUI}${config.swaggerPort}`; diff --git a/frontend/src/pages/login.tsx b/frontend/src/pages/login.tsx index f3e5feb..da82ec2 100644 --- a/frontend/src/pages/login.tsx +++ b/frontend/src/pages/login.tsx @@ -20,7 +20,7 @@ import { findMe, loginUser, resetAction } from '../stores/authSlice'; import { useAppDispatch, useAppSelector } from '../stores/hooks'; import Link from 'next/link'; import {toast, ToastContainer} from "react-toastify"; -import { getPexelsImage } from '../helpers/pexels' +import { getPexelsImage, getPexelsVideo } from '../helpers/pexels' export default function Login() { const router = useRouter(); @@ -28,13 +28,15 @@ export default function Login() { const textColor = useAppSelector((state) => state.style.linkColor); const iconsColor = useAppSelector((state) => state.style.iconsColor); const notify = (type, msg) => toast(msg, { type }); - const [illustrationImage, setIllustrationImage] = useState({ - src: undefined, - photographer: undefined, - photographer_url: undefined, - }); - const contentPosition = 'left'; - const [showPassword, setShowPassword] = useState(false); + const [ illustrationImage, setIllustrationImage ] = useState({ + src: undefined, + photographer: undefined, + photographer_url: undefined, + }) + const [ illustrationVideo, setIllustrationVideo ] = useState({video_files: []}) + const [contentType, setContentType] = useState('video'); + const [contentPosition, setContentPosition] = useState('left'); + const [showPassword, setShowPassword] = useState(false); const { currentUser, isFetching, errorMessage, token, notify:notifyState } = useAppSelector( (state) => state.auth, ); @@ -44,14 +46,15 @@ export default function Login() { const title = 'Movies & TV Tracker' - // Fetch a single movie-themed illustration for the login page - useEffect(() => { - async function fetchData() { - const image = await getPexelsImage(); - setIllustrationImage(image); - } - - fetchData(); + // Fetch Pexels image/video + useEffect( () => { + async function fetchData() { + const image = await getPexelsImage() + const video = await getPexelsVideo() + setIllustrationImage(image); + setIllustrationVideo(video); + } + fetchData(); }, []); // Fetch user data useEffect(() => { @@ -98,44 +101,46 @@ export default function Login() { }; const imageBlock = (image) => ( -
-
-
- - Movie Night Ready - -

- Track every movie and series in one cinematic hub. -

-

- Save your watchlist, discover what to stream next, and keep your entertainment world organized. -

-
-
-

Tonight's vibe

-

Big screen energy with a premium streaming feel.

-

- Photo by{' '} - - {image?.photographer || 'Pexels'} - - {' '}on Pexels -

-
+
+
+ Photo + by {image?.photographer} on Pexels +
-
- ); + ) + const videoBlock = (video) => { + if (video?.video_files?.length > 0) { + return ( +
+ +
+ + Video by {video.user.name} on Pexels + +
+
) + } + }; return (
- {contentPosition !== 'background' ? imageBlock(illustrationImage) : null} + {contentType === 'image' && contentPosition !== 'background' ? imageBlock(illustrationImage) : null} + {contentType === 'video' && contentPosition !== 'background' ? videoBlock(illustrationVideo) : null}