From e8d1a68b58953bee84209e6abedd1e026250054e Mon Sep 17 00:00:00 2001 From: Josh Collinsworth Date: Fri, 17 May 2024 09:08:55 -0500 Subject: [PATCH] www: refresh home page (#2418) Overhauls the Fresh homepage with a new design, new demos, and new sections highlighting Fresh's capabilities. --------- Co-authored-by: Marvin Hagemeister --- .gitignore | 1 + .vscode/import_map.json | 2 + _typos.toml | 9 +- tests/www/components/gallery/Header.test.tsx | 4 +- www/components/Button.tsx | 13 -- www/components/CodeBlock.tsx | 12 + www/components/CodeWindow.tsx | 37 ++++ www/components/FancyLink.tsx | 34 +++ www/components/Footer.tsx | 8 +- www/components/Header.tsx | 10 +- www/components/NavigationBar.tsx | 8 +- www/components/PageSection.tsx | 13 ++ www/components/SideBySide.tsx | 38 ++++ www/components/gallery/Header.tsx | 2 +- www/components/homepage/CTA.tsx | 36 +++ www/components/homepage/CodeExampleBox.tsx | 0 www/components/homepage/DemoBox.tsx | 19 ++ www/components/homepage/DenoSection.tsx | 34 +++ www/components/homepage/ExampleArrow.tsx | 37 ++++ www/components/homepage/FormsSection.tsx | 92 ++++++++ www/components/homepage/Hero.tsx | 30 +++ www/components/homepage/IslandsSection.tsx | 85 ++++++++ www/components/homepage/PartialsSection.tsx | 87 ++++++++ www/components/homepage/RecipeDemo.tsx | 25 +++ www/components/homepage/RenderingSection.tsx | 66 ++++++ www/components/homepage/SectionHeading.tsx | 11 + www/components/homepage/Simple.tsx | 18 ++ www/components/homepage/SocialProof.tsx | 55 +++++ www/deno.json | 2 + www/fresh.gen.ts | 14 +- www/islands/CopyArea.tsx | 8 +- www/islands/Counter.tsx | 28 ++- www/islands/LemonBottom.tsx | 118 ++++++++++ www/islands/LemonDrop.tsx | 20 +- www/islands/LemonTop.tsx | 124 +++++++++++ www/routes/_app.tsx | 7 + www/routes/components.tsx | 92 -------- www/routes/index.tsx | 218 +++---------------- www/routes/recipes/_layout.tsx | 22 ++ www/routes/recipes/lemon-honey-tea.tsx | 16 ++ www/routes/recipes/lemonade.tsx | 16 ++ www/routes/recipes/lemondrop.tsx | 17 ++ www/static/fonts/FixelVariable.woff2 | Bin 0 -> 190464 bytes www/static/fonts/FixelVariableItalic.woff2 | Bin 0 -> 185756 bytes www/static/fresh-arrow.svg | 1 + www/static/lemon.svg | 1 + www/static/logos/deno.svg | 1 + www/static/logos/preact.svg | 1 + www/static/logos/typescript.svg | 1 + www/static/markdown.css | 9 +- www/static/prism.css | 3 + www/static/showcase/deco.webp | Bin 0 -> 85202 bytes www/static/styles.css | 37 ++++ www/tailwind.config.ts | 8 + www/utils/markdown.ts | 2 +- 55 files changed, 1206 insertions(+), 346 deletions(-) delete mode 100644 www/components/Button.tsx create mode 100644 www/components/CodeBlock.tsx create mode 100644 www/components/CodeWindow.tsx create mode 100644 www/components/FancyLink.tsx create mode 100644 www/components/PageSection.tsx create mode 100644 www/components/SideBySide.tsx create mode 100644 www/components/homepage/CTA.tsx create mode 100644 www/components/homepage/CodeExampleBox.tsx create mode 100644 www/components/homepage/DemoBox.tsx create mode 100644 www/components/homepage/DenoSection.tsx create mode 100644 www/components/homepage/ExampleArrow.tsx create mode 100644 www/components/homepage/FormsSection.tsx create mode 100644 www/components/homepage/Hero.tsx create mode 100644 www/components/homepage/IslandsSection.tsx create mode 100644 www/components/homepage/PartialsSection.tsx create mode 100644 www/components/homepage/RecipeDemo.tsx create mode 100644 www/components/homepage/RenderingSection.tsx create mode 100644 www/components/homepage/SectionHeading.tsx create mode 100644 www/components/homepage/Simple.tsx create mode 100644 www/components/homepage/SocialProof.tsx create mode 100644 www/islands/LemonBottom.tsx create mode 100644 www/islands/LemonTop.tsx delete mode 100644 www/routes/components.tsx create mode 100644 www/routes/recipes/_layout.tsx create mode 100644 www/routes/recipes/lemon-honey-tea.tsx create mode 100644 www/routes/recipes/lemonade.tsx create mode 100644 www/routes/recipes/lemondrop.tsx create mode 100644 www/static/fonts/FixelVariable.woff2 create mode 100644 www/static/fonts/FixelVariableItalic.woff2 create mode 100644 www/static/fresh-arrow.svg create mode 100644 www/static/lemon.svg create mode 100644 www/static/logos/deno.svg create mode 100644 www/static/logos/preact.svg create mode 100644 www/static/logos/typescript.svg create mode 100644 www/static/prism.css create mode 100644 www/static/showcase/deco.webp diff --git a/.gitignore b/.gitignore index 92ae9621..e3856e79 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ _fresh/ tmp/ vendor/ node_modules/ +.DS_Store diff --git a/.vscode/import_map.json b/.vscode/import_map.json index dae2d677..1cb407c1 100644 --- a/.vscode/import_map.json +++ b/.vscode/import_map.json @@ -12,6 +12,8 @@ "@preact/signals-core": "https://esm.sh/@preact/signals-core@1.5.1", "@preact/signals-core@1.2.3": "https://esm.sh/@preact/signals-core@1.2.3", "@preact/signals-core@1.3.0": "https://esm.sh/@preact/signals-core@1.3.0", + "$prism": "https://esm.sh/prismjs@1.29.0", + "$prism/": "https://esm.sh/prismjs@1.29.0/", "$std/": "https://deno.land/std@0.216.0/", "$ga4": "https://raw.githubusercontent.com/denoland/ga4/main/mod.ts", "$marked-mangle": "https://esm.sh/marked-mangle@1.0.1", diff --git a/_typos.toml b/_typos.toml index 7451c3d6..36c7512a 100644 --- a/_typos.toml +++ b/_typos.toml @@ -1,2 +1,9 @@ [files] -extend-exclude = ["tests/fixture_partials/routes/scroll_restoration/index.tsx"] +extend-exclude = [ + "tests/fixture_partials/routes/scroll_restoration/index.tsx", + "www/static/fonts/FixelVariable.woff2", + "www/static/fonts/FixelVariableItalic.woff2", +] + +[default] +extend-ignore-identifiers-re = ["Fixel"] diff --git a/tests/www/components/gallery/Header.test.tsx b/tests/www/components/gallery/Header.test.tsx index 21be7fbc..c79678ab 100644 --- a/tests/www/components/gallery/Header.test.tsx +++ b/tests/www/components/gallery/Header.test.tsx @@ -7,10 +7,10 @@ describe("components/gallery/Header.tsx", () => { beforeAll(setup); afterEach(cleanup); - it("should show 3 links", () => { + it("should show 2 links", () => { const screen = render(
); const links = screen.getAllByRole("link"); - assertEquals(links.length, 3); + assertEquals(links.length, 2); }); it("should show '/docs' as active", () => { diff --git a/www/components/Button.tsx b/www/components/Button.tsx deleted file mode 100644 index df97a7f6..00000000 --- a/www/components/Button.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { JSX } from "preact"; - -export function RoundedButton(props: JSX.HTMLAttributes) { - return ( -
) : (
@@ -34,11 +34,9 @@ export default function Header(props: { title: string; active: string }) { )} -
)} - - ); } diff --git a/www/components/NavigationBar.tsx b/www/components/NavigationBar.tsx index fbd0b3ce..d281fd80 100644 --- a/www/components/NavigationBar.tsx +++ b/www/components/NavigationBar.tsx @@ -12,10 +12,10 @@ export default function NavigationBar( name: "Showcase", href: "/showcase", }, - { - name: "Components", - href: "/components", - }, + // { + // name: "Components", + // href: "/components", + // }, { name: "Blog", href: "https://deno.com/blog?tag=fresh", diff --git a/www/components/PageSection.tsx b/www/components/PageSection.tsx new file mode 100644 index 00000000..19e7a36a --- /dev/null +++ b/www/components/PageSection.tsx @@ -0,0 +1,13 @@ +import { JSX } from "preact"; + +export function PageSection(props: JSX.HTMLAttributes) { + return ( +
+ {props.children} +
+ ); +} diff --git a/www/components/SideBySide.tsx b/www/components/SideBySide.tsx new file mode 100644 index 00000000..8142384b --- /dev/null +++ b/www/components/SideBySide.tsx @@ -0,0 +1,38 @@ +import { JSX } from "preact/jsx-runtime"; + +type ColumnConfiguration = "1/1" | "2/3" | "3/2"; + +interface SideBySideProps extends JSX.HTMLAttributes { + mdColSplit?: ColumnConfiguration; + lgColSplit?: ColumnConfiguration; + reverseOnDesktop?: boolean; +} + +export function SideBySide(props: SideBySideProps) { + let mdSplitClass = "md:grid-cols-2"; + let lgSplitClass = "lg:grid-cols-2"; + + if (props.mdColSplit === "2/3") { + mdSplitClass = "md:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]"; + } else if (props.mdColSplit === "3/2") { + mdSplitClass = "md:grid-cols-[minmax(0,3fr)_minmax(0,2fr)]"; + } + + if (props.lgColSplit === "2/3") { + lgSplitClass = " lg:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]"; + } else if (props.lgColSplit === "3/2") { + lgSplitClass = "lg:grid-cols-[minmax(0,3fr)_minmax(0,2fr)]"; + } + + const swapClass = props.reverseOnDesktop ? "swap-on-mobile" : ""; + + return ( +
*]:order-1" : "" + } ${mdSplitClass} ${lgSplitClass} ${props.class ?? ""}`} + > + {props.children} +
+ ); +} diff --git a/www/components/gallery/Header.tsx b/www/components/gallery/Header.tsx index d4e5142e..02fa97ea 100644 --- a/www/components/gallery/Header.tsx +++ b/www/components/gallery/Header.tsx @@ -7,7 +7,7 @@ type Props = { export default function Header({ active }: Props) { const menus = [ { name: "Home", href: "/" }, - { name: "Components", href: "/components" }, + // { name: "Components", href: "/components" }, { name: "Docs", href: "/docs" }, ]; diff --git a/www/components/homepage/CTA.tsx b/www/components/homepage/CTA.tsx new file mode 100644 index 00000000..0ee77913 --- /dev/null +++ b/www/components/homepage/CTA.tsx @@ -0,0 +1,36 @@ +import { PageSection } from "$fresh/www/components/PageSection.tsx"; +import { FancyLink } from "$fresh/www/components/FancyLink.tsx"; + +export function CTA() { + return ( +
+ +
+ Illustration of a lemon sliced cleanly in half, suspended in midair as though frozen in time the instant after the cut, the juice flung from the edges +

+ Time for a Fresh Start +

+
+

+ Jump right in and build your website with Fresh. Learn everything + you need to know in seconds. +

+ + Get started + +
+
+
+
+ ); +} diff --git a/www/components/homepage/CodeExampleBox.tsx b/www/components/homepage/CodeExampleBox.tsx new file mode 100644 index 00000000..e69de29b diff --git a/www/components/homepage/DemoBox.tsx b/www/components/homepage/DemoBox.tsx new file mode 100644 index 00000000..43f61411 --- /dev/null +++ b/www/components/homepage/DemoBox.tsx @@ -0,0 +1,19 @@ +import { JSX } from "preact"; + +interface DemoBoxProps extends JSX.HTMLAttributes { + flip?: boolean; +} + +export function DemoBox(props: DemoBoxProps) { + const outerFlip = props.flip ? "-skew-y-2 -skew-x-3" : "skew-y-2 skew-x-3"; + const innerFlip = props.flip ? "skew-y-2 skew-x-3" : "-skew-y-2 -skew-x-3"; + return ( +
+
+ {props.children} +
+
+ ); +} diff --git a/www/components/homepage/DenoSection.tsx b/www/components/homepage/DenoSection.tsx new file mode 100644 index 00000000..dae4b933 --- /dev/null +++ b/www/components/homepage/DenoSection.tsx @@ -0,0 +1,34 @@ +import { PageSection } from "$fresh/www/components/PageSection.tsx"; +import { FancyLink } from "$fresh/www/components/FancyLink.tsx"; +import { SideBySide } from "$fresh/www/components/SideBySide.tsx"; +import { SectionHeading } from "$fresh/www/components/homepage/SectionHeading.tsx"; + +export function DenoSection() { + return ( + + + Deno is drinking Fresh lemon squash +
+ + Built on Deno + +

+ Deno is the next evolution of server-side JavaScript, with stronger + security, a robust built-in toolchain, and zero-config TypeScript + support. (It's faster than Node, too.) +

+ + Learn more about Deno + +
+
+
+ ); +} diff --git a/www/components/homepage/ExampleArrow.tsx b/www/components/homepage/ExampleArrow.tsx new file mode 100644 index 00000000..9bb37a0c --- /dev/null +++ b/www/components/homepage/ExampleArrow.tsx @@ -0,0 +1,37 @@ +import { JSX } from "preact"; + +export function ExampleArrow( + props: JSX.HTMLAttributes, +) { + return ( + + + + + + + ); +} diff --git a/www/components/homepage/FormsSection.tsx b/www/components/homepage/FormsSection.tsx new file mode 100644 index 00000000..8043b54c --- /dev/null +++ b/www/components/homepage/FormsSection.tsx @@ -0,0 +1,92 @@ +import { PageSection } from "$fresh/www/components/PageSection.tsx"; +import { SideBySide } from "$fresh/www/components/SideBySide.tsx"; +import { CodeWindow } from "$fresh/www/components/CodeWindow.tsx"; +import { CodeBlock } from "$fresh/www/components/CodeBlock.tsx"; +import { SectionHeading } from "$fresh/www/components/homepage/SectionHeading.tsx"; +import { DemoBox } from "$fresh/www/components/homepage/DemoBox.tsx"; +import { ExampleArrow } from "$fresh/www/components/homepage/ExampleArrow.tsx"; +import { FancyLink } from "$fresh/www/components/FancyLink.tsx"; + +const routingCode = `import { Handlers } from "$fresh/server.ts"; + +export const handler: Handlers = { + async POST(req, ctx) { + const form = await req.formData(); + const email = form.get("email")?.toString(); + + // Save email to database here + + // Redirect user to thank you page. + const headers = new Headers(); + headers.set("location", "/thanks-for-subscribing"); + return new Response(null, { + status: 303, + headers, + }); + }, +};`; + +export function FormsSection() { + return ( + + +
+ + + Forms, the right way + +

+ Don't fight the browser. Fresh helps you handle form submissions and + other dynamic requests server-side, simply and easily. +

+

+ Since Fresh is built on{" "} + Deno, it's built on + web standards. +

+ + Forms in Fresh + +
+
+ + + + { + /* + +

+ TODO: something goes here. +

+
*/ + } +
+
+
+ ); +} diff --git a/www/components/homepage/Hero.tsx b/www/components/homepage/Hero.tsx new file mode 100644 index 00000000..f5953640 --- /dev/null +++ b/www/components/homepage/Hero.tsx @@ -0,0 +1,30 @@ +import { PageSection } from "$fresh/www/components/PageSection.tsx"; +import CopyArea from "../../islands/CopyArea.tsx"; +import { FancyLink } from "$fresh/www/components/FancyLink.tsx"; +import LemonDrop from "$fresh/www/islands/LemonDrop.tsx"; +import LemonTop from "$fresh/www/islands/LemonTop.tsx"; +import LemonBottom from "$fresh/www/islands/LemonBottom.tsx"; + +export function Hero(props: { origin: string }) { + return ( + <> +
+
+
+

+ The simple, approachable, productive web framework +

+
+ Get started + +
+
+
+ +
+
+
+ + + ); +} diff --git a/www/components/homepage/IslandsSection.tsx b/www/components/homepage/IslandsSection.tsx new file mode 100644 index 00000000..2d382bbc --- /dev/null +++ b/www/components/homepage/IslandsSection.tsx @@ -0,0 +1,85 @@ +import Counter from "$fresh/www/islands/Counter.tsx"; +import { CodeBlock } from "$fresh/www/components/CodeBlock.tsx"; +import { CodeWindow } from "$fresh/www/components/CodeWindow.tsx"; +import { PageSection } from "$fresh/www/components/PageSection.tsx"; +import { SideBySide } from "$fresh/www/components/SideBySide.tsx"; +import { SectionHeading } from "$fresh/www/components/homepage/SectionHeading.tsx"; +import { DemoBox } from "$fresh/www/components/homepage/DemoBox.tsx"; +import { ExampleArrow } from "$fresh/www/components/homepage/ExampleArrow.tsx"; +import { FancyLink } from "$fresh/www/components/FancyLink.tsx"; + +const islandCode = `import { useSignal } from "@preact/signals"; + +export default function Counter(props) { + const count = useSignal(props.start); + + return ( +
+

Interactive island

+

The server supplied the initial value of {props.start}.

+
+ +
{count}
+ +
+
+ ); +}`; + +export function IslandsSection() { + return ( + + +
+ + + + + + + + + Island-based architecture +

+ Fresh ships plain HTML to the client, and then hydrates with + JavaScript only where needed. +

+

+ Because it's{" "} + Preact, you + get best-in-class performance, plus the convenience of{" "} + + Signals + . +

+ + Learn more about islands + +
+
+ + + + + + + +
+
+
+ ); +} diff --git a/www/components/homepage/PartialsSection.tsx b/www/components/homepage/PartialsSection.tsx new file mode 100644 index 00000000..4ca330db --- /dev/null +++ b/www/components/homepage/PartialsSection.tsx @@ -0,0 +1,87 @@ +import Counter from "$fresh/www/islands/Counter.tsx"; +import { CodeBlock } from "$fresh/www/components/CodeBlock.tsx"; +import { CodeWindow } from "$fresh/www/components/CodeWindow.tsx"; +import { PageSection } from "$fresh/www/components/PageSection.tsx"; +import { SideBySide } from "$fresh/www/components/SideBySide.tsx"; +import { SectionHeading } from "$fresh/www/components/homepage/SectionHeading.tsx"; +import { DemoBox } from "$fresh/www/components/homepage/DemoBox.tsx"; +import { ExampleArrow } from "$fresh/www/components/homepage/ExampleArrow.tsx"; +import { RecipeDemo } from "$fresh/www/components/homepage/RecipeDemo.tsx"; +import { FancyLink } from "$fresh/www/components/FancyLink.tsx"; + +const islandCode = `import { Partial } from "$fresh/runtime.ts"; + +export const Recipes = () => ( +
+ +
+ + Click a recipe to stream HTML into this spot + +
+
+);`; + +export function PartialsSection() { + return ( + + +
+ + + + + + + + + + + Stream HTML straight from the server +

+ Fresh Partials let you fetch HTML and update only the parts of the + page that need to change, without reloading the entire page. +

+ + Learn more about Partials + +
+
+ + + + + + + +
+
+
+ ); +} diff --git a/www/components/homepage/RecipeDemo.tsx b/www/components/homepage/RecipeDemo.tsx new file mode 100644 index 00000000..ee63ad93 --- /dev/null +++ b/www/components/homepage/RecipeDemo.tsx @@ -0,0 +1,25 @@ +import { Partial } from "$fresh/runtime.ts"; + +export const RecipeDemo = () => ( +
+ +
+ + Click a recipe to stream HTML into this spot + +
+
+); diff --git a/www/components/homepage/RenderingSection.tsx b/www/components/homepage/RenderingSection.tsx new file mode 100644 index 00000000..14b2a7c9 --- /dev/null +++ b/www/components/homepage/RenderingSection.tsx @@ -0,0 +1,66 @@ +import { PageSection } from "$fresh/www/components/PageSection.tsx"; +import { SideBySide } from "$fresh/www/components/SideBySide.tsx"; +import { CodeWindow } from "$fresh/www/components/CodeWindow.tsx"; +import { CodeBlock } from "$fresh/www/components/CodeBlock.tsx"; +import { SectionHeading } from "$fresh/www/components/homepage/SectionHeading.tsx"; +import { DemoBox } from "$fresh/www/components/homepage/DemoBox.tsx"; +import { ExampleArrow } from "$fresh/www/components/homepage/ExampleArrow.tsx"; + +const serverCode = `export default function HomePage() { + const time = new Date().toLocaleString(); + return ( +

Freshly server-rendered {time}

+ ); +}`; + +export function RenderingSection() { + return ( + + +
+ + + + + + + + Build fast apps fast + +

+ Fresh routes are dynamically server-rendered Preact components, so + there's zero JavaScript shipped to the browser by default. +

+

Simple to write; fast to run.

+
+
+ + + + {" "} + +

+ Freshly server-rendered {new Date().toLocaleString("default", { + dateStyle: "medium", + timeStyle: "medium", + })} +

+
+
+
+
+ ); +} diff --git a/www/components/homepage/SectionHeading.tsx b/www/components/homepage/SectionHeading.tsx new file mode 100644 index 00000000..010dcd33 --- /dev/null +++ b/www/components/homepage/SectionHeading.tsx @@ -0,0 +1,11 @@ +import { ComponentChildren } from "preact"; + +export function SectionHeading( + { children }: { children: ComponentChildren }, +) { + return ( +

+ {children} +

+ ); +} diff --git a/www/components/homepage/Simple.tsx b/www/components/homepage/Simple.tsx new file mode 100644 index 00000000..2b67dfcd --- /dev/null +++ b/www/components/homepage/Simple.tsx @@ -0,0 +1,18 @@ +import { PageSection } from "$fresh/www/components/PageSection.tsx"; + +export function Simple() { + return ( + +
+

Introducing Fresh:

+

+ The framework so simple, you already know it. +

+

+ Fresh is designed to be easy to use by building on the best well-known + tools, conventions, and web standards. +

+
+
+ ); +} diff --git a/www/components/homepage/SocialProof.tsx b/www/components/homepage/SocialProof.tsx new file mode 100644 index 00000000..5c16d279 --- /dev/null +++ b/www/components/homepage/SocialProof.tsx @@ -0,0 +1,55 @@ +import { PageSection } from "$fresh/www/components/PageSection.tsx"; +import { FancyLink } from "$fresh/www/components/FancyLink.tsx"; +import { DemoBox } from "$fresh/www/components/homepage/DemoBox.tsx"; + +export function SocialProof() { + return ( + +
+

+ Built for the edge +

+

+ Fresh is the secret sauce behind production-grade, enterprise-ready + software like{" "} + Deco.cx, Brazil's top + eCommerce platform +

+
+ + Deco CX + +
+ +
+ + “ + The team also used{" "} + Fresh, a next-gen Deno-native full stack web framework that + sends zero JavaScript to the client, for its modern developer + experience and snappy performance…
+
This stack unlocked{" "} + + 5x faster page load speeds and a 30% jump in conversion rates + {" "} + for their + clients. + ” + +
+
+ + Read the case study + +
+
+ ); +} diff --git a/www/deno.json b/www/deno.json index 9b666e08..049f9337 100644 --- a/www/deno.json +++ b/www/deno.json @@ -12,6 +12,8 @@ "preact/": "https://esm.sh/preact@10.19.6/", "@preact/signals": "https://esm.sh/*@preact/signals@1.2.2", "@preact/signals-core": "https://esm.sh/@preact/signals-core@1.5.1", + "$prism": "https://esm.sh/prismjs@1.29.0", + "$prism/": "https://esm.sh/prismjs@1.29.0/", "$std/": "https://deno.land/std@0.216.0/", "$ga4": "https://raw.githubusercontent.com/denoland/ga4/main/mod.ts", "$marked-mangle": "https://esm.sh/marked-mangle@1.1.7", diff --git a/www/fresh.gen.ts b/www/fresh.gen.ts index d21afd00..8df47f1f 100644 --- a/www/fresh.gen.ts +++ b/www/fresh.gen.ts @@ -6,18 +6,23 @@ import * as $_404 from "./routes/_404.tsx"; import * as $_500 from "./routes/_500.tsx"; import * as $_app from "./routes/_app.tsx"; import * as $_middleware from "./routes/_middleware.ts"; -import * as $components from "./routes/components.tsx"; import * as $docs_slug_ from "./routes/docs/[...slug].tsx"; import * as $docs_middleware from "./routes/docs/_middleware.ts"; import * as $docs_index from "./routes/docs/index.tsx"; import * as $index from "./routes/index.tsx"; import * as $raw from "./routes/raw.ts"; +import * as $recipes_layout from "./routes/recipes/_layout.tsx"; +import * as $recipes_lemon_honey_tea from "./routes/recipes/lemon-honey-tea.tsx"; +import * as $recipes_lemonade from "./routes/recipes/lemonade.tsx"; +import * as $recipes_lemondrop from "./routes/recipes/lemondrop.tsx"; import * as $showcase from "./routes/showcase.tsx"; import * as $update from "./routes/update.tsx"; import * as $ComponentGallery from "./islands/ComponentGallery.tsx"; import * as $CopyArea from "./islands/CopyArea.tsx"; import * as $Counter from "./islands/Counter.tsx"; +import * as $LemonBottom from "./islands/LemonBottom.tsx"; import * as $LemonDrop from "./islands/LemonDrop.tsx"; +import * as $LemonTop from "./islands/LemonTop.tsx"; import * as $SearchButton from "./islands/SearchButton.tsx"; import * as $TableOfContents from "./islands/TableOfContents.tsx"; import * as $VersionSelect from "./islands/VersionSelect.tsx"; @@ -29,12 +34,15 @@ const manifest = { "./routes/_500.tsx": $_500, "./routes/_app.tsx": $_app, "./routes/_middleware.ts": $_middleware, - "./routes/components.tsx": $components, "./routes/docs/[...slug].tsx": $docs_slug_, "./routes/docs/_middleware.ts": $docs_middleware, "./routes/docs/index.tsx": $docs_index, "./routes/index.tsx": $index, "./routes/raw.ts": $raw, + "./routes/recipes/_layout.tsx": $recipes_layout, + "./routes/recipes/lemon-honey-tea.tsx": $recipes_lemon_honey_tea, + "./routes/recipes/lemonade.tsx": $recipes_lemonade, + "./routes/recipes/lemondrop.tsx": $recipes_lemondrop, "./routes/showcase.tsx": $showcase, "./routes/update.tsx": $update, }, @@ -42,7 +50,9 @@ const manifest = { "./islands/ComponentGallery.tsx": $ComponentGallery, "./islands/CopyArea.tsx": $CopyArea, "./islands/Counter.tsx": $Counter, + "./islands/LemonBottom.tsx": $LemonBottom, "./islands/LemonDrop.tsx": $LemonDrop, + "./islands/LemonTop.tsx": $LemonTop, "./islands/SearchButton.tsx": $SearchButton, "./islands/TableOfContents.tsx": $TableOfContents, "./islands/VersionSelect.tsx": $VersionSelect, diff --git a/www/islands/CopyArea.tsx b/www/islands/CopyArea.tsx index c2f28c20..435d71f1 100644 --- a/www/islands/CopyArea.tsx +++ b/www/islands/CopyArea.tsx @@ -26,17 +26,17 @@ export default function CopyArea(props: { code: string }) { } const timer = setTimeout(() => { copied.value = false; - }, 2000); + }, 1000); return () => clearTimeout(timer); }, [copied.value]); return ( -
-
+    
+
         {props.code}
       
-
+
-

- This area is interactive +
+

+ Interactive island

-

+

The server supplied the initial value of 3.

count.value -= 1} - disabled={!IS_BROWSER || count.value <= 0} > @@ -39,7 +34,6 @@ export default function Counter(props: CounterProps) { count.value += 1} - disabled={!IS_BROWSER} > @@ -47,3 +41,15 @@ export default function Counter(props: CounterProps) {
); } + +function RoundedButton(props: JSX.HTMLAttributes) { + return ( +