PeterPinetree commited on
Commit
bd69b27
·
1 Parent(s): 65aff80

branding: centralize brand name/logo; update metadata, headers, nav, ask-ai UI, uploader, space placeholder, and injected badge to use BRAND_NAME/BRAND_ICON_SRC

Browse files
app/(public)/page.tsx CHANGED
@@ -1,11 +1,12 @@
1
  import { redirect } from "next/navigation";
 
2
  export default function Home() {
3
  redirect("/projects/new");
4
  return (
5
  <>
6
  <header className="container mx-auto pt-20 px-6 relative flex flex-col items-center justify-center text-center">
7
  <div className="rounded-full border border-neutral-100/10 bg-neutral-100/5 text-xs text-neutral-300 px-3 py-1 max-w-max mx-auto mb-2">
8
- DeepSite Public Beta
9
  </div>
10
  <h1 className="text-8xl font-semibold text-white font-mono max-w-4xl">
11
  Code your website with AI in seconds
 
1
  import { redirect } from "next/navigation";
2
+ import { BRAND_NAME } from "@/lib/branding";
3
  export default function Home() {
4
  redirect("/projects/new");
5
  return (
6
  <>
7
  <header className="container mx-auto pt-20 px-6 relative flex flex-col items-center justify-center text-center">
8
  <div className="rounded-full border border-neutral-100/10 bg-neutral-100/5 text-xs text-neutral-300 px-3 py-1 max-w-max mx-auto mb-2">
9
+ {BRAND_NAME} Public Beta
10
  </div>
11
  <h1 className="text-8xl font-semibold text-white font-mono max-w-4xl">
12
  Code your website with AI in seconds
app/layout.tsx CHANGED
@@ -10,6 +10,7 @@ import MY_TOKEN_KEY from "@/lib/get-cookie-name";
10
  import { apiServer } from "@/lib/api";
11
  import AppContext from "@/components/contexts/app-context";
12
  import Script from "next/script";
 
13
 
14
  const inter = Inter({
15
  variable: "--font-inter-sans",
@@ -23,40 +24,40 @@ const ptSans = PT_Sans({
23
  });
24
 
25
  export const metadata: Metadata = {
26
- title: "DeepSite | Build with AI ✨",
27
  description:
28
- "DeepSite is a web development tool that helps you build websites with AI, no code required. Let's deploy your website with DeepSite and enjoy the magic of AI.",
29
  openGraph: {
30
- title: "DeepSite | Build with AI ✨",
31
  description:
32
- "DeepSite is a web development tool that helps you build websites with AI, no code required. Let's deploy your website with DeepSite and enjoy the magic of AI.",
33
  url: "https://deepsite.hf.co",
34
- siteName: "DeepSite",
35
  images: [
36
  {
37
  url: "https://deepsite.hf.co/banner.png",
38
  width: 1200,
39
  height: 630,
40
- alt: "DeepSite Open Graph Image",
41
  },
42
  ],
43
  },
44
  twitter: {
45
  card: "summary_large_image",
46
- title: "DeepSite | Build with AI ✨",
47
  description:
48
- "DeepSite is a web development tool that helps you build websites with AI, no code required. Let's deploy your website with DeepSite and enjoy the magic of AI.",
49
  images: ["https://deepsite.hf.co/banner.png"],
50
  },
51
  appleWebApp: {
52
  capable: true,
53
- title: "DeepSite",
54
  statusBarStyle: "black-translucent",
55
  },
56
  icons: {
57
- icon: "/logo.svg",
58
- shortcut: "/logo.svg",
59
- apple: "/logo.svg",
60
  },
61
  };
62
 
 
10
  import { apiServer } from "@/lib/api";
11
  import AppContext from "@/components/contexts/app-context";
12
  import Script from "next/script";
13
+ import { BRAND_NAME, BRAND_ICON_SRC } from "@/lib/branding";
14
 
15
  const inter = Inter({
16
  variable: "--font-inter-sans",
 
24
  });
25
 
26
  export const metadata: Metadata = {
27
+ title: `${BRAND_NAME} | Build with AI ✨`,
28
  description:
29
+ `${BRAND_NAME} is a web development tool that helps you build websites with AI, no code required. Let's deploy your website and enjoy the magic of AI.`,
30
  openGraph: {
31
+ title: `${BRAND_NAME} | Build with AI ✨`,
32
  description:
33
+ `${BRAND_NAME} is a web development tool that helps you build websites with AI, no code required. Let's deploy your website and enjoy the magic of AI.`,
34
  url: "https://deepsite.hf.co",
35
+ siteName: BRAND_NAME,
36
  images: [
37
  {
38
  url: "https://deepsite.hf.co/banner.png",
39
  width: 1200,
40
  height: 630,
41
+ alt: `${BRAND_NAME} Open Graph Image`,
42
  },
43
  ],
44
  },
45
  twitter: {
46
  card: "summary_large_image",
47
+ title: `${BRAND_NAME} | Build with AI ✨`,
48
  description:
49
+ `${BRAND_NAME} is a web development tool that helps you build websites with AI, no code required. Let's deploy your website and enjoy the magic of AI.`,
50
  images: ["https://deepsite.hf.co/banner.png"],
51
  },
52
  appleWebApp: {
53
  capable: true,
54
+ title: BRAND_NAME,
55
  statusBarStyle: "black-translucent",
56
  },
57
  icons: {
58
+ icon: BRAND_ICON_SRC,
59
+ shortcut: BRAND_ICON_SRC,
60
+ apple: BRAND_ICON_SRC,
61
  },
62
  };
63
 
components/editor/ask-ai/follow-up-tooltip.tsx CHANGED
@@ -4,6 +4,7 @@ import {
4
  PopoverTrigger,
5
  } from "@/components/ui/popover";
6
  import { Info } from "lucide-react";
 
7
 
8
  export const FollowUpTooltip = () => {
9
  return (
@@ -22,7 +23,7 @@ export const FollowUpTooltip = () => {
22
  </header>
23
  <main className="p-4">
24
  <p className="text-neutral-300 text-sm">
25
- Using the Diff-Patch system, allow DeepSite to intelligently update
26
  your project without rewritting the entire codebase.
27
  </p>
28
  <p className="text-neutral-500 text-sm mt-2">
 
4
  PopoverTrigger,
5
  } from "@/components/ui/popover";
6
  import { Info } from "lucide-react";
7
+ import { BRAND_NAME } from "@/lib/branding";
8
 
9
  export const FollowUpTooltip = () => {
10
  return (
 
23
  </header>
24
  <main className="p-4">
25
  <p className="text-neutral-300 text-sm">
26
+ Using the Diff-Patch system, allow {BRAND_NAME} to intelligently update
27
  your project without rewritting the entire codebase.
28
  </p>
29
  <p className="text-neutral-500 text-sm mt-2">
components/editor/ask-ai/index.tsx CHANGED
@@ -23,6 +23,7 @@ import { FollowUpTooltip } from "./follow-up-tooltip";
23
  import { isTheSameHtml } from "@/lib/compare-html-diff";
24
  import { useCallAi } from "@/hooks/useCallAi";
25
  import { SelectedFiles } from "./selected-files";
 
26
  import { Uploader } from "./uploader";
27
 
28
  export function AskAI({
@@ -242,7 +243,7 @@ export function AskAI({
242
  }}
243
  >
244
  <p className="text-sm font-medium text-neutral-300 group-hover:text-neutral-200 transition-colors duration-200">
245
- {isThinking ? "DeepSite is thinking..." : "DeepSite's plan"}
246
  </p>
247
  <ChevronDown
248
  className={classNames(
@@ -298,60 +299,20 @@ export function AskAI({
298
  "AI is working..."
299
  ) : (
300
  <span className="inline-flex">
301
- {[
302
- "D",
303
- "e",
304
- "e",
305
- "p",
306
- "S",
307
- "i",
308
- "t",
309
- "e",
310
- " ",
311
- "i",
312
- "s",
313
- " ",
314
- "T",
315
- "h",
316
- "i",
317
- "n",
318
- "k",
319
- "i",
320
- "n",
321
- "g",
322
- ".",
323
- ".",
324
- ".",
325
- " ",
326
- "W",
327
- "a",
328
- "i",
329
- "t",
330
- " ",
331
- "a",
332
- " ",
333
- "m",
334
- "o",
335
- "m",
336
- "e",
337
- "n",
338
- "t",
339
- ".",
340
- ".",
341
- ".",
342
- ].map((char, index) => (
343
- <span
344
- key={index}
345
- className={classNames(
346
- "bg-gradient-to-r from-neutral-100 to-neutral-300 bg-clip-text text-transparent animate-pulse",
347
- // generate a delay class name like delay-0, delay-1, ...
348
- `ai-delay-${index}`
349
- )}
350
- data-char-index={index}
351
- >
352
- {char === " " ? "\u00A0" : char}
353
- </span>
354
- ))}
355
  </span>
356
  )}
357
  </p>
@@ -377,9 +338,9 @@ export function AskAI({
377
  )}
378
  placeholder={
379
  selectedElement
380
- ? `Ask DeepSite about ${selectedElement.tagName.toLowerCase()}...`
381
  : isFollowUp && (!isSameHtml || pages?.length > 1)
382
- ? "Ask DeepSite for edits (keep it short)"
383
  : "Describe a tiny component or change (1–2 sentences)"
384
  }
385
  value={prompt}
@@ -435,7 +396,7 @@ export function AskAI({
435
  align="start"
436
  className="bg-neutral-950 text-xs text-neutral-200 py-1 px-2 rounded-md -translate-y-0.5"
437
  >
438
- Select an element on the page to ask DeepSite edit it
439
  directly.
440
  </TooltipContent>
441
  </Tooltip>
@@ -478,7 +439,7 @@ export function AskAI({
478
  NEW
479
  </span>
480
  <p className="text-sm text-neutral-100">
481
- DeepSite can now create multiple pages at once. Try it!
482
  </p>
483
  </div>
484
  )}
 
23
  import { isTheSameHtml } from "@/lib/compare-html-diff";
24
  import { useCallAi } from "@/hooks/useCallAi";
25
  import { SelectedFiles } from "./selected-files";
26
+ import { BRAND_NAME } from "@/lib/branding";
27
  import { Uploader } from "./uploader";
28
 
29
  export function AskAI({
 
243
  }}
244
  >
245
  <p className="text-sm font-medium text-neutral-300 group-hover:text-neutral-200 transition-colors duration-200">
246
+ {isThinking ? `${BRAND_NAME} is thinking...` : `${BRAND_NAME}'s plan`}
247
  </p>
248
  <ChevronDown
249
  className={classNames(
 
299
  "AI is working..."
300
  ) : (
301
  <span className="inline-flex">
302
+ {`${BRAND_NAME} is Thinking... Wait a moment...`
303
+ .split("")
304
+ .map((char, index) => (
305
+ <span
306
+ key={index}
307
+ className={classNames(
308
+ "bg-gradient-to-r from-neutral-100 to-neutral-300 bg-clip-text text-transparent animate-pulse",
309
+ `ai-delay-${index}`
310
+ )}
311
+ data-char-index={index}
312
+ >
313
+ {char === " " ? "\u00A0" : char}
314
+ </span>
315
+ ))}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
316
  </span>
317
  )}
318
  </p>
 
338
  )}
339
  placeholder={
340
  selectedElement
341
+ ? `Ask ${BRAND_NAME} about ${selectedElement.tagName.toLowerCase()}...`
342
  : isFollowUp && (!isSameHtml || pages?.length > 1)
343
+ ? `Ask ${BRAND_NAME} for edits (keep it short)`
344
  : "Describe a tiny component or change (1–2 sentences)"
345
  }
346
  value={prompt}
 
396
  align="start"
397
  className="bg-neutral-950 text-xs text-neutral-200 py-1 px-2 rounded-md -translate-y-0.5"
398
  >
399
+ Select an element on the page to ask {BRAND_NAME} edit it
400
  directly.
401
  </TooltipContent>
402
  </Tooltip>
 
439
  NEW
440
  </span>
441
  <p className="text-sm text-neutral-100">
442
+ {BRAND_NAME} can now create multiple pages at once. Try it!
443
  </p>
444
  </div>
445
  )}
components/editor/ask-ai/uploader.tsx CHANGED
@@ -14,6 +14,7 @@ import { RiCheckboxCircleFill } from "react-icons/ri";
14
  import { useUser } from "@/hooks/useUser";
15
  import { LoginModal } from "@/components/login-modal";
16
  import { DeployButtonContent } from "../deploy-button/content";
 
17
 
18
  export const Uploader = ({
19
  pages,
@@ -103,7 +104,7 @@ export const Uploader = ({
103
  Add Custom Images
104
  </p>
105
  <p className="text-sm text-neutral-500 mt-1.5">
106
- Upload images to your project and use them with DeepSite!
107
  </p>
108
  </header>
109
  <main className="space-y-4 p-5">
 
14
  import { useUser } from "@/hooks/useUser";
15
  import { LoginModal } from "@/components/login-modal";
16
  import { DeployButtonContent } from "../deploy-button/content";
17
+ import { BRAND_NAME } from "@/lib/branding";
18
 
19
  export const Uploader = ({
20
  pages,
 
104
  Add Custom Images
105
  </p>
106
  <p className="text-sm text-neutral-500 mt-1.5">
107
+ Upload images to your project and use them with {BRAND_NAME}!
108
  </p>
109
  </header>
110
  <main className="space-y-4 p-5">
components/editor/header/index.tsx CHANGED
@@ -1,7 +1,7 @@
1
  import { ReactNode } from "react";
2
  import { Eye, MessageCircleCode } from "lucide-react";
3
 
4
- import Logo from "@/assets/logo.svg";
5
 
6
  import { Button } from "@/components/ui/button";
7
  import classNames from "classnames";
@@ -34,12 +34,14 @@ export function Header({
34
  <div className="flex items-center justify-start gap-3">
35
  <h1 className="text-neutral-900 dark:text-white text-lg lg:text-xl font-bold flex items-center justify-start">
36
  <Image
37
- src={Logo}
38
- alt="DeepSite Logo"
39
- className="size-6 lg:size-8 mr-2 invert-100 dark:invert-0"
 
 
40
  />
41
  <p className="max-md:hidden flex items-center justify-start">
42
- DeepSite
43
  <span className="font-mono bg-gradient-to-br from-sky-500 to-emerald-500 text-neutral-950 rounded-full text-xs ml-2 px-1.5 py-0.5">
44
  {" "}
45
  v2
 
1
  import { ReactNode } from "react";
2
  import { Eye, MessageCircleCode } from "lucide-react";
3
 
4
+ import { BRAND_LOGO_SRC, BRAND_NAME } from "@/lib/branding";
5
 
6
  import { Button } from "@/components/ui/button";
7
  import classNames from "classnames";
 
34
  <div className="flex items-center justify-start gap-3">
35
  <h1 className="text-neutral-900 dark:text-white text-lg lg:text-xl font-bold flex items-center justify-start">
36
  <Image
37
+ src={BRAND_LOGO_SRC}
38
+ alt={`${BRAND_NAME} Logo`}
39
+ width={32}
40
+ height={32}
41
+ className="size-6 lg:size-8 mr-2"
42
  />
43
  <p className="max-md:hidden flex items-center justify-start">
44
+ {BRAND_NAME}
45
  <span className="font-mono bg-gradient-to-br from-sky-500 to-emerald-500 text-neutral-950 rounded-full text-xs ml-2 px-1.5 py-0.5">
46
  {" "}
47
  v2
components/public/navigation/index.tsx CHANGED
@@ -7,7 +7,7 @@ import { useMount, useUnmount } from "react-use";
7
  import classNames from "classnames";
8
 
9
  import { Button } from "@/components/ui/button";
10
- import Logo from "@/assets/logo.svg";
11
  import { useUser } from "@/hooks/useUser";
12
  import { HIDE_LOGIN } from "@/lib/flags";
13
  import { UserMenu } from "@/components/user-menu";
@@ -89,13 +89,14 @@ export default function Navigation() {
89
  <nav className="grid grid-cols-2 p-4 container mx-auto">
90
  <Link href="/" className="flex items-center gap-1">
91
  <Image
92
- src={Logo}
93
  className="w-9 mr-1"
94
- alt="DeepSite Logo"
95
- width={64}
96
- height={64}
 
97
  />
98
- <p className="font-sans text-white text-xl font-bold">DeepSite</p>
99
  </Link>
100
  <ul className="items-center justify-center gap-6 hidden">
101
  {navigationLinks.map((link) => (
 
7
  import classNames from "classnames";
8
 
9
  import { Button } from "@/components/ui/button";
10
+ import { BRAND_LOGO_SRC, BRAND_NAME } from "@/lib/branding";
11
  import { useUser } from "@/hooks/useUser";
12
  import { HIDE_LOGIN } from "@/lib/flags";
13
  import { UserMenu } from "@/components/user-menu";
 
89
  <nav className="grid grid-cols-2 p-4 container mx-auto">
90
  <Link href="/" className="flex items-center gap-1">
91
  <Image
92
+ src={BRAND_LOGO_SRC}
93
  className="w-9 mr-1"
94
+ alt={`${BRAND_NAME} Logo`}
95
+ width={36}
96
+ height={36}
97
+ priority
98
  />
99
+ <p className="font-sans text-white text-xl font-bold">{BRAND_NAME}</p>
100
  </Link>
101
  <ul className="items-center justify-center gap-6 hidden">
102
  {navigationLinks.map((link) => (
components/space/ask-ai/index.tsx CHANGED
@@ -5,6 +5,7 @@ import { PiGearSixFill } from "react-icons/pi";
5
  import { TiUserAdd } from "react-icons/ti";
6
 
7
  import { Button } from "@/components/ui/button";
 
8
 
9
  export const AskAi = () => {
10
  return (
@@ -13,7 +14,7 @@ export const AskAi = () => {
13
  <textarea
14
  rows={3}
15
  className="w-full bg-transparent text-sm outline-none text-white placeholder:text-neutral-400 p-4 resize-none mb-1"
16
- placeholder="Ask DeepSite anything..."
17
  onChange={() => {}}
18
  onKeyDown={() => {}}
19
  />
 
5
  import { TiUserAdd } from "react-icons/ti";
6
 
7
  import { Button } from "@/components/ui/button";
8
+ import { BRAND_NAME } from "@/lib/branding";
9
 
10
  export const AskAi = () => {
11
  return (
 
14
  <textarea
15
  rows={3}
16
  className="w-full bg-transparent text-sm outline-none text-white placeholder:text-neutral-400 p-4 resize-none mb-1"
17
+ placeholder={`Ask ${BRAND_NAME} anything...`}
18
  onChange={() => {}}
19
  onKeyDown={() => {}}
20
  />
lib/branding.ts ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Centralized branding for name and logo paths
2
+ // Use public/ paths (served by Next) for images. You can set these via env vars.
3
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
+ declare const process: any;
5
+
6
+ export const BRAND_NAME: string = process.env.NEXT_PUBLIC_BRAND_NAME ?? "inSite";
7
+
8
+ // Primary logo used in headers/nav. Prefer PNG as requested; fallback to existing SVG.
9
+ export const BRAND_LOGO_SRC: string =
10
+ process.env.NEXT_PUBLIC_BRAND_LOGO ?? "/logo.svg";
11
+
12
+ // Favicon/app icon (can be same as logo). Prefer PNG; fallback to BRAND_LOGO_SRC.
13
+ export const BRAND_ICON_SRC: string =
14
+ process.env.NEXT_PUBLIC_BRAND_ICON ?? BRAND_LOGO_SRC;
lib/utils.ts CHANGED
@@ -15,6 +15,14 @@ export const COLORS = [
15
  "gray",
16
  ];
17
 
 
 
18
  export const getPTag = (repoId: string) => {
19
- return `<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=${repoId}" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p>`;
 
 
 
 
 
 
20
  };
 
15
  "gray",
16
  ];
17
 
18
+ import { BRAND_ICON_SRC, BRAND_NAME } from "@/lib/branding";
19
+
20
  export const getPTag = (repoId: string) => {
21
+ // Try to resolve absolute URL for icon based on current location when available
22
+ const origin = typeof window !== "undefined" ? window.location.origin : "";
23
+ const icon = BRAND_ICON_SRC.startsWith("http")
24
+ ? BRAND_ICON_SRC
25
+ : `${origin}${BRAND_ICON_SRC}`;
26
+ const home = origin || "https://deepsite.hf.co";
27
+ return `<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="${icon}" alt="${BRAND_NAME} Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="${home}" style="color: #fff;text-decoration: underline;" target="_blank" >${BRAND_NAME}</a> - 🧬 <a href="${home}?remix=${repoId}" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p>`;
28
  };