Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit 8aacd7a

Browse files
committed
音量の確認画面を追加する
1 parent 6e409cd commit 8aacd7a

File tree

1 file changed

+65
-36
lines changed

1 file changed

+65
-36
lines changed

src/components/Exhibition/TitleScreen.tsx

Lines changed: 65 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,19 @@ const terms = css`
3838
margin-top: ${Spacing.s}px;
3939
`;
4040

41+
const warning = css`
42+
${Typography.XS};
43+
color: ${Colors.white};
44+
margin-top: ${Spacing.s}px;
45+
`;
46+
4147
// Components
4248

4349
export const ExhibitionTitleScreen = dynamic(() =>
4450
Promise.resolve(({ onReady }: { onReady: () => void }) => {
4551
const { orientation } = useScreenOrientation();
4652
const [agreed, setAgreed] = useState(false);
53+
const [agreedFadeOut, setAgreedFadeOut] = useState(false);
4754
const [ready, setReady] = useState(false);
4855

4956
// Side Effects
@@ -56,10 +63,6 @@ export const ExhibitionTitleScreen = dynamic(() =>
5663
}
5764
}, [onReady, ready]);
5865

59-
useEffect(() => {
60-
setAgreed(!!localStorage.getItem("metaneno.art-agreed_to_terms"));
61-
}, []);
62-
6366
// Events
6467

6568
const handleClickAgreeToTermsButton = useCallback(() => {
@@ -70,9 +73,15 @@ export const ExhibitionTitleScreen = dynamic(() =>
7073
);
7174
}
7275

73-
setReady(true);
76+
setAgreedFadeOut(true);
77+
78+
setTimeout(() => {
79+
setAgreed(true);
80+
}, Mixin.ANIMATION_DURATION.milliseconds);
7481
}, []);
7582

83+
const handleReady = useCallback(() => setReady(true), []);
84+
7685
// Render
7786

7887
return (
@@ -93,43 +102,63 @@ export const ExhibitionTitleScreen = dynamic(() =>
93102
)}
94103
css={container}
95104
>
96-
<div
97-
className="w-full"
98-
css={css`
99-
${contents};
100-
${ready ? fadeOut : fadeIn}
101-
`}
102-
>
103-
<img
104-
alt="ロゴ"
105-
src="/lp/logo.svg"
106-
style={isMobile ? { maxHeight: "192px" } : {}}
107-
/>
105+
{!agreed && (
108106
<div
109-
className="cursor-pointer"
110-
css={button}
111-
onClick={handleClickAgreeToTermsButton}
112-
style={
113-
isMobile
114-
? { maxHeight: "36px", marginTop: `${Spacing.s}px` }
115-
: {}
116-
}
107+
className="w-full"
108+
css={css`
109+
${contents};
110+
${agreedFadeOut ? fadeOut : fadeIn}
111+
`}
117112
>
118113
<img
119-
alt="はじめる"
120-
className="mx-auto"
121-
src="/lp/main-content-link/button.svg"
114+
alt="ロゴ"
115+
src="/lp/logo.svg"
116+
style={isMobile ? { maxHeight: "192px" } : {}}
122117
/>
118+
<div
119+
className="cursor-pointer"
120+
css={button}
121+
onClick={handleClickAgreeToTermsButton}
122+
style={
123+
isMobile
124+
? { maxHeight: "36px", marginTop: `${Spacing.s}px` }
125+
: {}
126+
}
127+
>
128+
<img
129+
alt="はじめる"
130+
className="mx-auto"
131+
src="/lp/main-content-link/button.svg"
132+
/>
133+
</div>
134+
<div className="text-center" css={terms}>
135+
<a className="underline" href="/terms" target="_blank">
136+
利用規約
137+
</a>
138+
をご確認の上、{isMobile ? <br /> : ""}
139+
ご同意頂ける場合にのみ「Trip」ボタンを
140+
{isMobile ? "タップ" : "クリック"}してください
141+
</div>
123142
</div>
124-
<div className="text-center" css={terms}>
125-
<a className="underline" href="/terms" target="_blank">
126-
利用規約
127-
</a>
128-
をご確認の上、{isMobile ? <br /> : ""}
129-
ご同意頂ける場合にのみ「Trip」ボタンを
130-
{isMobile ? "タップ" : "クリック"}してください
143+
)}
144+
{agreed && (
145+
<div
146+
className="grid w-full h-full text-center cursor-pointer place-items-center"
147+
onClick={handleReady}
148+
>
149+
<div
150+
css={css`
151+
${warning};
152+
${ready ? fadeOut : fadeIn}
153+
`}
154+
>
155+
ここから先、音声が再生されます。
156+
<br />
157+
音量を調整の上{isMobile ? "タップ" : "クリック"}
158+
してお進みください。
159+
</div>
131160
</div>
132-
</div>
161+
)}
133162
</div>
134163
</>
135164
);

0 commit comments

Comments
 (0)