-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feat/select
- Loading branch information
Showing
31 changed files
with
733 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React, { useState, useEffect } from "react"; | ||
import { ZoomAnimation } from "@/pages/ResultLoading.style"; | ||
|
||
|
||
const EmojiAnimation: React.FC = () => { | ||
const emojis: string[] = ["🐶", "🏃♂️", "🏋️", "🏓", "🎤", "⚽", "🎸"]; | ||
const [currentEmojiIndex, setCurrentEmojiIndex] = useState<number>(0); | ||
|
||
useEffect(function changeEmojiByInterval() { | ||
const emojiInterval = setInterval(() => { | ||
setCurrentEmojiIndex((prevIndex) => (prevIndex + 1) % emojis.length); | ||
}, 1000); | ||
return () => clearInterval(emojiInterval); | ||
}, []); | ||
|
||
return <ZoomAnimation>{emojis[currentEmojiIndex]}</ZoomAnimation>; | ||
}; | ||
|
||
export default EmojiAnimation; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import React, { useState, useEffect, useRef } from "react"; | ||
import Hangul from "hangul-js"; | ||
import { TypingText } from "@/pages/ResultLoading.style"; | ||
|
||
interface TypingAnimationProps { | ||
texts: string[]; | ||
typingInterval: number; | ||
deleteInterval: number; | ||
waitInterval: number; | ||
} | ||
|
||
const TypingAnimation: React.FC<TypingAnimationProps> = ({ | ||
texts, | ||
typingInterval, | ||
deleteInterval, | ||
waitInterval, | ||
}) => { | ||
const [displayedText, setDisplayedText] = useState<string>(""); | ||
const [currentTextIndex, setCurrentTextIndex] = useState<number>(0); | ||
const [isCursorBlinking, setIsCursorBlinking] = useState<boolean>(false); | ||
|
||
const index = useRef<number>(0); | ||
const isDeleting = useRef<boolean>(false); | ||
const typeTimeout = useRef<NodeJS.Timeout | null>(null); | ||
|
||
useEffect(() => { | ||
const disassembled = Hangul.disassemble(texts[currentTextIndex]); | ||
|
||
const handleTyping = () => { | ||
if (!isDeleting.current) { | ||
setIsCursorBlinking(false); | ||
|
||
if (index.current <= disassembled.length) { | ||
const nextText = Hangul.assemble(disassembled.slice(0, index.current)); | ||
setDisplayedText(nextText); | ||
index.current++; | ||
} else { | ||
setIsCursorBlinking(true); | ||
setTimeout(() => { | ||
isDeleting.current = true; | ||
index.current = texts[currentTextIndex].length; | ||
setIsCursorBlinking(false); | ||
handleTyping(); | ||
}, waitInterval); | ||
return; | ||
} | ||
} else { | ||
if (index.current > 0) { | ||
setDisplayedText((prevText) => prevText.slice(0, index.current - 1)); | ||
index.current--; | ||
} else { | ||
setCurrentTextIndex((prevIndex) => (prevIndex + 1) % texts.length); | ||
isDeleting.current = false; | ||
setDisplayedText(""); | ||
if (typeTimeout.current) clearTimeout(typeTimeout.current); | ||
setIsCursorBlinking(true); | ||
return; | ||
} | ||
} | ||
|
||
typeTimeout.current = setTimeout( | ||
handleTyping, | ||
isDeleting.current ? deleteInterval : typingInterval | ||
); | ||
}; | ||
|
||
typeTimeout.current = setTimeout(handleTyping, typingInterval); | ||
|
||
return () => { | ||
if (typeTimeout.current) clearTimeout(typeTimeout.current); | ||
}; | ||
}, [currentTextIndex]); | ||
|
||
return ( | ||
<TypingText isCursorBlinking={isCursorBlinking}> | ||
<h1 css={{ fontFamily: "NanumSquareNeo", fontSize: "25px", fontWeight: 100 }}> | ||
{displayedText} | ||
</h1> | ||
</TypingText> | ||
); | ||
}; | ||
|
||
export default TypingAnimation; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { InputProps } from "./Input"; | ||
import styled from "@emotion/styled"; | ||
|
||
export const InputElement = styled.input<InputProps>` | ||
width: ${(props) => props.width}; | ||
height: ${(props) => props.height}; | ||
border-radius: 12px; | ||
border: none; | ||
padding:5px; | ||
background-color: ${(props) => { | ||
switch (props.variants) { | ||
case "primary": | ||
return "#ECECEC"; | ||
case "secondary": | ||
return "#fff"; | ||
} | ||
}}; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { forwardRef } from "react"; | ||
|
||
import { InputElement } from "./Input.style"; | ||
|
||
export interface InputProps extends React.ComponentPropsWithoutRef<"input"> { | ||
variants: "primary" | "secondary"; | ||
width: string; | ||
height: string; | ||
} | ||
|
||
export const Input = forwardRef<HTMLInputElement, InputProps>( | ||
({ width, height, variants, ...rest }, ref) => { | ||
return ( | ||
<InputElement ref={ref} width={width} height={height} variants={variants} {...rest} /> | ||
); | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import styled from "@emotion/styled"; | ||
|
||
export const TopBarWrapper = styled.div` | ||
height: 60px; | ||
`; | ||
|
||
export const TopBarContainer = styled.div` | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
display: flex; | ||
height: 56px; | ||
justify-content: center; | ||
align-items: center; | ||
border-bottom: 1px solid #e0e0e0; | ||
font-weight: 800; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { TopBarContainer, TopBarWrapper } from "./TopBar.styled"; | ||
|
||
interface TopBarProps { | ||
title: string; | ||
} | ||
|
||
const TopBar: React.FC<TopBarProps> = ({ title }) => { | ||
return ( | ||
<TopBarWrapper> | ||
<TopBarContainer>{title}</TopBarContainer> | ||
</TopBarWrapper> | ||
); | ||
}; | ||
|
||
export default TopBar; |
Oops, something went wrong.