Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

fix theme buttn on mobile (#898)

PickleNikb53af050f1bd
diff --git a/apps/web/src/app/[locale]/claim/claim-form.tsx b/apps/web/src/app/[locale]/claim/claim-form.tsx
index 2086b6df..6ba280df 100644
--- a/apps/web/src/app/[locale]/claim/claim-form.tsx
+++ b/apps/web/src/app/[locale]/claim/claim-form.tsx
@@ -34,7 +34,7 @@ export function ClaimForm() {
}
return (
<Form {...form}>
- <form onSubmit={form.handleSubmit(onSubmit)} className="mx-auto flex gap-5">
+ <form onSubmit={form.handleSubmit(onSubmit)} className="mx-auto flex gap-3">
<FormField
control={form.control}
name="code"
@@ -43,7 +43,7 @@ export function ClaimForm() {
<FormControl>
<Input
maxLength={10}
- className="rounded-xl bg-neutral-200 dark:bg-neutral-800"
+ className="h-10 rounded-xl border border-neutral-400 bg-neutral-200 dark:border-neutral-700 dark:bg-neutral-800"
placeholder="Enter Early Access token"
{...field}
/>
@@ -53,7 +53,9 @@ export function ClaimForm() {
)}
/>
- <Button type="submit">Submit</Button>
+ <Button className="h-10 rounded-xl" type="submit">
+ Submit
+ </Button>
</form>
</Form>
);
diff --git a/apps/web/src/app/[locale]/claim/page.tsx b/apps/web/src/app/[locale]/claim/page.tsx
index d2695493..8638a517 100644
--- a/apps/web/src/app/[locale]/claim/page.tsx
+++ b/apps/web/src/app/[locale]/claim/page.tsx
@@ -1,21 +1,29 @@
import { getServerAuthSession } from '@repo/auth/server';
import { LoginButton } from '../login/_components/LoginButton';
import { ClaimForm } from './claim-form';
+import Image from 'next/image';
export default async function Claim() {
const session = await getServerAuthSession();
const header = session ? 'In early access?' : 'Login to claim your token';
const subheader = session ? 'Enter the token that was emailed to you' : '';
return (
- <div className="container flex h-full flex-col items-center justify-center">
+ <div className="container -mt-[56px] flex h-screen flex-col items-center justify-center">
<div className="mx-auto flex w-full flex-col justify-center space-y-6 text-center sm:w-[550px]">
- <div className="flex flex-col space-y-2 text-center">
+ <Image
+ className="animate-amogup -z-10 mx-auto -mb-48"
+ alt="Early Access"
+ src="/Red.webp"
+ height="198"
+ width="150"
+ />
+ <div className="from-background flex flex-col space-y-3 bg-gradient-to-t from-[42%] to-transparent pt-24 text-center">
<h1 className="text-4xl font-bold tracking-tight text-neutral-900 dark:text-white">
{header}
</h1>
<p>{subheader}</p>
+ {session ? <ClaimForm /> : <LoginButton redirectTo="/claim" />}
</div>
- {session ? <ClaimForm /> : <LoginButton redirectTo="/claim" />}
</div>
</div>
);
diff --git a/apps/web/src/app/[locale]/login/_components/LoginButton.tsx b/apps/web/src/app/[locale]/login/_components/LoginButton.tsx
index a452e49b..c07468d3 100644
--- a/apps/web/src/app/[locale]/login/_components/LoginButton.tsx
+++ b/apps/web/src/app/[locale]/login/_components/LoginButton.tsx
@@ -19,8 +19,24 @@ export function LoginButton({ redirectTo }: { redirectTo: string }) {
};
return (
- <Button disabled={state === 'pending'} variant="outline" onClick={handleSignIn}>
- GitHub
- </Button>
+ <div className="mx-auto rounded-md duration-300 hover:shadow-[0_0_2rem_-0.5rem_#3178c6]">
+ <Button
+ variant="outline"
+ onClick={handleSignIn}
+ disabled={state === 'pending'}
+ className="fancy-border-gradient hover:bg-background relative mx-auto flex gap-4 border-none"
+ >
+ Login with GitHub{' '}
+ <svg
+ role="img"
+ viewBox="0 0 24 24"
+ className="h-4 w-4 fill-current"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <title>GitHub</title>
+ <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
+ </svg>
+ </Button>
+ </div>
);
}
diff --git a/apps/web/src/app/[locale]/login/page.tsx b/apps/web/src/app/[locale]/login/page.tsx
index 53e1d3b2..a3b1718d 100644
--- a/apps/web/src/app/[locale]/login/page.tsx
+++ b/apps/web/src/app/[locale]/login/page.tsx
@@ -5,7 +5,7 @@ import { LoginButton } from './_components/LoginButton';
export default async function Index() {
return (
<>
- <div className="container flex h-full flex-col items-center justify-center">
+ <div className="container -mt-[56px] flex h-screen flex-col items-center justify-center">
<div className="lg:p-8">
<div className="mx-auto flex w-full flex-col justify-center space-y-6 text-center sm:w-[450px]">
<div className="flex flex-col space-y-2 text-center">
@@ -18,7 +18,7 @@ export default async function Index() {
</div>
<LoginButton redirectTo="/explore" />
<p className="text-muted-foreground mx-auto px-8 text-sm sm:w-[350px]">
- By clicking continue, you agree to our{' '}
+ By clicking Login, you agree to our <br />
<Link href="/tos" className="hover:text-primary underline underline-offset-4">
Terms of Service
</Link>{' '}
diff --git a/apps/web/src/components/navigation.tsx b/apps/web/src/components/navigation.tsx
index 3c562700..358270f4 100644
--- a/apps/web/src/components/navigation.tsx
+++ b/apps/web/src/components/navigation.tsx
@@ -35,7 +35,7 @@ export function Navigation() {
const featureFlags = useContext(FeatureFlagContext);
return (
- <header className="z-0 w-full">
+ <header className="z-50 w-full">
{!fssettings.isFullscreen && (
<nav
className={`flex h-14 items-center text-sm font-medium ${
diff --git a/apps/web/src/styles/globals.css b/apps/web/src/styles/globals.css
index 7d37e387..204cd60c 100644
--- a/apps/web/src/styles/globals.css
+++ b/apps/web/src/styles/globals.css
@@ -101,6 +101,11 @@ main {
scroll-behavior: smooth;
height: 100%;
}
+
+.from-background {
+ --tw-gradient-from: hsl(var(--background)) var(--tw-gradient-from-position);
+}
+
.w-md-editor-content {
@apply bg-background dark:bg-muted;
}
@@ -542,3 +547,54 @@ a {
margin-left: 2.375rem !important;
}
}
+
+.fancy-border-gradient::before {
+ inset: 0;
+ content: '';
+ --angle: 0deg;
+ position: absolute;
+ border-radius: inherit;
+ padding: 1.5px; /* control the border thickness */
+ background: conic-gradient(
+ from var(--angle),
+ #3178c622,
+ #3178c644 35%,
+ #3178c688 39%,
+ #3178c6,
+ #3178c688 61%,
+ #3178c644 65%,
+ #3178c622
+ );
+ -webkit-mask-composite: xor;
+ -webkit-mask:
+ linear-gradient(#fff 0 0) content-box,
+ linear-gradient(#fff 0 0);
+ animation: 3s rotate linear infinite;
+ mask-composite: exclude;
+ pointer-events: none;
+}
+
+@keyframes rotate {
+ to {
+ --angle: 360deg;
+ }
+}
+
+@property --angle {
+ syntax: '<angle>';
+ initial-value: 0deg;
+ inherits: false;
+}
+
+.animate-amogup {
+ opacity: 0;
+ transform: translateY(50%);
+ animation: amogup 1s 0.25s ease 1 forwards;
+}
+
+@keyframes amogup {
+ to {
+ opacity: 0.5;
+ transform: translateY(0%);
+ }
+}