Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 61 additions & 25 deletions apps/web/app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function Dashboard() {
const { data } = trpc.user.getCurrent.useQuery();

const goToMap = () => router.push("/");
const goToAdmin = () => router.push("/admin");
const goToAdmin = () => router.push("/admin");

const handleSignOut = async () => {
await signOut();
Expand All @@ -18,15 +18,22 @@ export default function Dashboard() {

return (
<main className="dashboard-container">

<div className="glow-orb"></div>

<div className="dashboard-card">

{/* HEADER SECTION */}
<div className="header-section">
<div className="status-icon">
<svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="var(--neon-green, #00FF99)" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
<svg
width="28"
height="28"
viewBox="0 0 24 24"
fill="none"
stroke="var(--neon-green, #00FF99)"
strokeWidth="2.5"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
<polyline points="22 4 12 14.01 9 11.01"></polyline>
</svg>
Expand All @@ -39,32 +46,61 @@ export default function Dashboard() {
</div>

{/* ACTIONS PORTAL */}
<div className="action-grid">
{/* Primary Action: Go to Map */}
<button className="action-btn primary-btn" onClick={goToMap}>
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<polygon points="3 11 22 2 13 21 11 13 3 11"></polygon>
</svg>
GO TO MAP
</button>

{/* Secondary Action: Admin */}
<button className="action-btn secondary-btn" onClick={goToAdmin}>
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect>
<path d="M7 11V7a5 5 0 0 1 10 0v4"></path>
</svg>
ADMIN OVERRIDE
</button>
</div>
<div className="action-grid">
{/* Primary Action: Go to Map */}
<button
type="button"
className="action-btn primary-btn"
onClick={goToMap}
>
<svg
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<polygon points="3 11 22 2 13 21 11 13 3 11"></polygon>
</svg>
GO TO MAP
</button>

{/* Secondary Action: Admin */}
<button
type="button"
className="action-btn secondary-btn"
onClick={goToAdmin}
>
<svg
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect>
<path d="M7 11V7a5 5 0 0 1 10 0v4"></path>
</svg>
ADMIN OVERRIDE
</button>
</div>

{/* FOOTER & SIGN OUT */}
<div className="footer-section">
<button type="button" onClick={handleSignOut} className="sign-out-btn">
<button
type="button"
onClick={handleSignOut}
className="sign-out-btn"
>
[ SIGN OUT ]
</button>
</div>

</div>

<style jsx>{`
Expand Down Expand Up @@ -232,4 +268,4 @@ export default function Dashboard() {
`}</style>
</main>
);
}
}
192 changes: 143 additions & 49 deletions apps/web/app/sign-in/page.tsx
Original file line number Diff line number Diff line change
@@ -1,51 +1,103 @@
'use client'
"use client";

import { authClient } from '@/lib/auth-client'
import { authClient } from "@/lib/auth-client";
import { useRouter } from "next/navigation";

export default function SignIn() {
const handleLogin = async () => {
await authClient.signIn.social({ provider: 'google', callbackURL: '/dashboard' })
}

return (
<main className="sign-in-container">

{/* BACKGROUND GLOW */}
<div className="glow-orb"></div>

{/* LOGIN CARD */}
<div className="login-card">

{/* HEADER SECTION */}
<div className="header-section">
<div className="shield-icon">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="var(--neon-blue, #00E5FF)" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<polygon points="12 3 21 12 12 21 3 12" />
</svg>
</div>

<h1 className="login-title">UP WayPoint</h1>
</div>

{/* AUTH BUTTON */}
<button className="auth-btn" onClick={handleLogin}>
<svg className="google-icon" viewBox="0 0 24 24">
<path d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z" fill="#4285F4" />
<path d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z" fill="#34A853" />
<path d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z" fill="#FBBC05" />
<path d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z" fill="#EA4335" />
</svg>
Continue with Google
</button>

{/* FOOTER */}
<div className="footer-text">
<a href="https://github.com/ptrn23/UPWayPoint"> Source code available here </a> <br />
v1.2.0
</div>
</div>

<style jsx>{`
const handleLogin = async () => {
await authClient.signIn.social({
provider: "google",
callbackURL: "/dashboard",
});
};

const router = useRouter();

const goToMap = () => router.push("/");

return (
<main className="sign-in-container">
{/* BACKGROUND GLOW */}
<div className="glow-orb"></div>

{/* LOGIN CARD */}
<div className="login-card">
{/* HEADER SECTION */}
<div className="header-section">
<div className="shield-icon">
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="var(--neon-blue, #00E5FF)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<polygon points="12 3 21 12 12 21 3 12" />
</svg>
</div>

<h1 className="login-title">UP WayPoint</h1>
</div>
<div className="action-grid">
{/* Primary Action: Go to Map */}
<button
type="button"
className="action-btn primary-btn"
onClick={goToMap}
>
<svg
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<polygon points="3 11 22 2 13 21 11 13 3 11"></polygon>
</svg>
GO TO MAP
</button>

{/* AUTH BUTTON */}
<button type="button" className="auth-btn" onClick={handleLogin}>
<svg className="google-icon" viewBox="0 0 24 24">
<path
d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
fill="#4285F4"
/>
<path
d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
fill="#34A853"
/>
<path
d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"
fill="#FBBC05"
/>
<path
d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
fill="#EA4335"
/>
</svg>
Continue with Google
</button>
</div>
{/* FOOTER */}
<div className="footer-text">
<a href="https://github.com/ptrn23/UPWayPoint">
{" "}
Source code available here{" "}
</a>{" "}
<br />
v1.2.0
</div>
</div>

<style jsx>{`
.sign-in-container {
position: relative;
display: flex;
Expand Down Expand Up @@ -119,6 +171,49 @@ export default function SignIn() {
margin: 0;
}

/* PRIMARY BUTTON (Go to Map) */
.primary-btn {
background: rgba(0, 229, 255, 0.05);
border: 1px solid var(--neon-blue, #00E5FF);
color: var(--neon-blue, #00E5FF);
box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.1);
}

.primary-btn:hover {
background: rgba(0, 229, 255, 0.15);
box-shadow: 0 0 20px rgba(0, 229, 255, 0.3), inset 0 0 15px rgba(0, 229, 255, 0.2);
text-shadow: 0 0 8px rgba(0, 229, 255, 0.8);
color: #fff;
}

.action-btn {
position: relative;
display: flex;
width: 100%;
align-items: center;
justify-content: center;
gap: 12px;
border-radius: 12px;
padding: 14px 24px;
font-family: var(--font-chakra), sans-serif;
font-size: 14px;
font-weight: 600;
letter-spacing: 0.05em;
cursor: pointer;
transition: all 0.2s ease;
}

.action-btn:active {
transform: scale(0.98);
}
/* ACTIONS */
.action-grid {
display: flex;
flex-direction: column;
gap: 16px;
width: 100%;
}

.auth-btn {
position: relative;
display: flex;
Expand Down Expand Up @@ -177,7 +272,6 @@ export default function SignIn() {
}
}
`}</style>

</main>
)
}
</main>
);
}
Loading
Loading