diff --git a/app/(routes)/chat/page.tsx b/app/(routes)/chat/page.tsx new file mode 100644 index 0000000..eb588a7 --- /dev/null +++ b/app/(routes)/chat/page.tsx @@ -0,0 +1,9 @@ +import React from 'react' + +export default function ChatPage() { + return ( +
+ Damn! bro can't you even wait for my wings? +
+ ) +} diff --git a/app/(routes)/page.tsx b/app/(routes)/page.tsx index 2bab3c4..28bb5b0 100644 --- a/app/(routes)/page.tsx +++ b/app/(routes)/page.tsx @@ -19,13 +19,21 @@ import { OsBtn } from "@/components/custom/os.button"; import { OfcLinks } from "@/db/defaults"; import { useUser } from "@/context/user.context"; import DragableCards from "@/components/custom/hero/dragable.cards"; +import AuthDialog from "@/components/custom/auth/auth.dialog"; export default function Component() { const { user } = useUser(); const [isSidebarExpanded, setIsSidebarExpanded] = useState(false); + const [isOpen, setIsOpen] = useState(false); + + const handleFormSubmit = async(event: React.FormEvent) => { + event.preventDefault(); + setIsOpen(!isOpen); + } return (
+ {/* Background */}
@@ -76,12 +84,13 @@ export default function Component() { {/* Main Content */}
{/* Header at the top */} -
- Public Beta +
+ {/* Public Beta */} +
- +

@@ -93,7 +102,7 @@ export default function Component() { {/* Input area */}
-
+
-
+

diff --git a/app/api/auth/[...nextauth]/route.ts b/app/api/auth/[...nextauth]/route.ts index 458ad26..0d9b42d 100644 --- a/app/api/auth/[...nextauth]/route.ts +++ b/app/api/auth/[...nextauth]/route.ts @@ -1,2 +1 @@ export { GET, POST } from "@/lib/auth/auth"; -export const runtime = "edge"; diff --git a/app/api/auth/user/route.ts b/app/api/auth/user/route.ts new file mode 100644 index 0000000..89e4548 --- /dev/null +++ b/app/api/auth/user/route.ts @@ -0,0 +1,16 @@ +import { NextResponse } from "next/server"; +import { auth } from "@/lib/auth/auth"; + +export async function GET() { + try { + const session = await auth(); + if (session) { + return NextResponse.json({ user: session.user }); + } else { + return NextResponse.json({ user: null }, { status: 401 }); + } + } catch (error) { + console.error("Error in fetching session:", error); + return NextResponse.json({ error: "Internal Server Error" }, { status: 500 }); + } +} diff --git a/app/favicon.ico b/app/favicon.ico index 718d6fe..32a83ce 100644 Binary files a/app/favicon.ico and b/app/favicon.ico differ diff --git a/app/globals.css b/app/globals.css index a7b992b..a1f227a 100644 --- a/app/globals.css +++ b/app/globals.css @@ -78,6 +78,11 @@ body { } } +::selection { + background-color: #6EE7B7; + color: #000000; +} + @layer base { * { @apply border-border; diff --git a/app/layout.tsx b/app/layout.tsx index 36c80e1..c6297b5 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -4,6 +4,7 @@ import "./globals.css"; import { ThemeProvider } from "@/components/custom/theme.provider"; import { UserProvider } from "@/context/user.context"; import { RoutesContext } from "@/context/routes.context"; +import { DATA } from "@/db/defaults"; const geistSans = localFont({ src: "./fonts/GeistVF.woff", @@ -37,8 +38,76 @@ const geistRegular = localFont({ }); export const metadata: Metadata = { - title: "Acter by Saidev Dhal", - description: "Generated by create next app", + metadataBase: new URL(DATA.url), + title: { + default: DATA.name, + template: `%s - ${DATA.name}`, + }, + description: DATA.description, + keywords: [ + "Saidev Dhal", + "SkidGod", + "Saidev Dhal Portfolio", + "Saidev Dhal Projects", + "Saidev Dhal Blogs", + "Saidev Dhal Resume", + "Saidev Dhal Contact", + "Saidev Dhal Instagram", + "Saidev Dhal Youtube", + "Saidev Dhal Email", + "Saidev Dhal LinkedIn", + "Saidev Dhal GitHub", + "Saidev Dhal Twitter", + "saidevdhal", + "skidgod", + "skidgod4444", + ], + authors: [ + { + name: `${DATA.name}`, + url: DATA.url, + }, + ], + creator: `${DATA.name}`, + openGraph: { + title: `${DATA.name}`, + description: DATA.description, + url: DATA.url, + images: [ + { + url: DATA.prevImage, + }, + ], + siteName: `${DATA.name}`, + locale: "en_US", + type: "website", + }, + robots: { + index: true, + follow: true, + googleBot: { + index: true, + follow: true, + "max-video-preview": -1, + "max-image-preview": "large", + "max-snippet": -1, + }, + }, + twitter: { + title: `${DATA.name}`, + card: "summary_large_image", + site: DATA.url, + creator: `${DATA.name}`, + description: DATA.description, + images: [ + { + url: DATA.prevImage, + width: 1200, + height: 630, + alt: `${DATA.name}`, + }, + ], + }, }; const protectedRoutes = ["/chat", "/history"]; @@ -50,7 +119,7 @@ export default function RootLayout({ children: React.ReactNode; }>) { return ( - + diff --git a/bun.lockb b/bun.lockb index 8d4696c..fc58ebf 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/custom/auth/auth.btns.tsx b/components/custom/auth/auth.btns.tsx new file mode 100644 index 0000000..c0352b9 --- /dev/null +++ b/components/custom/auth/auth.btns.tsx @@ -0,0 +1,23 @@ +"use client" +import { signIn } from "next-auth/react" +import { Button } from '@/components/ui/button'; +import { IconBrandGithub, IconBrandGoogle } from '@tabler/icons-react'; +import React from 'react' + +function LoginWithGoogle() { + return ( + + ) +} + +function LoginWithGitHub() { + return ( + + ) + } + +export {LoginWithGoogle, LoginWithGitHub}; \ No newline at end of file diff --git a/components/custom/auth/auth.dialog.tsx b/components/custom/auth/auth.dialog.tsx new file mode 100644 index 0000000..cc85f7d --- /dev/null +++ b/components/custom/auth/auth.dialog.tsx @@ -0,0 +1,43 @@ +import React from 'react' +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTrigger, + } from "@/components/ui/dialog" +import { Button } from '@/components/ui/button'; +import { LogIn } from 'lucide-react'; +import Image from 'next/image'; +import { LoginWithGitHub, LoginWithGoogle } from './auth.btns'; + + interface AuthDialogProps { + open: boolean; + onOpenChange: (open: boolean) => void; + } +export default function AuthDialog({ open, onOpenChange }: AuthDialogProps) { + return ( + + + + + + +
+ logo +
+ + OR + +
+
+ + Continue to Acter with any of the given providers. By using Acter you agree to follow our Terms and Policy. + +
+
+
+ ) +} diff --git a/components/custom/hero/dragable.cards.tsx b/components/custom/hero/dragable.cards.tsx index ad19344..8e336ff 100644 --- a/components/custom/hero/dragable.cards.tsx +++ b/components/custom/hero/dragable.cards.tsx @@ -1,8 +1,5 @@ import { Button } from "@/components/ui/button"; -import { - BoltIcon, - Sparkles, -} from "lucide-react"; +import { BoltIcon, Sparkles } from "lucide-react"; import React, { useState } from "react"; import DraggableWrapper from "../dragable.wrapper"; import { Card } from "@/components/ui/card"; @@ -41,9 +38,9 @@ export default function DragableCards() { left: -300, }} > - - - + + + - + @@ -113,11 +110,13 @@ export default function DragableCards() { left: "10%", }} > +
+
diff --git a/components/ui/animated-gradient-text.tsx b/components/ui/animated-gradient-text.tsx new file mode 100644 index 0000000..19b0e62 --- /dev/null +++ b/components/ui/animated-gradient-text.tsx @@ -0,0 +1,26 @@ +import { ReactNode } from "react"; + +import { cn } from "@/lib/utils"; + +export default function AnimatedGradientText({ + children, + className, +}: { + children: ReactNode; + className?: string; +}) { + return ( +
+
+ + {children} +
+ ); +} diff --git a/components/ui/aurora-background.tsx b/components/ui/aurora-background.tsx new file mode 100644 index 0000000..7627178 --- /dev/null +++ b/components/ui/aurora-background.tsx @@ -0,0 +1,54 @@ +"use client"; +import { cn } from "@/lib/utils"; +import React, { ReactNode } from "react"; + +interface AuroraBackgroundProps extends React.HTMLProps { + children: ReactNode; + showRadialGradient?: boolean; +} + +export const AuroraBackground = ({ + className, + children, + showRadialGradient = true, + ...props +}: AuroraBackgroundProps) => { + return ( +
+
+
+
+
+ {children} +
+
+ ); +}; diff --git a/components/ui/code-comparison.tsx b/components/ui/code-comparison.tsx index 9a93a8f..d931b17 100644 --- a/components/ui/code-comparison.tsx +++ b/components/ui/code-comparison.tsx @@ -31,7 +31,7 @@ export default function CodeComparison({ async function highlightCode() { // Dynamically import `shiki` and the `codeToHtml` function - const shiki = await import('shiki'); + const shiki = await import("shiki"); const { codeToHtml } = shiki; const before = await codeToHtml(beforeCode, { @@ -73,7 +73,7 @@ export default function CodeComparison({ ); } }; - + return (
diff --git a/components/ui/dialog.tsx b/components/ui/dialog.tsx new file mode 100644 index 0000000..95b0d38 --- /dev/null +++ b/components/ui/dialog.tsx @@ -0,0 +1,122 @@ +"use client" + +import * as React from "react" +import * as DialogPrimitive from "@radix-ui/react-dialog" +import { Cross2Icon } from "@radix-ui/react-icons" + +import { cn } from "@/lib/utils" + +const Dialog = DialogPrimitive.Root + +const DialogTrigger = DialogPrimitive.Trigger + +const DialogPortal = DialogPrimitive.Portal + +const DialogClose = DialogPrimitive.Close + +const DialogOverlay = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DialogOverlay.displayName = DialogPrimitive.Overlay.displayName + +const DialogContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + + + {children} + + + Close + + + +)) +DialogContent.displayName = DialogPrimitive.Content.displayName + +const DialogHeader = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
+) +DialogHeader.displayName = "DialogHeader" + +const DialogFooter = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
+) +DialogFooter.displayName = "DialogFooter" + +const DialogTitle = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DialogTitle.displayName = DialogPrimitive.Title.displayName + +const DialogDescription = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DialogDescription.displayName = DialogPrimitive.Description.displayName + +export { + Dialog, + DialogPortal, + DialogOverlay, + DialogTrigger, + DialogClose, + DialogContent, + DialogHeader, + DialogFooter, + DialogTitle, + DialogDescription, +} diff --git a/components/ui/placeholders-and-vanish-input.tsx b/components/ui/placeholders-and-vanish-input.tsx index 74c3972..2b7b891 100644 --- a/components/ui/placeholders-and-vanish-input.tsx +++ b/components/ui/placeholders-and-vanish-input.tsx @@ -26,7 +26,7 @@ export function PlaceholdersAndVanishInput({ }) { const [currentPlaceholder, setCurrentPlaceholder] = useState(0); const intervalRef = useRef(null); - + const startAnimation = () => { intervalRef.current = setInterval(() => { setCurrentPlaceholder((prev) => (prev + 1) % placeholders.length); @@ -66,21 +66,21 @@ export function PlaceholdersAndVanishInput({ if (!canvas) return; const ctx = canvas.getContext("2d"); if (!ctx) return; - + canvas.width = 800; canvas.height = 800; ctx.clearRect(0, 0, 800, 800); const computedStyles = getComputedStyle(inputRef.current); - + const fontSize = parseFloat(computedStyles.getPropertyValue("font-size")); ctx.font = `${fontSize * 2}px ${computedStyles.fontFamily}`; ctx.fillStyle = "#FFF"; ctx.fillText(value, 16, 40); - + const imageData = ctx.getImageData(0, 0, 800, 800); const pixelData = imageData.data; const newData: PixelData[] = []; - + for (let t = 0; t < 800; t++) { const i = 4 * t * 800; for (let n = 0; n < 800; n++) { @@ -99,10 +99,9 @@ export function PlaceholdersAndVanishInput({ } } } - + newDataRef.current = newData; }, [value]); - useEffect(() => { draw(); diff --git a/components/ui/rainbow-button.tsx b/components/ui/rainbow-button.tsx index 26a6187..77a7163 100644 --- a/components/ui/rainbow-button.tsx +++ b/components/ui/rainbow-button.tsx @@ -2,7 +2,10 @@ import React from "react"; import { cn } from "@/lib/utils"; -export function RainbowButton({ children, ...props }: React.ButtonHTMLAttributes) { +export function RainbowButton({ + children, + ...props +}: React.ButtonHTMLAttributes) { return (