From 88e4b4ebb0ec4ce1a3f419e1338cabb93986f580 Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 25 Nov 2024 22:04:39 +0000 Subject: [PATCH] feat: setup landing page --- next.config.mjs | 19 ----- src/components/AuthForm.tsx | 2 +- src/components/Button.tsx | 92 +++++++++++++------- src/components/Dashboard.tsx | 37 +++++--- src/components/PatternedBackground.tsx | 13 +-- src/pages/_app.tsx | 5 +- src/pages/index.tsx | 5 ++ src/styles/globals.css | 17 ++++ src/views/board/components/Filters.tsx | 2 +- src/views/home/index.tsx | 113 +++++++++++++++++++++++++ tailwind.config.ts | 29 +++++-- 11 files changed, 247 insertions(+), 87 deletions(-) create mode 100644 src/pages/index.tsx create mode 100644 src/views/home/index.tsx diff --git a/next.config.mjs b/next.config.mjs index 3cb5e494..507dd7c7 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -8,25 +8,6 @@ await import("./src/env.mjs"); /** @type {import("next").NextConfig} */ const config = { reactStrictMode: false, - images: { - remotePatterns: [ - { - protocol: "https", - hostname: "storage.googleapis.com", - port: "", - pathname: "/**", - }, - ], - }, - redirects: async () => { - return [ - { - source: "/", - destination: "/boards", - permanent: true, - }, - ]; - }, }; export default config; diff --git a/src/components/AuthForm.tsx b/src/components/AuthForm.tsx index e8b7c80f..3fed355b 100644 --- a/src/components/AuthForm.tsx +++ b/src/components/AuthForm.tsx @@ -74,7 +74,7 @@ export function Auth({ setIsMagicLinkSent }: AuthProps) { Please enter a valid email address

)} - {loginWithEmail.error ?? loginWithOAuth.error ? ( + {(loginWithEmail.error ?? loginWithOAuth.error) ? (

Something went wrong, please try again later or contact customer support. diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 501b1e92..ff2c1168 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -1,3 +1,4 @@ +import Link from "next/link"; import { twMerge } from "tailwind-merge"; import LoadingSpinner from "./LoadingSpinner"; @@ -5,52 +6,79 @@ interface ButtonProps extends React.ButtonHTMLAttributes { variant?: "primary" | "secondary" | "danger" | "ghost"; size?: "sm" | "md" | "lg"; isLoading?: boolean; - icon?: React.ReactNode; + iconLeft?: React.ReactNode; + iconRight?: React.ReactNode; + href?: string; + openInNewTab?: boolean; } const Button = ({ children, size = "md", - icon, + iconLeft, + iconRight, isLoading, variant = "primary", + href, + openInNewTab, ...props }: ButtonProps) => { + const classes = twMerge( + "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-2 text-sm font-semibold text-light-50 shadow-sm focus-visible:outline-none", + size === "sm" && "text-xs", + size === "lg" && "px-4 py-3 text-lg", + variant === "primary" && + "bg-light-1000 dark:bg-dark-1000 dark:text-dark-50", + variant === "secondary" && + "border-[1px] border-light-600 bg-light-50 text-light-1000 dark:border-dark-600 dark:bg-dark-300 dark:text-dark-1000", + variant === "danger" && + "dark:text-red-1000 border-[1px] border-red-600 bg-red-50 dark:border-red-600 dark:bg-red-500", + variant === "ghost" && + "bg-none text-light-1000 shadow-none hover:bg-light-300 dark:text-dark-1000 dark:hover:bg-dark-200", + props.disabled && "opacity-50", + ); + + const content = ( + + {isLoading && ( + + + + )} +

+ {iconLeft && {iconLeft}} + {children} + {iconRight && {iconRight}} +
+ + ); + + if (href) { + return ( + )} + > + {content} + + ); + } + return ( ); }; diff --git a/src/components/Dashboard.tsx b/src/components/Dashboard.tsx index f6d4a46e..970e36d4 100644 --- a/src/components/Dashboard.tsx +++ b/src/components/Dashboard.tsx @@ -1,3 +1,4 @@ +import Link from "next/link"; import { api } from "~/utils/api"; import SideNavigation from "./SideNavigation"; import FeedbackButton from "./FeedbackButton"; @@ -6,20 +7,30 @@ export default function Dashboard(props: { children: React.ReactNode }) { const { data, isLoading } = api.auth.getUser.useQuery(); return ( -
-
-
-

- kan.bn -

- + <> + +
+
+
+ +

+ kan.bn +

+ + +
+
+ +
+ +
{props.children}
- -
- -
{props.children}
-
-
+ ); } diff --git a/src/components/PatternedBackground.tsx b/src/components/PatternedBackground.tsx index 346edcd9..6304f95e 100644 --- a/src/components/PatternedBackground.tsx +++ b/src/components/PatternedBackground.tsx @@ -1,15 +1,6 @@ const PatternedBackground = () => ( -
- +
+ {
diff --git a/src/pages/index.tsx b/src/pages/index.tsx new file mode 100644 index 00000000..ff2bc1a8 --- /dev/null +++ b/src/pages/index.tsx @@ -0,0 +1,5 @@ +import HomeView from "~/views/home"; + +export default function Home() { + return ; +} diff --git a/src/styles/globals.css b/src/styles/globals.css index 4906ef66..aa3e8422 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -7,3 +7,20 @@ display: block; color: #707070; } + +.gradient-border::before { + background: conic-gradient( + from 0deg, + transparent 0deg, + transparent 45deg, + rgba(244, 114, 182, 0.4) 85deg, + rgba(192, 132, 252, 0.4) 95deg, + transparent 110deg, + transparent 360deg + ); + content: ''; + position: absolute; + inset: -50%; + width: 200%; + height: 200%; +} diff --git a/src/views/board/components/Filters.tsx b/src/views/board/components/Filters.tsx index 8edec4fe..208fc0a1 100644 --- a/src/views/board/components/Filters.tsx +++ b/src/views/board/components/Filters.tsx @@ -117,7 +117,7 @@ const Filters = () => { handleSelect={handleSelect} menuSpacing="md" > - }> + }> Filter {numOfFilters > 0 && (
+
+
+

+ kan.bn +

+
+
+ + Roadmap + + + Features + + + Pricing + + + Docs + +
+
+ {isLoggedIn ? ( + + ) : ( + <> + + + + )} +
+
+ +
+
+
+
+
+
+ + Star on Github + + +
+
+ +

+ The open source
+ alternative to Trello +

+ +

+ A powerful, flexible kanban app that helps you organise work, + track progress, and deliver results—all in one place. +

+ +
+ + +
+

+ No credit card required +

+
+
+
+
+

+ We are currently building the product and will be launching + soon. +

+
+
+
+
+
+ ); +} diff --git a/tailwind.config.ts b/tailwind.config.ts index 804f136e..f2d77261 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -2,18 +2,28 @@ import { type Config } from "tailwindcss"; export default { content: ["./src/**/*.tsx"], - darkMode: 'class', + darkMode: "class", theme: { extend: { fontFamily: { - sans: ['var(--font-plus-jakarta-sans), Plus Jakarta Sans'] + sans: ["var(--font-plus-jakarta-sans), Plus Jakarta Sans"], }, fontSize: { sm: "0.8rem", }, boxShadow: { - '3xl-dark': '0px 16px 70px rgba(0, 0, 0, 0.5)', - '3xl-light': 'rgba(0, 0, 0, 0.12) 0px 4px 30px, rgba(0, 0, 0, 0.04) 0px 3px 17px, rgba(0, 0, 0, 0.04) 0px 2px 8px, rgba(0, 0, 0, 0.04) 0px 1px 1px' + "3xl-dark": "0px 16px 70px rgba(0, 0, 0, 0.5)", + "3xl-light": + "rgba(0, 0, 0, 0.12) 0px 4px 30px, rgba(0, 0, 0, 0.04) 0px 3px 17px, rgba(0, 0, 0, 0.04) 0px 2px 8px, rgba(0, 0, 0, 0.04) 0px 1px 1px", + }, + animation: { + "border-spin": "border-spin 4s linear infinite", + }, + keyframes: { + "border-spin": { + from: { transform: "rotate(0deg)" }, + to: { transform: "rotate(360deg)" }, + }, }, colors: { "dark-50": "#161616", @@ -39,13 +49,16 @@ export default { "light-800": "hsl(0deg 0% 56.1%)", "light-900": "hsl(0deg 0% 52.2%)", "light-950": "hsl(0deg 0% 43.5%)", - "light-1000": "hsl(0deg 0% 9%)" + "light-1000": "hsl(0deg 0% 9%)", }, screens: { - xxl: '1600px' - } + xxl: "1600px", + }, }, }, // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-var-requires - plugins: [require("@tailwindcss/forms"), require('tailwind-scrollbar')({ nocompatible: true })], + plugins: [ + require("@tailwindcss/forms"), + require("tailwind-scrollbar")({ nocompatible: true }), + ], } satisfies Config;