Skip to content

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

update styles for support page and Support Us navbar button (#1582)

PickleNik99d5f4cf63fe
diff --git a/apps/web/src/app/_components/hero.tsx b/apps/web/src/app/_components/hero.tsx
index 5665140b..c9bc3a78 100644
--- a/apps/web/src/app/_components/hero.tsx
+++ b/apps/web/src/app/_components/hero.tsx
@@ -145,11 +145,11 @@ function BeamOfLight() {
export async function Hero() {
const session = await auth();
return (
- <section className="pointer-events-none -mt-[56px] min-h-[calc(100vh)] overflow-hidden lg:min-h-0 lg:pt-[56px]">
+ <section className="pointer-events-none min-h-screen lg:min-h-0 lg:pt-[3.5rem]">
<div className="absolute inset-10 -z-30 overflow-hidden rounded-full opacity-70 lg:hidden">
<BackgroundGrid />
</div>
- <div className="container relative grid min-h-screen items-center justify-center py-24 lg:min-h-0 lg:grid-cols-2 lg:py-0 [&>*]:pointer-events-auto">
+ <div className="container relative -mt-[3rem] grid min-h-screen items-center justify-center py-24 lg:min-h-0 lg:grid-cols-2 lg:py-0 [&>*]:pointer-events-auto">
<BeamOfLight />
<div className="flex w-full flex-col items-center justify-center gap-10 lg:items-start">
<a
diff --git a/apps/web/src/app/explore/_components/index.tsx b/apps/web/src/app/explore/_components/index.tsx
index beaf2f9b..a00b094e 100644
--- a/apps/web/src/app/explore/_components/index.tsx
+++ b/apps/web/src/app/explore/_components/index.tsx
@@ -8,7 +8,7 @@ export const dynamic = 'force-dynamic';
export async function Explore() {
return (
<>
- <div className="flex flex-col gap-8 py-8 md:gap-10 md:py-8">
+ <div className="flex flex-col gap-8 py-8 md:gap-10">
<div className="container text-center">
<h1 className="mb-8 text-4xl font-bold tracking-tight text-neutral-900 dark:text-white">
Explore
diff --git a/apps/web/src/app/support/page.tsx b/apps/web/src/app/support/page.tsx
index 582f86d3..cddfd923 100644
--- a/apps/web/src/app/support/page.tsx
+++ b/apps/web/src/app/support/page.tsx
@@ -1,6 +1,9 @@
import type { Metadata } from 'next';
import { auth } from '~/server/auth';
import { Button } from '@repo/ui/components/button';
+import styles from './support.module.css';
+import { HeartHandshake } from '@repo/ui/icons';
+// import { HandHeart } from '@repo/ui/icons/hand-heart';
export const metadata: Metadata = {
title: 'Support the Platform | TypeHero',
@@ -9,41 +12,57 @@ export const metadata: Metadata = {
export default async function DonatePage() {
const session = await auth();
return (
- <div className="container h-full p-4">
- <div className="max-w-[69ch] text-lg leading-9 text-neutral-600 dark:text-white/50">
- <p className="mb-6">
- <span className="text-primary">TypeHero</span> and{' '}
- <span className="text-red-600">Advent of TypeScript</span> will always be{' '}
- <span className="font-semibold dark:text-neutral-200">free</span> platforms to use.
+ // 3.5rem is the height of the navbar, thus -7rem to center vertically
+ <div className="container relative flex min-h-[calc(100lvh-7rem)] flex-col p-4 py-8 sm:items-center sm:justify-center sm:text-center">
+ <div className={`${styles.supportBackground} fixed left-0 -z-10 h-full w-full`} />
+ <div className="mx-auto max-w-[69ch] text-lg leading-9 text-neutral-600 dark:text-white/50">
+ <div className="mb-8 flex items-center gap-4 sm:flex-col">
+ <div className="hidden h-12 w-12 place-items-center rounded-full bg-black/10 sm:grid dark:bg-gradient-to-b dark:from-white/10 dark:to-[#bea74b44]">
+ <HeartHandshake className="h-8 w-8 stroke-1 text-neutral-900 dark:text-white" />
+ </div>
+ <h1 className="text-4xl font-bold tracking-tight text-neutral-900 dark:text-white">
+ Support
+ </h1>
+ </div>
+ <p className="mb-6 text-balance">
+ <span className="bg-gradient-to-br from-blue-400 to-blue-600 bg-clip-text font-bold text-transparent duration-300 hover:underline">
+ TypeHero
+ </span>{' '}
+ and{' '}
+ <span className="bg-gradient-to-br from-rose-400 to-rose-600 bg-clip-text font-bold text-transparent duration-300 hover:underline">
+ Advent of TypeScript
+ </span>{' '}
+ will always be <span className="font-semibold dark:text-neutral-200">free</span> platforms
+ to use.
</p>
- <p className="mb-6">
+ <p className="mb-6 text-balance">
Contributions will go towards server costs, time spent maintaining the platform, Advent of
TypeScript, and future development.
</p>
+ <Button
+ asChild
+ className={`${styles.donateStripeLinkBtn} group relative w-fit overflow-hidden rounded-xl border-none p-0 font-bold !ring-0 transition-all duration-300 hover:-translate-y-0.5 hover:shadow-xl active:translate-y-0 active:duration-75 dark:p-[1px]`}
+ variant="outline"
+ >
+ <a href="https://donate.stripe.com/7sIdR1c992mdf1m000">
+ <span className="inline-flex h-full w-fit items-center gap-2 rounded-xl bg-black px-4 py-2 text-white transition-all duration-300 dark:bg-neutral-900 dark:text-white">
+ Click to Donate
+ </span>
+ </a>
+ </Button>
{session ? (
- <p className="mb-6">
+ <p className="mb-6 mt-8 max-w-[42ch] text-balance text-sm sm:mx-auto">
Since you are logged in you will see a "Supporter" badge appear next to your name on
both the TypeHero and Advent of TypeScript platforms.
</p>
) : (
- <p className="mb-6">
+ <p className="mb-6 mt-8 max-w-[42ch] text-balance text-sm sm:mx-auto">
<span className="font-semibold dark:text-neutral-200">You are not logged in!</span> If
you would like to receive "Supporter" badge on both the TypeHero and Advent of
TypeScript platforms, please log in, otherwise, your donation will be anonymous.
</p>
)}
</div>
- <Button
- asChild
- className="donate-stripe-link-btn group relative w-fit overflow-hidden rounded-xl p-[1px] font-bold transition-all duration-300 md:mr-0 lg:mr-auto"
- variant="outline"
- >
- <a href="https://donate.stripe.com/7sIdR1c992mdf1m000">
- <span className="inline-flex h-full w-fit items-center gap-2 rounded-xl bg-white px-4 py-2 text-black transition-all duration-300 dark:bg-neutral-900 dark:text-white">
- Click to Donate
- </span>
- </a>
- </Button>
</div>
);
}
diff --git a/apps/web/src/app/support/support.module.css b/apps/web/src/app/support/support.module.css
new file mode 100644
index 00000000..eb2a5b4f
--- /dev/null
+++ b/apps/web/src/app/support/support.module.css
@@ -0,0 +1,42 @@
+/* The module for the Newsletter page background */
+.supportBackground {
+ animation: fade 5s linear infinite alternate;
+ background:
+ /* linear-gradient(0deg, hsl(var(--background)) 0%, rgba(9, 9, 11, 0) 50%), */ radial-gradient(
+ ellipse 100% 55% at 50% 100%,
+ #0000 0%,
+ hsl(46 97% 65% / 0.13),
+ #0000 150%
+ );
+}
+
+.donateStripeLinkBtn {
+ background: linear-gradient(
+ var(--gradient-angle),
+ hsla(46, 97%, 65%, 0.5),
+ hsla(46, 97%, 65%, 0.1),
+ hsla(46, 97%, 65%, 1),
+ hsla(46, 97%, 65%, 0.3)
+ ) !important;
+ animation: gradient-rotate 5s linear infinite reverse;
+}
+
+@keyframes gradient-rotate {
+ 0% {
+ --gradient-angle: 360deg;
+ }
+
+ 100% {
+ --gradient-angle: 0deg;
+ }
+}
+
+@keyframes fade {
+ 0% {
+ opacity: 1;
+ }
+
+ 100% {
+ opacity: 0.5;
+ }
+}
diff --git a/apps/web/src/components/Navigation/index.tsx b/apps/web/src/components/Navigation/index.tsx
index e4cde788..3ec46ee7 100644
--- a/apps/web/src/components/Navigation/index.tsx
+++ b/apps/web/src/components/Navigation/index.tsx
@@ -50,7 +50,7 @@ export async function Navigation() {
<NavLink title="Tracks" href="/tracks" />
{featureFlags?.enableHolidayEvent ? (
<div className="flex items-center gap-1">
- <NavLink title="Advent of TypeScript" href="/aot-2023" />
+ <NavLink title="Advent of TS" href="/aot-2023" />
</div>
) : null}
</>
@@ -58,8 +58,8 @@ export async function Navigation() {
const NavLinks = (
<>
- <div className="ml-4 hidden items-center gap-4 md:flex">{TopSectionLinks}</div>
- <div className="flex flex-col gap-5 pl-4 md:hidden">
+ <div className="hidden items-center gap-4 md:flex">{TopSectionLinks}</div>
+ <div className="flex flex-col gap-5 pl-2 md:hidden">
{TopSectionLinks}
{!session?.user && (
<div className="flex items-center gap-2">
@@ -95,7 +95,7 @@ export async function Navigation() {
<header className="w-full">
<NavWrapper>
<div className="flex w-full items-center justify-between">
- <div className="relative flex items-center gap-3">
+ <div className="relative flex items-center gap-4">
<SkipToCodeEditor />
<Link className="flex space-x-1.5 focus:outline-none focus-visible:ring-2" href="/">
<svg
@@ -123,7 +123,7 @@ export async function Navigation() {
hero <span className="text-muted-foreground bg-muted px-1 text-xs">BETA</span>
</div>
</Link>
- <div className="hidden items-center md:ml-4 md:flex md:gap-4">{NavLinks}</div>
+ <div className="hidden items-center md:flex md:gap-4">{NavLinks}</div>
</div>
<div className="flex">
@@ -131,7 +131,10 @@ export async function Navigation() {
<Suspense>
<Search />
</Suspense>
- <Link className="donate-btn text-black dark:text-white" href="/support">
+ <Link
+ className="donate-btn relative overflow-hidden rounded-md border border-[#bea74b66] px-3 py-2 text-black duration-300 hover:bg-[#eed15f] dark:text-white dark:hover:bg-[#bea74b44]"
+ href="/support"
+ >
Support Us
</Link>
{session ? <NotificationLink notificationCount={notificationCount} /> : null}
diff --git a/apps/web/src/components/Navigation/login-link.tsx b/apps/web/src/components/Navigation/login-link.tsx
index af7aa4de..b09f645c 100644
--- a/apps/web/src/components/Navigation/login-link.tsx
+++ b/apps/web/src/components/Navigation/login-link.tsx
@@ -14,7 +14,7 @@ export function LoginLink({ className }: { className?: string }) {
return (
<Link
className={clsx(
- 'focus:bg-accent w-20 rounded-lg bg-transparent p-2 text-black duration-300 hover:bg-gray-200 focus:outline-none dark:text-white hover:dark:bg-gray-800',
+ 'focus:bg-accent w-20 rounded-md border border-transparent bg-transparent p-2 text-black duration-300 hover:border-black/30 hover:bg-black/10 focus:outline-none dark:text-white dark:hover:border-white/30 dark:hover:bg-white/10',
className,
)}
href={{
diff --git a/apps/web/src/components/Navigation/mobile-nav.tsx b/apps/web/src/components/Navigation/mobile-nav.tsx
index 7e8a4dc2..8303c00d 100644
--- a/apps/web/src/components/Navigation/mobile-nav.tsx
+++ b/apps/web/src/components/Navigation/mobile-nav.tsx
@@ -40,7 +40,7 @@ export function MobileNav({ children }: Props) {
{/* Hamburger Icon */}
<button
className={cn(
- 'hamburger rounded-lg p-4 duration-300 focus:outline-none ',
+ 'hamburger rounded-lg p-4 duration-300 focus:outline-none ',
open ? 'is-active' : '',
)}
onClick={() => setOpen((prev) => !prev)}
diff --git a/apps/web/src/components/Navigation/notification-link.tsx b/apps/web/src/components/Navigation/notification-link.tsx
index e17bba4a..87b8bab3 100644
--- a/apps/web/src/components/Navigation/notification-link.tsx
+++ b/apps/web/src/components/Navigation/notification-link.tsx
@@ -23,6 +23,7 @@ export function NotificationLink({ notificationCount }: { notificationCount: num
onClick={() => {
track('notifications');
}}
+ className="ml-2"
aria-label="notification page link"
href={{
pathname: '/notifications',
diff --git a/apps/web/src/styles/globals.css b/apps/web/src/styles/globals.css
index fc1a361a..a3ffc92a 100644
--- a/apps/web/src/styles/globals.css
+++ b/apps/web/src/styles/globals.css
@@ -281,17 +281,6 @@ main {
animation: gradient-rotate 5s linear infinite reverse;
}
-.donate-stripe-link-btn {
- background: linear-gradient(
- var(--gradient-angle),
- hsla(46, 97%, 65%, 0.5),
- hsla(46, 97%, 65%, 0.1),
- hsla(46, 97%, 65%, 1),
- hsla(46, 97%, 65%, 0.3)
- ) !important;
- animation: gradient-rotate 5s linear infinite reverse;
-}
-
.wl-form-button {
background: linear-gradient(var(--gradient-angle), #34d399, #60a5fa, #ff88ff, #ff8844);
animation: gradient-rotate 5s linear infinite reverse;
@@ -766,15 +755,6 @@ body.mobile-nav-active {
overflow: hidden;
}
-.donate-btn {
- border: 1px solid #bea74b;
- font-size: 1rem;
- padding: 0.4rem 1.25rem;
- border-radius: 1.1rem;
- overflow: hidden;
- position: relative;
-}
-
.donate-btn:before {
content: '';
background: #ffffff80;
diff --git a/packages/ui/src/icons.ts b/packages/ui/src/icons.ts
index bd1585cd..19197cbb 100644
--- a/packages/ui/src/icons.ts
+++ b/packages/ui/src/icons.ts
@@ -77,6 +77,8 @@ export {
Text,
FlaskConical,
History,
+ // HandHeart,
+ HeartHandshake,
ArrowLeft,
RectangleVertical,
SearchIcon,