Skip to content

Commit 9925abc

Browse files
committed
✨ Update HomePage layout and functionality with profile image and improved time formatting
1 parent 17c28f7 commit 9925abc

3 files changed

Lines changed: 37 additions & 22 deletions

File tree

app/page.tsx

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default function HomePage() {
5353

5454
const formatTime = (date: Date) => {
5555
return date.toLocaleTimeString('en-US', {
56-
hour: 'numeric',
56+
hour: '2-digit',
5757
minute: '2-digit',
5858
hour12: true
5959
});
@@ -79,44 +79,45 @@ export default function HomePage() {
7979

8080

8181
return (
82-
<main className="min-h-screen font-sans relative bg-amber-50 text-center">
82+
<main className="min-h-screen font-sans relative bg-linear-to-b from-amber-50 to-amber-200 text-center">
8383
<div className="flex flex-col gap-3 items-center justify-center min-h-screen">
8484

85-
<div className="flex justify-center max-sm:mt-5 flex-col">
86-
<p className="leading-4 text-sm mb-2">Welcome back,</p>
85+
<div className="flex justify-center max-sm:mt-5 flex-col mb-5">
86+
<p className="leading-4 text-sm mb-2">Welcome back</p>
8787
<time dateTime="" className="max-sm:text-3xl text-6xl font-bold"> {formatTime(currentTime)}</time>
88-
<p className="max-sm:text-lg text-foreground/70 text-2xl font-medium mt-1">{formatDate(currentTime)}</p>
88+
<p className="max-sm:text-lg text-foreground/70 text-2xl mt-1">{formatDate(currentTime)}</p>
8989
</div>
9090

91-
92-
<div className="flex w-full p-5 flex-col max-sm:mt-2 mt-5 justify-center gap-5">
91+
<div className="flex w-full px-5 flex-col max-sm:mt-2 mt-6 justify-center gap-3">
9392
<div className="max-sm:size-20 relative size-32 bg-gray-100 rounded-full mx-auto mb-4 flex items-center justify-center ring-2 ring-amber-200 ring-offset-4">
9493
<WindowsIcon className="max-sm:size-10 size-12" />
95-
96-
<Image src="/cambodia-flag-icon-128.png" alt="Avatar" width={120} height={120} className="absolute ring-2 bottom-1 -right-2 ring-amber-200 rounded w-9 hover:scale-110 transition-all duration-300 h-auto object-cover" />
97-
94+
<Image src="/profile.png" alt="Avatar" width={400} height={400} className="w-full h-full p-2 rounded-2xl" />
95+
<Image src="/cambodia-flag-icon-128.png" alt="Avatar" width={120} height={120} className="absolute ring-2 bottom-1 -right-2 ring-amber-200 rounded w-9 hover:scale-110 transition-all duration-300 h-6 object-cover" />
9896
</div>
99-
<div className="max-sm:flex-col max-sm:mt-5 mt-7 items-center flex-col flex mx-auto justify-center gap-0">
97+
<div className="max-sm:flex-col max-sm:mt-5 mt-9 items-center flex-col flex mx-auto justify-center gap-0">
10098
<h1 className="font-bold font-sans text-xl">Sophat LEAT</h1>
10199
</div>
102100

103-
<div className="flex w-full max-w-xs mx-auto justify-center max-sm:gap-1 gap-2">
104-
<input type="password" className="text-base leading-5 w-full font-normal px-3 py-1.5 rounded-xl rounded-r-sm border" placeholder="PIN" value={pin} onChange={(e) => setPin(e.target.value)} />
105-
<button type="submit" disabled={loggingIn} onClick={loginHandler} className="text-base shrink-0 bg-amber-100 disabled:opacity-50 cursor-pointer text-amber-900 leading-5 font-medium px-3 py-1.5 rounded-xl rounded-l-sm border">
101+
<div className="flex w-full max-w-60 mx-auto justify-center max-sm:gap-1 gap-2 shadow-2xl">
102+
<input type="password" className="text-base leading-5 font-black tracking-[3px] bg-background w-full px-3 py-1.5 rounded-lg rounded-r-sm outline-0 ring-2 ring-background/50 focus-within:ring-amber-400" placeholder="PIN" value={pin} onChange={(e) => setPin(e.target.value)} />
103+
<button type="submit" disabled={loggingIn} onClick={loginHandler} className="text-base transition-all duration-300 shrink-0 bg-amber-600 disabled:opacity-50 cursor-pointer text-white leading-5 font-medium px-3 py-1.5 rounded-lg rounded-l-sm ring-2 ring-amber-300 focus-within:ring-amber-400">
106104
{
107105
loggingIn
108-
? <span className="flex gap-1 items-center"><LoaderIcon className="size-4 animate-spin" /> {'Sign In'} </span> : 'Sign In'
106+
? <span className="flex gap-1 items-center transition-all duration-300">
107+
<LoaderIcon className="size-4 animate-spin" />
108+
{'Sign In'}
109+
</span> : 'Sign In'
109110
}
110111
</button>
111112
</div>
112113
</div>
113114

114115

115116
<footer className="pb-5 mt-10 w-full px-4 mb-5">
116-
<ul className="flex w-full max-w-3xl overflow-x-auto mx-auto justify-center py-1.5 gap-5">
117+
<ul className="flex w-full max-w-3xl overflow-x-auto mx-auto justify-center py-1.5 gap-8">
117118
{menuItems.map((item) => (
118119
<li key={item.name} className="flex items-center gap-0.5 justify-center">
119-
<a href={item.href} className="relative flex flex-col items-center justify-center size-9 rounded-lg hover:bg-white hover:shadow-lg duration-400 shadow-black/10 transition-colors">
120+
<a href={item.href} className="relative flex flex-col items-center justify-center size-9 rounded-lg hover:bg-white hover:shadow-lg duration-200 shadow-black/10 transition-colors">
120121
<item.icon className={item.className} />
121122
</a>
122123
<span className="max-sm:text-xs whitespace-nowrap mt-0.5">{item.name}</span>

public/profile.png

473 KB
Loading

tsconfig.json

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
22
"compilerOptions": {
33
"target": "ES2017",
4-
"lib": ["dom", "dom.iterable", "esnext"],
4+
"lib": [
5+
"dom",
6+
"dom.iterable",
7+
"esnext"
8+
],
59
"allowJs": true,
610
"skipLibCheck": true,
711
"strict": true,
@@ -19,9 +23,19 @@
1923
}
2024
],
2125
"paths": {
22-
"@/*": ["./*"]
26+
"@/*": [
27+
"./*"
28+
]
2329
}
2430
},
25-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
26-
"exclude": ["node_modules"]
27-
}
31+
"include": [
32+
"next-env.d.ts",
33+
"**/*.ts",
34+
"**/*.tsx",
35+
".next/types/**/*.ts",
36+
".next/dev/types/**/*.ts"
37+
],
38+
"exclude": [
39+
"node_modules"
40+
]
41+
}

0 commit comments

Comments
 (0)