Browse Source
feat: implement multi-language infrastructure and dynamic question components for marriage matching system
front-test-2
feat: implement multi-language infrastructure and dynamic question components for marriage matching system
front-test-2
52 changed files with 1026 additions and 1255 deletions
-
8src/app/api/dev-reset-profile/route.ts
-
10src/app/api/proxy/route.ts
-
4src/app/finding-match/page.tsx
-
107src/app/globals.css
-
55src/app/intro/page.tsx
-
4src/app/page.tsx
-
4src/app/questions-list/page.tsx
-
22src/components/Componentes/notice-box.tsx
-
11src/components/Componentes/question-dropdown.tsx
-
40src/components/Componentes/question-radio.tsx
-
8src/components/Componentes/question-section-flow.tsx
-
1src/components/Componentes/question-snap-list.tsx
-
5src/components/Componentes/required-steps-card.tsx
-
26src/components/Componentes/slider-header.tsx
-
94src/components/Componentes/slider-page.tsx
-
6src/components/Componentes/slider-slide-five.tsx
-
20src/components/Componentes/slider-slide-four.tsx
-
390src/components/Componentes/slider-slide-one.tsx
-
19src/components/Componentes/slider-slide-three.tsx
-
37src/components/Componentes/slider-slide-two.tsx
-
17src/components/Componentes/token-switcher.tsx
-
90src/components/Componentes/video-player.tsx
-
588src/data/questions/en.json
-
588src/data/questions/fa.json
-
1src/hooks/marriage/use-marriage-config.ts
-
40src/hooks/marriage/use-section-data.ts
-
16src/lib/auth-bridge.ts
-
22src/lib/http.ts
-
2src/translations/locales/ar.json
-
2src/translations/locales/az.json
-
2src/translations/locales/bn.json
-
2src/translations/locales/da.json
-
2src/translations/locales/de.json
-
2src/translations/locales/en.json
-
2src/translations/locales/es.json
-
2src/translations/locales/fa.json
-
2src/translations/locales/fr.json
-
2src/translations/locales/gu.json
-
2src/translations/locales/ha.json
-
2src/translations/locales/he.json
-
2src/translations/locales/hi.json
-
2src/translations/locales/id.json
-
2src/translations/locales/ks.json
-
2src/translations/locales/pt.json
-
2src/translations/locales/ru.json
-
2src/translations/locales/sw.json
-
2src/translations/locales/tg.json
-
2src/translations/locales/tr.json
-
2src/translations/locales/ul.json
-
2src/translations/locales/ur.json
-
2src/translations/locales/uz.json
-
2src/translations/locales/zh.json
@ -0,0 +1,26 @@ |
|||
import type { ReactNode } from "react"; |
|||
|
|||
type SliderHeaderProps = { |
|||
index: number; |
|||
title: ReactNode; |
|||
totalSteps?: number; |
|||
stepLabel?: string; |
|||
}; |
|||
|
|||
export function SliderHeader({ |
|||
index, |
|||
title, |
|||
totalSteps = 5, |
|||
stepLabel, |
|||
}: SliderHeaderProps) { |
|||
return ( |
|||
<div className="text-center"> |
|||
<p className="text-[#747474] group-10 font-semibold"> |
|||
{stepLabel || `Step ${index + 1} of ${totalSteps}`} |
|||
</p> |
|||
<p className="text-[#111111] group-16 font-bold">{title}</p> |
|||
</div> |
|||
); |
|||
} |
|||
|
|||
export default SliderHeader; |
|||
@ -0,0 +1,90 @@ |
|||
"use client"; |
|||
|
|||
import { useEffect, useState, type FC } from "react"; |
|||
import { createPortal } from "react-dom"; |
|||
|
|||
type VideoPlayerProps = { |
|||
isOpen: boolean; |
|||
onClose: () => void; |
|||
videoUrl?: string; |
|||
}; |
|||
|
|||
export const VideoPlayer: FC<VideoPlayerProps> = ({ |
|||
isOpen, |
|||
onClose, |
|||
videoUrl, |
|||
}) => { |
|||
const [mounted, setMounted] = useState(false); |
|||
// Default to a responsive landscape layout that adapts nicely
|
|||
const [containerStyle, setContainerStyle] = useState( |
|||
"relative w-full max-w-[640px] aspect-video rounded-2xl overflow-hidden bg-black shadow-2xl transition-all duration-300 ease-out", |
|||
); |
|||
|
|||
useEffect(() => { |
|||
setMounted(true); |
|||
}, []); |
|||
|
|||
const handleLoadedMetadata = (e: React.SyntheticEvent<HTMLVideoElement>) => { |
|||
const video = e.currentTarget; |
|||
if (video.videoWidth && video.videoHeight) { |
|||
const ratio = video.videoWidth / video.videoHeight; |
|||
if (ratio < 0.8) { |
|||
// Vertical/portrait video (mobile format like TikTok/selfie)
|
|||
setContainerStyle( |
|||
"relative w-full max-w-[340px] sm:max-w-[380px] aspect-[9/16] rounded-2xl overflow-hidden bg-black shadow-2xl max-h-[82vh] transition-all duration-300 ease-out", |
|||
); |
|||
} else { |
|||
// Horizontal/landscape video (standard format)
|
|||
setContainerStyle( |
|||
"relative w-full max-w-[640px] sm:max-w-[720px] md:max-w-[800px] aspect-video rounded-2xl overflow-hidden bg-black shadow-2xl max-h-[85vh] transition-all duration-300 ease-out", |
|||
); |
|||
} |
|||
} |
|||
}; |
|||
|
|||
if (!isOpen || !mounted) return null; |
|||
|
|||
return createPortal( |
|||
<div |
|||
className="fixed inset-0 z-50 flex items-center justify-center bg-black/85 backdrop-blur-xs p-4" |
|||
onClick={onClose} |
|||
> |
|||
<div className={containerStyle} onClick={(e) => e.stopPropagation()}> |
|||
<button |
|||
onClick={onClose} |
|||
className="absolute top-3 right-3 sm:top-4 sm:right-4 z-10 flex items-center justify-center w-11 h-11 rounded-full bg-black/40 hover:bg-black/60 text-white transition-all active:scale-95 cursor-pointer backdrop-blur-xs" |
|||
aria-label="Close video player" |
|||
> |
|||
<svg |
|||
xmlns="http://www.w3.org/2000/svg" |
|||
className="h-6 w-6" |
|||
fill="none" |
|||
viewBox="0 0 24 24" |
|||
stroke="currentColor" |
|||
> |
|||
<path |
|||
strokeLinecap="round" |
|||
strokeLinejoin="round" |
|||
strokeWidth={2} |
|||
d="M6 18L18 6M6 6l12 12" |
|||
/> |
|||
</svg> |
|||
</button> |
|||
<video |
|||
src={ |
|||
videoUrl || |
|||
"https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" |
|||
} |
|||
controls |
|||
autoPlay |
|||
playsInline |
|||
onLoadedMetadata={handleLoadedMetadata} |
|||
className="w-full h-full object-contain" |
|||
/> |
|||
</div> |
|||
</div>, |
|||
document.body, |
|||
); |
|||
}; |
|||
|
|||
export default VideoPlayer; |
|||
588
src/data/questions/en.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
588
src/data/questions/fa.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue