diff --git a/src/components/LeftRight/HorizontalLine.tsx b/src/components/LeftRight/HorizontalLine.tsx index 1e67e63..f86ef09 100644 --- a/src/components/LeftRight/HorizontalLine.tsx +++ b/src/components/LeftRight/HorizontalLine.tsx @@ -13,13 +13,8 @@ const HorizontalLine = () => { }; const getStopColor = () => { - if (top === 70) return Primary[200]; - if (top === 72) return Primary[300]; - if (top === 74) return Primary[400]; - if (top === 76) return Primary[500]; - if (top === 78) return Primary[600]; - if (top === 80) return Primary[700]; - return Primary[800]; + if (top >= 70 && top < 75) return `rgb(${(255*(75-top)+72*(top-70))/5}, ${(255*(75-top)+202*(top-70))/5}, ${(255*(75-top)+228*(top-70))/5})`; + if (top >= 75 && top <= 80) return `rgb(${(72*(80-top)+3*(top-75))/5}, ${(202*(80-top)+4*(top-75))/5}, ${(228*(80-top)+82*(top-75))/5})`; }; return ( diff --git a/src/hooks/useLeftRightTimer.ts b/src/hooks/useLeftRightTimer.ts index 2feea87..936f493 100644 --- a/src/hooks/useLeftRightTimer.ts +++ b/src/hooks/useLeftRightTimer.ts @@ -45,20 +45,7 @@ const useTimer = ({ ms = 1000, initialTime = 100 }: useTimerProps) => { clearInterval(timerInterval.current); setGameStatus("end"); } - - if (time >= 100) { - setTop(70); - } else if (time >= 80) { - setTop(72); - } else if (time >= 60) { - setTop(74); - } else if (time >= 40) { - setTop(76); - } else if (time >= 20) { - setTop(78); - } else if (time >= 0) { - setTop(80); - } + setTop(80-(time/10)); if (time > 100) resetTime(); }, [resetTime, setGameStatus, setTop, time, timerInterval]); diff --git a/src/pages/game/index.tsx b/src/pages/game/index.tsx index 47aa2d6..59f27dd 100644 --- a/src/pages/game/index.tsx +++ b/src/pages/game/index.tsx @@ -33,17 +33,17 @@ const GameListPage = () => { /> - + left & right - + 1 to 50 - + hangman