This commit is contained in:
Daniil Chemerkin 2024-07-20 21:06:15 +00:00
parent 8635002ccb
commit b82579777a
29 changed files with 168 additions and 39 deletions

View File

@ -16,6 +16,7 @@ import Stepper from "../Stepper";
import { useLottie } from "@/hooks/lottie/useLottie"; import { useLottie } from "@/hooks/lottie/useLottie";
import { useMetricABFlags } from "@/services/metric/metricService.ts"; import { useMetricABFlags } from "@/services/metric/metricService.ts";
import { preloadImages } from "@/hooks/preload/images"; import { preloadImages } from "@/hooks/preload/images";
import { useTouchAction } from "@/hooks/touchAction/useTouchAction";
function QuestionnairePage(): JSX.Element { function QuestionnairePage(): JSX.Element {
const { question, stepId } = useParams(); const { question, stepId } = useParams();
@ -36,6 +37,11 @@ function QuestionnairePage(): JSX.Element {
useLottie({ useLottie({
preloadKey: currentQuestion?.lottie?.preloadKey, preloadKey: currentQuestion?.lottie?.preloadKey,
}); });
useTouchAction(
currentQuestion?.answers?.length && currentQuestion?.answers?.length < 3
? "none"
: currentQuestion?.touchAction
);
useEffect(() => { useEffect(() => {
if (currentQuestion?.preloadImages?.length) { if (currentQuestion?.preloadImages?.length) {

View File

@ -13,6 +13,7 @@
background-repeat: no-repeat; background-repeat: no-repeat;
color: #fff; color: #fff;
padding-top: 26px; padding-top: 26px;
padding-bottom: calc(0dvh + 64px);
width: 100%; width: 100%;
max-width: 460px; max-width: 460px;
} }

View File

@ -188,6 +188,7 @@ export const stepsQuestionary: IStep[] = [
id: "birthdate", id: "birthdate",
question: "What's your date of birth?", question: "What's your date of birth?",
preloadImages: ["/single-zodiac-info.webp"], preloadImages: ["/single-zodiac-info.webp"],
touchAction: "none",
answersElement: <BirthdateCustomAnswer />, answersElement: <BirthdateCustomAnswer />,
navigateToUrl: routes.client.singleZodiacInfoV1(), navigateToUrl: routes.client.singleZodiacInfoV1(),
}, },
@ -226,6 +227,7 @@ export const stepsQuestionary: IStep[] = [
question: "Where were you born?", question: "Where were you born?",
description: description:
"This determines the time zone at the place of your birth.", "This determines the time zone at the place of your birth.",
touchAction: "none",
answersElement: <BirthPlaceCustomAnswer />, answersElement: <BirthPlaceCustomAnswer />,
backgroundImage: "/birthPlace.webp", backgroundImage: "/birthPlace.webp",
backgroundColor: "#0000004d", backgroundColor: "#0000004d",
@ -544,6 +546,7 @@ export const stepsQuestionary: IStep[] = [
{ {
id: "partnerBirthdate", id: "partnerBirthdate",
question: "Whats your partners date of birth?", question: "Whats your partners date of birth?",
touchAction: "none",
answersElement: <BirthdateCustomAnswer affiliation="partner" />, answersElement: <BirthdateCustomAnswer affiliation="partner" />,
}, },
// TODO: add compatibility page // TODO: add compatibility page
@ -575,6 +578,7 @@ export const stepsQuestionary: IStep[] = [
{ {
id: "partnerBirthPlace", id: "partnerBirthPlace",
question: "Where was your partner born?", question: "Where was your partner born?",
touchAction: "none",
description: description:
"If you dont know the exact place of birth just type in the country of birth.", "If you dont know the exact place of birth just type in the country of birth.",
answersElement: <BirthPlaceCustomAnswer affiliation="partner" />, answersElement: <BirthPlaceCustomAnswer affiliation="partner" />,

View File

@ -11,9 +11,9 @@
background-position-x: center; background-position-x: center;
background-size: cover; background-size: cover;
color: #fff; color: #fff;
padding-top: 64px;
background-color: #0F1323; background-color: #0F1323;
padding-top: 32px; padding-top: 32px;
padding-bottom: calc(0dvh + 64px);
width: 100%; width: 100%;
max-width: 460px; max-width: 460px;
} }

View File

@ -39,6 +39,7 @@ function AlmostTherePage() {
return ( return (
<section className={`${styles.page} page`}> <section className={`${styles.page} page`}>
<div className={styles["background_wrap"]} />
<Header <Header
isBackButtonVisible={false} isBackButtonVisible={false}
classNameTitle={styles["header-title"]} classNameTitle={styles["header-title"]}

View File

@ -6,17 +6,30 @@
grid-template-rows: repeat(4, min-content); grid-template-rows: repeat(4, min-content);
min-height: 100vh; min-height: 100vh;
gap: 40px; gap: 40px;
color: #fff;
background-color: #0F1323;
padding-top: 32px;
padding-bottom: calc(0dvh + 64px);
width: 100%;
max-width: 460px;
}
.page > * {
z-index: 1;
}
.background_wrap {
z-index: 0;
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-image: url("/almost-there.webp");
background-position-y: top; background-position-y: top;
background-position-x: center; background-position-x: center;
background-size: contain; background-size: contain;
background-repeat: no-repeat; background-repeat: no-repeat;
color: #fff;
padding-top: 64px;
background-color: #0F1323;
padding-top: 32px;
background-image: url("/almost-there.webp");
width: 100%;
max-width: 460px;
} }
.header-title { .header-title {

View File

@ -12,6 +12,7 @@
background-size: cover; background-size: cover;
color: #fff; color: #fff;
padding-top: 32px; padding-top: 32px;
padding-bottom: calc(0dvh + 64px);
width: 100%; width: 100%;
max-width: 460px; max-width: 460px;
} }

View File

@ -9,6 +9,7 @@
background-repeat: no-repeat; background-repeat: no-repeat;
color: #fff; color: #fff;
padding: 33px 16px; padding: 33px 16px;
padding-bottom: calc(0dvh + 64px);
background-color: #171717; background-color: #171717;
width: 100%; width: 100%;
max-width: 460px; max-width: 460px;

View File

@ -13,6 +13,7 @@ import BackgroundTopBlob from "../../ui/BackgroundTopBlob";
import Header from "../../components/Header"; import Header from "../../components/Header";
import { ELottieKeys, useLottie } from "@/hooks/lottie/useLottie"; import { ELottieKeys, useLottie } from "@/hooks/lottie/useLottie";
import { usePreloadImages } from "@/hooks/preload/images"; import { usePreloadImages } from "@/hooks/preload/images";
import { useTouchAction } from "@/hooks/touchAction/useTouchAction";
function LoadingInRelationshipPage() { function LoadingInRelationshipPage() {
const navigate = useNavigate(); const navigate = useNavigate();
@ -51,6 +52,7 @@ function LoadingInRelationshipPage() {
"/crystal_ball.webp", "/crystal_ball.webp",
"/technologist.webp", "/technologist.webp",
]); ]);
useTouchAction("none");
useLottie({ useLottie({
preloadKey: ELottieKeys.key, preloadKey: ELottieKeys.key,

View File

@ -9,6 +9,7 @@
background: #0F1323; background: #0F1323;
color: #fff; color: #fff;
padding-top: 32px; padding-top: 32px;
padding-bottom: calc(0dvh + 64px);
width: 100%; width: 100%;
max-width: 460px; max-width: 460px;
} }

View File

@ -29,6 +29,7 @@ function NotAlonePage() {
return ( return (
<section className={`${styles.page} page`}> <section className={`${styles.page} page`}>
<div className={styles["background_wrap"]} />
<Header <Header
isBackButtonVisible={false} isBackButtonVisible={false}
classNameTitle={styles["header-title"]} classNameTitle={styles["header-title"]}

View File

@ -6,17 +6,31 @@
justify-items: center; justify-items: center;
grid-template-rows: repeat(4, min-content); grid-template-rows: repeat(4, min-content);
gap: 40px; gap: 40px;
background: url("/DeWatermark2.webp");
background-position-y: bottom;
background-position-x: center;
background-size: cover;
color: #fff; color: #fff;
padding-top: 64px;
background-color: #0F1323; background-color: #0F1323;
padding-top: 32px; padding-top: 32px;
padding-bottom: calc(0dvh + 64px);
width: 100%; width: 100%;
max-width: 460px; max-width: 460px;
} }
.page > * {
z-index: 1;
}
.background_wrap {
z-index: 0;
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-size: cover;
background-image: url("/DeWatermark2.webp");
background-position-y: bottom;
background-position-x: center;
background-repeat: no-repeat;
}
.header-title { .header-title {
color: #fff !important; color: #fff !important;

View File

@ -12,6 +12,7 @@
background-size: cover; background-size: cover;
color: #fff; color: #fff;
padding-top: 32px; padding-top: 32px;
padding-bottom: calc(0dvh + 64px);
width: 100%; width: 100%;
max-width: 460px; max-width: 460px;
} }

View File

@ -12,6 +12,7 @@
background-size: cover; background-size: cover;
color: #fff; color: #fff;
padding-top: 32px; padding-top: 32px;
padding-bottom: calc(0dvh + 64px);
width: 100%; width: 100%;
max-width: 460px; max-width: 460px;
} }

View File

@ -12,6 +12,7 @@
background-size: cover; background-size: cover;
color: #fff; color: #fff;
padding-top: 32px; padding-top: 32px;
padding-bottom: calc(0dvh + 64px);
width: 100%; width: 100%;
max-width: 460px; max-width: 460px;
} }

View File

@ -12,6 +12,7 @@
background-repeat: no-repeat; background-repeat: no-repeat;
color: #fff; color: #fff;
padding-top: 32px; padding-top: 32px;
padding-bottom: calc(0dvh + 64px);
width: 100%; width: 100%;
max-width: 460px; max-width: 460px;
} }

View File

@ -25,6 +25,7 @@ function RelationshipAlmostTherePage() {
return ( return (
<section className={`${styles.page} page`}> <section className={`${styles.page} page`}>
<div className={styles["background_wrap"]} />
<Header <Header
classNameTitle={styles["header-title"]} classNameTitle={styles["header-title"]}
isBackButtonVisible={false} isBackButtonVisible={false}

View File

@ -12,11 +12,29 @@
background-repeat: no-repeat; background-repeat: no-repeat;
color: #fff; color: #fff;
padding: 32px 16px; padding: 32px 16px;
padding-bottom: calc(0dvh + 64px);
background-color: #171717; background-color: #171717;
width: 100%; width: 100%;
max-width: 460px; max-width: 460px;
} }
.page > * {
z-index: 1;
}
.background_wrap {
z-index: 0;
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-image: url("/almost-there.webp");
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
.title { .title {
font-size: 28px; font-size: 28px;
line-height: auto; line-height: auto;

View File

@ -55,6 +55,7 @@ function RelationshipZodiacInfoPage() {
return ( return (
<section className={`${styles.page} page`}> <section className={`${styles.page} page`}>
<div className={styles["background_wrap"]} />
<Header <Header
isBackButtonVisible={false} isBackButtonVisible={false}
classNameTitle={styles["header-title"]} classNameTitle={styles["header-title"]}

View File

@ -15,10 +15,28 @@
background-repeat: no-repeat; background-repeat: no-repeat;
color: #fff; color: #fff;
padding-top: 32px; padding-top: 32px;
padding-bottom: calc(0dvh + 64px);
width: 100%; width: 100%;
max-width: 460px; max-width: 460px;
} }
.page > * {
z-index: 1;
}
.background_wrap {
z-index: 0;
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-size: cover;
background-image: url("/single-zodiac-info.webp");
background-position: center;
background-repeat: no-repeat;
}
.image-container { .image-container {
display: grid; display: grid;
align-items: center; align-items: center;

View File

@ -39,12 +39,13 @@ function Satisfied() {
}; };
return ( return (
<section <section className={`${styles.page} page`}>
className={`${styles.page} page`} <div
style={{ className={styles["background_wrap"]}
backgroundImage: `url(/satisfied-${satisfied}.webp)`, style={{
}} backgroundImage: `url(/satisfied-${satisfied}.webp)`,
> }}
/>
<Header <Header
classNameTitle={styles["header-title"]} classNameTitle={styles["header-title"]}
isBackButtonVisible={false} isBackButtonVisible={false}

View File

@ -2,16 +2,11 @@
position: relative; position: relative;
height: fit-content; height: fit-content;
min-height: 100dvh; min-height: 100dvh;
background-position-y: top;
background-position-x: center;
background-repeat: no-repeat;
background-size: contain;
color: #fff; color: #fff;
padding-top: 32px; padding-top: 32px;
background-color: #0F1323; background-color: #0F1323;
width: 100%; width: 100%;
max-width: 460px; max-width: 460px;
background-image: url(/satisfied-yes.webp);
display: grid; display: grid;
justify-content: center; justify-content: center;
justify-items: center; justify-items: center;
@ -19,6 +14,24 @@
padding-bottom: calc(0dvh + 160px); padding-bottom: calc(0dvh + 160px);
} }
.page > * {
z-index: 1;
}
.background_wrap {
z-index: 0;
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-image: url(/satisfied-yes.webp);
background-position-y: top;
background-position-x: center;
background-repeat: no-repeat;
background-size: contain;
}
.title { .title {
font-size: 27px; font-size: 27px;
line-height: 125%; line-height: 125%;

View File

@ -15,7 +15,7 @@ function SingleZodiacInfoPage() {
const birthdate = useSelector(selectors.selectQuestionnaire).birthdate; const birthdate = useSelector(selectors.selectQuestionnaire).birthdate;
const gender = useSelector(selectors.selectQuestionnaire).gender; const gender = useSelector(selectors.selectQuestionnaire).gender;
const zodiac = getZodiacSignByDate(birthdate); const zodiac = getZodiacSignByDate(birthdate);
const zodiacInfo = zodiacSignsInfo[gender as keyof IZodicSignsInfo].find( const zodiacInfo = zodiacSignsInfo[gender as keyof IZodicSignsInfo]?.find(
(sign) => sign.name === zodiac (sign) => sign.name === zodiac
); );
@ -27,6 +27,7 @@ function SingleZodiacInfoPage() {
return ( return (
<section className={`${styles.page} page`}> <section className={`${styles.page} page`}>
<div className={styles["background_wrap"]} />
<div className={styles.substrate} /> <div className={styles.substrate} />
<Header <Header
isBackButtonVisible={false} isBackButtonVisible={false}

View File

@ -9,13 +9,9 @@
flex-direction: column; flex-direction: column;
gap: 40px; gap: 40px;
background-color: #0F1323; background-color: #0F1323;
background-image: url("/single-zodiac-info.webp");
background-position: center;
background-size: cover;
background-repeat: no-repeat;
color: #fff; color: #fff;
padding-top: 32px; padding-top: 32px;
padding-bottom: 32px; padding-bottom: calc(0dvh + 64px);
width: 100%; width: 100%;
max-width: 460px; max-width: 460px;
} }
@ -23,6 +19,19 @@
.page > * { .page > * {
z-index: 1; z-index: 1;
} }
.background_wrap {
z-index: 0;
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-size: cover;
background-image: url("/single-zodiac-info.webp");
background-position: center;
background-repeat: no-repeat;
}
.image { .image {
height: 285px; height: 285px;

View File

@ -12,6 +12,7 @@
background-size: cover; background-size: cover;
color: #fff; color: #fff;
padding-top: 32px; padding-top: 32px;
padding-bottom: calc(0dvh + 64px);
width: 100%; width: 100%;
max-width: 460px; max-width: 460px;
} }

View File

@ -12,6 +12,7 @@
background-size: cover; background-size: cover;
color: #fff; color: #fff;
padding-top: 32px; padding-top: 32px;
padding-bottom: calc(0dvh + 64px);
width: 100%; width: 100%;
max-width: 460px; max-width: 460px;
} }

View File

@ -55,6 +55,7 @@ export interface IStep {
export interface IQuestion { export interface IQuestion {
id: string; id: string;
question: string; question: string;
touchAction?: string;
answers?: IAnswer[]; answers?: IAnswer[];
answersElement?: JSX.Element; answersElement?: JSX.Element;
answerClassName?: string; answerClassName?: string;
@ -106,8 +107,8 @@ export const aboutUsAnswersA: IAnswer[] = [
id: "other", id: "other",
answer: "Other", answer: "Other",
icon: "", icon: "",
} },
] ];
export const aboutUsAnswersB: IAnswer[] = [ export const aboutUsAnswersB: IAnswer[] = [
{ {
id: "forbes", id: "forbes",
@ -128,8 +129,8 @@ export const aboutUsAnswersB: IAnswer[] = [
id: "other", id: "other",
answer: "Other", answer: "Other",
icon: "", icon: "",
} },
] ];
export const aboutUsAnswersNormal: IAnswer[] = [ export const aboutUsAnswersNormal: IAnswer[] = [
{ {
@ -210,12 +211,12 @@ export const aboutUsAnswersNormal: IAnswer[] = [
]; ];
export const aboutUsAnswers: { export const aboutUsAnswers: {
[key: string]: IAnswer[] [key: string]: IAnswer[];
} = { } = {
'aboutUsAnswersA': aboutUsAnswersNormal, aboutUsAnswersA: aboutUsAnswersNormal,
'aboutUsAnswersB': aboutUsAnswersB, aboutUsAnswersB: aboutUsAnswersB,
'aboutUsAnswersNormal': aboutUsAnswersA aboutUsAnswersNormal: aboutUsAnswersA,
} };
const currentlyAffectingAnswers: IAnswer[] = [ const currentlyAffectingAnswers: IAnswer[] = [
{ {

View File

@ -0,0 +1,11 @@
import { useEffect } from "react"
export const useTouchAction = (touchAction = 'pan-y') => {
useEffect(() => {
document.body.style.touchAction = touchAction
return () => {
document.body.style.touchAction = 'pan-y'
}
}, [touchAction])
}

View File

@ -255,4 +255,8 @@ html {
input, textarea { input, textarea {
font-size: 16px !important; font-size: 16px !important;
}
html, body {
touch-action: pan-y;
} }