Skip to content

Commit

Permalink
[feat] 하루 1개 제한
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyun0828 committed Dec 5, 2024
1 parent 4d281b5 commit a7b8b11
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 117 deletions.
46 changes: 21 additions & 25 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

153 changes: 61 additions & 92 deletions src/pages/Main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Main = () => {
const searchParams = new URLSearchParams(location.search);
const selfFeedback = searchParams.get("selfFeedback");
const feedback = selfFeedback === "null" ? null : selfFeedback; // "null" 문자열을 null로 변환
// const isCompleteSpeech = searchParams.get("isCompleteSpeech") === "true";
const isCompleteSpeech = searchParams.get("isCompleteSpeech") === "true";
const [level, setLevel] = useState(1);
const [canStop, setCanStop] = useState(true);
const [isPopupOpen, setIsPopupOpen] = useState(false); // 시작 전 셀프 피드백 팝업 상태 관리
Expand Down Expand Up @@ -104,33 +104,33 @@ const Main = () => {
)}
<Header/>
<main className="flex flex-col items-center justify-center flex-grow px-4">
{/*/!* "오늘의 질문" 버튼 또는 완료 메시지 버튼 *!/*/}
{/*{isCompleteSpeech ? (*/}
{/* <button*/}
{/* className="px-6 py-4 mt-6 text-lg text-white bg-gray-400 rounded font-paperlogy-title"*/}
{/* disabled*/}
{/* >*/}
{/* 1분 스피치를 이미 완료했습니다*/}
{/* </button>*/}
{/*) : (*/}
{/* <>*/}
{/* /!* 진행 안내문 *!/*/}
{/* <p className="mt-8 text-base font-paperlogy-title text-grayscale-90">*/}
{/* 아래 버튼 클릭 후 10초 뒤 스피치가 시작됩니다!*/}
{/* </p>*/}
{/* <p className="mt-4 text-base font-paperlogy-title text-grayscale-90">*/}
{/* {getLevelMessage()}*/}
{/* </p>*/}
{/* <button*/}
{/* onClick={handleQuestionClick}*/}
{/* className="relative px-6 py-4 mt-6 text-lg text-white transition-all duration-300 shadow-md rounded-2xl bg-primary-40 font-paperlogy-title hover:scale-110 hover:shadow-lg hover:bg-primary-50 focus:outline-none focus:ring-4 focus:ring-primary-50 active:scale-95"*/}
{/* >*/}
{/* 오늘의 질문*/}
{/* <div*/}
{/* className="absolute inset-x-0 bottom-0 h-3 transition-opacity duration-300 rounded-full opacity-0 bg-gradient-to-r from-blue-200 via-blue-300 to-blue-400 blur-md hover:opacity-100"></div>*/}
{/* </button>*/}
{/* </>*/}
{/*)}*/}
{/* "오늘의 질문" 버튼 또는 완료 메시지 버튼 */}
{isCompleteSpeech ? (
<button
className="px-6 py-4 mt-6 text-lg text-white bg-gray-400 rounded font-paperlogy-title"
disabled
>
1분 스피치를 이미 완료했습니다
</button>
) : (
<>
{/* 진행 안내문 */}
<p className="mt-8 text-base font-paperlogy-title text-grayscale-90">
아래 버튼 클릭 후 10초 뒤 스피치가 시작됩니다!
</p>
<p className="mt-4 text-base font-paperlogy-title text-grayscale-90">
{getLevelMessage()}
</p>
<button
onClick={handleQuestionClick}
className="relative px-6 py-4 mt-6 text-lg text-white transition-all duration-300 shadow-md rounded-2xl bg-primary-40 font-paperlogy-title hover:scale-110 hover:shadow-lg hover:bg-primary-50 focus:outline-none focus:ring-4 focus:ring-primary-50 active:scale-95"
>
오늘의 질문
<div
className="absolute inset-x-0 bottom-0 h-3 transition-opacity duration-300 rounded-full opacity-0 bg-gradient-to-r from-blue-200 via-blue-300 to-blue-400 blur-md hover:opacity-100"></div>
</button>
</>
)}

<>
<p className="mt-4 text-base font-paperlogy-title text-grayscale-90">
Expand All @@ -155,70 +155,39 @@ const Main = () => {
style={{width: "100%", height: "auto"}}
/>
</div>
{/*{!isCompleteSpeech && (*/}
{/* <>*/}
{/* <p className="mt-8 text-base font-paperlogy-title text-grayscale-90">*/}
{/* 오늘 진행할 스피치의 난이도를 선택하세요!*/}
{/* </p>*/}
{/* <div className="flex space-x-4 mt-6">*/}
{/* <button*/}
{/* onClick={() => setLevel(1)}*/}
{/* className={buttonStyle(1)}*/}
{/* >*/}
{/* 1*/}
{/* </button>*/}
{/* <button*/}
{/* onClick={() => setLevel(2)}*/}
{/* className={buttonStyle(2)}*/}
{/* >*/}
{/* 2*/}
{/* </button>*/}
{/* <button*/}
{/* onClick={() => setLevel(3)}*/}
{/* className={buttonStyle(3)}*/}
{/* >*/}
{/* 3*/}
{/* </button>*/}
{/* <button*/}
{/* onClick={() => setCanStop(!canStop)}*/}
{/* className={`px-4 py-2 text-white rounded-md ${canStop ? 'bg-green-500' : 'bg-red-500'} hover:bg-opacity-80`}*/}
{/* >*/}
{/* {canStop ? 'On' : 'Off'}*/}
{/* </button>*/}
{/* </div>*/}
{/* </>*/}
{/*)}*/}
<>
<p className="mt-8 text-base font-paperlogy-title text-grayscale-90">
오늘 진행할 스피치의 난이도를 선택하세요!
</p>
<div className="flex space-x-4 mt-6">
<button
onClick={() => setLevel(1)}
className={buttonStyle(1)}
>
1
</button>
<button
onClick={() => setLevel(2)}
className={buttonStyle(2)}
>
2
</button>
<button
onClick={() => setLevel(3)}
className={buttonStyle(3)}
>
3
</button>
<button
onClick={() => setCanStop(!canStop)}
className={`px-4 py-2 text-white rounded-md ${canStop ? 'bg-green-500' : 'bg-red-500'} hover:bg-opacity-80`}
>
{canStop ? 'On' : 'Off'}
</button>
</div>
</>
{!isCompleteSpeech && (
<>
<p className="mt-8 text-base font-paperlogy-title text-grayscale-90">
오늘 진행할 스피치의 난이도를 선택하세요!
</p>
<div className="flex space-x-4 mt-6">
<button
onClick={() => setLevel(1)}
className={buttonStyle(1)}
>
1
</button>
<button
onClick={() => setLevel(2)}
className={buttonStyle(2)}
>
2
</button>
<button
onClick={() => setLevel(3)}
className={buttonStyle(3)}
>
3
</button>
<button
onClick={() => setCanStop(!canStop)}
className={`px-4 py-2 text-white rounded-md ${canStop ? 'bg-green-500' : 'bg-red-500'} hover:bg-opacity-80`}
>
{canStop ? 'On' : 'Off'}
</button>
</div>
</>
)}
</main>
<NavBar/>
{/* 시작 전 셀프 피드백을 보여주는 팝업 */}
Expand Down

0 comments on commit a7b8b11

Please sign in to comment.