From 5d8c2c8df22bee302908819027c773bb4c765518 Mon Sep 17 00:00:00 2001 From: n4ze3m Date: Sat, 15 Apr 2023 19:31:05 +0530 Subject: [PATCH] landing page added --- package.json | 1 + pnpm-lock.yaml | 35 ++++++ py_server/handlers/chat.py | 4 +- src/components/Landing/Hero.tsx | 204 ++++++++++++++++++++++++++++++++ src/pages/index.tsx | 72 +++++------ src/styles/globals.css | 17 +++ 6 files changed, 291 insertions(+), 42 deletions(-) create mode 100644 src/components/Landing/Hero.tsx diff --git a/package.json b/package.json index fef43e6..951dfc4 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "next": "^13.2.4", "react": "18.2.0", "react-dom": "18.2.0", + "react-youtube": "^10.1.0", "superjson": "1.12.2", "zod": "^3.21.4" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 46b6379..0f4bef1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -61,6 +61,9 @@ dependencies: react-dom: specifier: 18.2.0 version: 18.2.0(react@18.2.0) + react-youtube: + specifier: ^10.1.0 + version: 10.1.0(react@18.2.0) superjson: specifier: 1.12.2 version: 1.12.2 @@ -2368,6 +2371,10 @@ packages: /lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + /load-script@1.0.0: + resolution: {integrity: sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA==} + dev: false + /locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} @@ -2958,6 +2965,20 @@ packages: react: 18.2.0 dev: false + /react-youtube@10.1.0(react@18.2.0): + resolution: {integrity: sha512-ZfGtcVpk0SSZtWCSTYOQKhfx5/1cfyEW1JN/mugGNfAxT3rmVJeMbGpA9+e78yG21ls5nc/5uZJETE3cm3knBg==} + engines: {node: '>= 14.x'} + peerDependencies: + react: '>=0.14.1' + dependencies: + fast-deep-equal: 3.1.3 + prop-types: 15.8.1 + react: 18.2.0 + youtube-player: 5.5.2 + transitivePeerDependencies: + - supports-color + dev: false + /react@18.2.0: resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} engines: {node: '>=0.10.0'} @@ -3079,6 +3100,10 @@ packages: object-inspect: 1.12.3 dev: true + /sister@3.0.2: + resolution: {integrity: sha512-p19rtTs+NksBRKW9qn0UhZ8/TUI9BPw9lmtHny+Y3TinWlOa9jWh9xB0AtPSdmOy49NJJJSSe0Ey4C7h0TrcYA==} + dev: false + /slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} @@ -3496,6 +3521,16 @@ packages: engines: {node: '>=10'} dev: true + /youtube-player@5.5.2: + resolution: {integrity: sha512-ZGtsemSpXnDky2AUYWgxjaopgB+shFHgXVpiJFeNB5nWEugpW1KWYDaHKuLqh2b67r24GtP6HoSW5swvf0fFIQ==} + dependencies: + debug: 2.6.9 + load-script: 1.0.0 + sister: 3.0.2 + transitivePeerDependencies: + - supports-color + dev: false + /zod@3.21.4: resolution: {integrity: sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==} dev: false diff --git a/py_server/handlers/chat.py b/py_server/handlers/chat.py index fc169a9..3fdddc3 100644 --- a/py_server/handlers/chat.py +++ b/py_server/handlers/chat.py @@ -64,8 +64,8 @@ async def chat_app_handler(body: ChatAppBody, jwt: str): messages = [ SystemMessagePromptTemplate.from_template("""You are PageAssist bot. Use the following pieces of context from this webpage to answer the question from the user. -If you don't know the answer, just say you don't know. DO NOT try to make up an answer. If user want recommendation, help from the context, or any other information, please provide it. +If you don't know the answer, just say you don't know. DO NOT try to make up an answer. If the question is not related to the context, politely respond that you are tuned to only answer questions that are related to the context. Helpful answer in markdown: ----------------- {context} @@ -133,8 +133,8 @@ async def chat_extension_handler(body: ChatBody): messages = [ SystemMessagePromptTemplate.from_template("""You are PageAssist bot. Use the following pieces of context from this webpage to answer the question from the user. -If you don't know the answer, just say you don't know. DO NOT try to make up an answer. If user want recommendation, help from the context, or any other information, please provide it. +If you don't know the answer, just say you don't know. DO NOT try to make up an answer. If the question is not related to the context, politely respond that you are tuned to only answer questions that are related to the context. Helpful answer in markdown: ----------------- {context} diff --git a/src/components/Landing/Hero.tsx b/src/components/Landing/Hero.tsx new file mode 100644 index 0000000..db03bcd --- /dev/null +++ b/src/components/Landing/Hero.tsx @@ -0,0 +1,204 @@ +import { Fragment } from "react"; +import { Popover, Transition } from "@headlessui/react"; +import { Bars3Icon, XMarkIcon } from "@heroicons/react/24/outline"; +import Link from "next/link"; +import { useUser } from "@supabase/auth-helpers-react"; +import YouTube from "react-youtube"; + +export default function Hero() { + const user = useUser(); + + return ( +
+
+
+ +
+ +
+ + + +
+
+
+ PageAssist +
+
+ + Close main menu + +
+
+ {user ? ( + + Account + + ) : ( + + Login + + )} +
+
+
+
+
+
+
+

+ Chat with Any Webpage using PageAssist +

+

+ Revolutionize your browsing experience with PageAssist, an + open source Chrome extension that allows you to easily chat + with any webpage using the power of ChatGPT API. +

+ +
+