generated from Jonghakseo/chrome-extension-boilerplate-react-vite
-
-
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.
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
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,65 @@ | ||
import { useStorage } from '@extension/shared'; | ||
import { themeStorage } from '@extension/storage'; | ||
import ThemeSwitcher from './components/ThemeSwitcher'; | ||
|
||
interface TimerProps { | ||
onBack: () => void; | ||
} | ||
|
||
const Timer = ({ onBack }: TimerProps) => { | ||
const theme = useStorage(themeStorage); | ||
const isLight = theme === 'light'; | ||
|
||
return ( | ||
<div className={`App size-full overflow-hidden p-2 transition-colors ${ | ||
isLight ? 'bg-[#CDE8F6]' : 'bg-[#364E68]' | ||
}`}> | ||
<ThemeSwitcher /> | ||
|
||
{/* Box Wrapper */} | ||
<div className={`mx-8 my-9 rounded-xl p-4 shadow-lg shadow-black/20 ${ | ||
isLight ? 'bg-[#F8FAFC]' : 'bg-[#27374D]' | ||
}`}> | ||
<div className="flex flex-col items-center justify-between"> | ||
<h1 className={`text-4xl font-bold italic ${ | ||
isLight ? 'text-gray-900' : 'text-white' | ||
}`}> | ||
Focus Time | ||
</h1> | ||
|
||
{/* Timer Circle */} | ||
<div className="my-9 relative flex size-64 items-center justify-center"> | ||
<div className="absolute size-full rounded-full border-8 border-[#91C8E4] opacity-30" /> | ||
<div className="text-7xl font-bold"> | ||
00:00 | ||
</div> | ||
</div> | ||
|
||
{/* Lotus Icons */} | ||
<div className="flex gap-2"> | ||
{'🪷'.repeat(6).split('').map((lotus, index) => ( | ||
<span key={index} role="img" aria-label="lotus" className="text-3xl"> | ||
{lotus} | ||
</span> | ||
))} | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{/* Back Button - Outside the white box */} | ||
<div className="mt-4 flex justify-center"> | ||
<button | ||
onClick={onBack} | ||
className={`rounded-full px-8 py-2 text-xl font-bold shadow-lg shadow-black/20 transition-colors ${ | ||
isLight | ||
? 'bg-[#39A2DB] hover:bg-[#769FCD] text-[#1E1E1E]' | ||
: 'bg-[#91C8E4] hover:bg-[#B9D7EA] text-[#F8FAFC]' | ||
}`}> | ||
Back | ||
</button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Timer; |