From bbe83ab76f2882ec78c6f2b7db77cedf62b50036 Mon Sep 17 00:00:00 2001 From: Dhravya Date: Sat, 25 May 2024 23:02:47 -0500 Subject: added kartik's code --- apps/web/app/(landing)/Navbar.tsx | 7 +-- apps/web/app/(landing)/page.tsx | 7 ++- apps/web/app/globals.css | 76 ++++++++++++++--------------- apps/web/app/home/header.tsx | 34 +++++++++++++ apps/web/app/home/menu.tsx | 50 +++++++++++++++++++ apps/web/app/home/page.tsx | 25 ++++++++++ apps/web/app/home/queryinput.tsx | 43 ++++++++++++++++ apps/web/app/layout.tsx | 4 +- packages/tailwind-config/tailwind.config.ts | 17 +++---- 9 files changed, 207 insertions(+), 56 deletions(-) create mode 100644 apps/web/app/home/header.tsx create mode 100644 apps/web/app/home/menu.tsx create mode 100644 apps/web/app/home/page.tsx create mode 100644 apps/web/app/home/queryinput.tsx diff --git a/apps/web/app/(landing)/Navbar.tsx b/apps/web/app/(landing)/Navbar.tsx index 7d0e3225..6103af38 100644 --- a/apps/web/app/(landing)/Navbar.tsx +++ b/apps/web/app/(landing)/Navbar.tsx @@ -1,3 +1,4 @@ +import { ArrowRightIcon } from "@radix-ui/react-icons"; import Logo from "../../public/logo.svg"; import { Github } from "@repo/ui/src/components/icons"; import Image from "next/image"; @@ -24,10 +25,10 @@ function Navbar() { - - Open source + Login + diff --git a/apps/web/app/(landing)/page.tsx b/apps/web/app/(landing)/page.tsx index 36f0ce8d..e3201912 100644 --- a/apps/web/app/(landing)/page.tsx +++ b/apps/web/app/(landing)/page.tsx @@ -6,6 +6,7 @@ import { Toaster } from "@repo/ui/src/shadcn/toaster"; import Features from "./Features"; import Footer from "./footer"; import { auth } from "../helpers/server/auth"; +import { redirect } from "next/navigation"; export const runtime = "edge"; @@ -14,8 +15,12 @@ export default async function Home() { console.log(user); + if (user) { + // await redirect("/home") + } + return ( -
+
{/* Background gradients */} diff --git a/apps/web/app/globals.css b/apps/web/app/globals.css index 8eee6cbd..b1902464 100644 --- a/apps/web/app/globals.css +++ b/apps/web/app/globals.css @@ -1,50 +1,48 @@ -:root { - --max-width: 1100px; - --border-radius: 12px; - --font-mono: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", - "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", - "Fira Mono", "Droid Sans Mono", "Courier New", monospace; +@tailwind base; +@tailwind components; +@tailwind utilities; - --foreground-rgb: 255, 255, 255; - --background-start-rgb: 0, 0, 0; - --background-end-rgb: 0, 0, 0; +/* :root { + --foreground-rgb: 0, 0, 0; + --background-start-rgb: 214, 219, 220; + --background-end-rgb: 255, 255, 255; +} */ - --callout-rgb: 20, 20, 20; - --callout-border-rgb: 108, 108, 108; - --card-rgb: 100, 100, 100; - --card-border-rgb: 200, 200, 200; - - --glow-conic: conic-gradient( - from 180deg at 50% 50%, - #2a8af6 0deg, - #a853ba 180deg, - #e92a67 360deg - ); +@media (prefers-color-scheme: dark) { + :root { + --foreground: rgba(179, 188, 197, 1); + --foreground-menu: rgba(106, 115, 125, 1); + --background: rgba(23, 27, 31, 1); + --secondary: rgba(31, 36, 40, 1); + --primary: rgba(54, 157, 253, 1); + --border: rgba(51, 57, 67, 1); + } } -* { - box-sizing: border-box; - padding: 0; - margin: 0; +body { + color: var(--foreground); + background: var(--background); + font-size: 14px; } -html, -body { - max-width: 100vw; - overflow-x: hidden; +@layer base { + .all-center { + display: flex; + align-items: center; + justify-content: center; + } } -body { - color: rgb(var(--foreground-rgb)); - background: linear-gradient( - to bottom, - transparent, - rgb(var(--background-end-rgb)) - ) - rgb(var(--background-start-rgb)); +@layer utilities { + .text-balance { + text-wrap: balance; + } } -a { - color: inherit; - text-decoration: none; +.gradient-background { + background: linear-gradient( + 150deg, + rgba(255, 255, 255, 0.1) 0%, + rgba(255, 255, 255, 0) + ); } diff --git a/apps/web/app/home/header.tsx b/apps/web/app/home/header.tsx new file mode 100644 index 00000000..0f84cbe2 --- /dev/null +++ b/apps/web/app/home/header.tsx @@ -0,0 +1,34 @@ +import React from "react"; +import Image from "next/image"; +import Link from "next/link"; +import Logo from "../../public/logo.svg"; +import { AddIcon, ChatIcon } from "@repo/ui/src/icons"; + +function Header() { + return ( +
+
+ + SuperMemory logo + + +
+ +
+ + +
+
+ ); +} + +export default Header; diff --git a/apps/web/app/home/menu.tsx b/apps/web/app/home/menu.tsx new file mode 100644 index 00000000..1ab22543 --- /dev/null +++ b/apps/web/app/home/menu.tsx @@ -0,0 +1,50 @@ +import React from "react"; +import Image from "next/image"; +import Link from "next/link"; +import { MemoriesIcon, ExploreIcon, HistoryIcon } from "@repo/ui/src/icons"; + +function Menu() { + const menuItems = [ + { + icon: MemoriesIcon, + text: "Memories", + url: "/", + }, + { + icon: ExploreIcon, + text: "Explore", + url: "/explore", + }, + { + icon: HistoryIcon, + text: "History", + url: "/history", + }, + ]; + + return ( +
+
+
+ {menuItems.map((item) => ( +
+ {`${item.text} +

+ {item.text} +

+
+ ))} +
+
+
+ ); +} + +export default Menu; diff --git a/apps/web/app/home/page.tsx b/apps/web/app/home/page.tsx new file mode 100644 index 00000000..83416bee --- /dev/null +++ b/apps/web/app/home/page.tsx @@ -0,0 +1,25 @@ +import React from "react"; +import Menu from "./menu"; +import Header from "./header"; +import QueryInput from "./queryinput"; + +function Page() { + return ( +
+ + +
+ +
+ {/* all content goes here */} +
+ +
+ +
+
+
+ ); +} + +export default Page; diff --git a/apps/web/app/home/queryinput.tsx b/apps/web/app/home/queryinput.tsx new file mode 100644 index 00000000..41b2934f --- /dev/null +++ b/apps/web/app/home/queryinput.tsx @@ -0,0 +1,43 @@ +import { ArrowRightIcon, MemoriesIcon, SelectIcon } from "@repo/ui/src/icons"; +import Image from "next/image"; +import React from "react"; +import Divider from "@repo/ui/src/shadcn/divider"; + +function QueryInput() { + return ( +
+ {/* input and action button */} +
+ + + +
+ + + + {/* suggestions */} +
+ +
+

Nvidia

+

Open-source

+

Artificial Intelligence

+
+
+
+ ); +} + +export default QueryInput; diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx index 035b5827..491162f1 100644 --- a/apps/web/app/layout.tsx +++ b/apps/web/app/layout.tsx @@ -61,9 +61,9 @@ export default function RootLayout({ }): JSX.Element { return ( - + {/* - + */} {/* TODO: when lightmode support is added, remove the 'dark' class from the body tag */} {children} diff --git a/packages/tailwind-config/tailwind.config.ts b/packages/tailwind-config/tailwind.config.ts index b70bf6b8..760c51f5 100644 --- a/packages/tailwind-config/tailwind.config.ts +++ b/packages/tailwind-config/tailwind.config.ts @@ -20,19 +20,14 @@ const config = { }, extend: { colors: { - border: "hsl(var(--border))", + foreground: "var(--foreground)", + "foreground-menu": "var(--foreground-menu)", + background: "var(--background)", + secondary: "var(--secondary)", + primary: "var(--primary)", + border: "var(--border)", input: "hsl(var(--input))", ring: "hsl(var(--ring))", - background: "hsl(var(--background))", - foreground: "hsl(var(--foreground))", - primary: { - DEFAULT: "hsl(var(--primary))", - foreground: "hsl(var(--primary-foreground))", - }, - secondary: { - DEFAULT: "hsl(var(--secondary))", - foreground: "hsl(var(--secondary-foreground))", - }, destructive: { DEFAULT: "hsl(var(--destructive))", foreground: "hsl(var(--destructive-foreground))", -- cgit v1.2.3