diff --git a/deno.jsonc b/deno.jsonc index 54a8134d..cf82765a 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -2,7 +2,8 @@ "tasks": { "test": "deno test -A && deno check --config=www/deno.json www/main.ts www/dev.ts && deno check init.ts", "fixture": "deno run -A --watch=static/,routes/ tests/fixture/dev.ts", - "www": "deno run -A --watch=static/,routes/ www/dev.ts" + "www": "deno run -A --watch=static/,routes/ www/dev.ts", + "screenshot": "deno run -A www/utils/screenshot.ts" }, "importMap": "./tests/fixture/import_map.json" } diff --git a/www/components/FeatureIcons.tsx b/www/components/FeatureIcons.tsx new file mode 100644 index 00000000..976e2db7 --- /dev/null +++ b/www/components/FeatureIcons.tsx @@ -0,0 +1,253 @@ +/** @jsx h */ +import { h } from "preact"; + +export function NoBuild() { + return ( + + ); +} + +export function TypeScript() { + return ( + + ); +} + +export function Island() { + return ( + + ); +} + +// from https://heroicons.com/ +export function Globe() { + return ( + + ); +} + +export function LightWeight() { + return ( + + ); +} + +export function Gabage() { + return ( + + ); +} diff --git a/www/components/Icons.tsx b/www/components/Icons.tsx index 14a5f27c..a5fc9f87 100644 --- a/www/components/Icons.tsx +++ b/www/components/Icons.tsx @@ -57,3 +57,75 @@ export function Leaf() { ); } + +export function Copy() { + return ( + + ); +} + +// from https://heroicons.com/ +export function Check() { + return ( + + ); +} + +// from https://heroicons.com/ +export function Info() { + return ( + + ); +} + +export function GitHub(props: { class?: string }) { + return ( + + ); +} diff --git a/www/data/showcase.json b/www/data/showcase.json new file mode 100644 index 00000000..f671c4e7 --- /dev/null +++ b/www/data/showcase.json @@ -0,0 +1,20 @@ +[ + { + "title": "Deno Merch", + "link": "https://merch.deno.com/", + "github": "denoland/merch", + "image": "merch" + }, + { + "title": "Deno Chat", + "link": "https://showcase-chat.deno.dev/", + "github": "denoland/showcase_chat", + "image": "chat" + }, + { + "title": "Fresh Website", + "link": "https://fresh.deno.dev/", + "github": "denoland/fresh/tree/main/www", + "image": "fresh" + } +] diff --git a/www/fresh.gen.ts b/www/fresh.gen.ts index dace9fbb..87a7d2d0 100644 --- a/www/fresh.gen.ts +++ b/www/fresh.gen.ts @@ -6,8 +6,9 @@ import * as $0 from "./routes/docs/[...slug].tsx"; import * as $1 from "./routes/gfm.css.ts"; import * as $2 from "./routes/index.tsx"; import * as $3 from "./routes/raw.ts"; -import * as $$0 from "./islands/Counter.tsx"; -import * as $$1 from "./islands/LemonDrop.tsx"; +import * as $$0 from "./islands/CopyArea.tsx"; +import * as $$1 from "./islands/Counter.tsx"; +import * as $$2 from "./islands/LemonDrop.tsx"; const manifest = { routes: { @@ -17,8 +18,9 @@ const manifest = { "./routes/raw.ts": $3, }, islands: { - "./islands/Counter.tsx": $$0, - "./islands/LemonDrop.tsx": $$1, + "./islands/CopyArea.tsx": $$0, + "./islands/Counter.tsx": $$1, + "./islands/LemonDrop.tsx": $$2, }, baseUrl: import.meta.url, }; diff --git a/www/islands/CopyArea.tsx b/www/islands/CopyArea.tsx new file mode 100644 index 00000000..cd7c0cb8 --- /dev/null +++ b/www/islands/CopyArea.tsx @@ -0,0 +1,60 @@ +/** @jsx h */ +import { ComponentChildren, h } from "preact"; +import { useEffect, useState } from "preact/hooks"; +import { IS_BROWSER } from "$fresh/runtime.ts"; +import * as Icons from "../components/Icons.tsx"; + +export default function CopyArea(props: { children: ComponentChildren }) { + const [copied, setCopied] = useState(false); + + async function handleClick() { + if (props.children === undefined || props.children === null) { + return; + } + try { + await navigator.clipboard.writeText(props.children.toString()); + setCopied(true); + } catch (error) { + setCopied(false); + console.error((error && error.message) || "Copy failed"); + } + } + + useEffect(() => { + if (!copied) { + return; + } + const timer = setTimeout(() => { + setCopied(false); + }, 2000); + return () => clearTimeout(timer); + }, [copied]); + + return ( +
+ {props.children}
+
+
+ + Built for speed, reliability, and simplicity. +
+- Fresh is a next generation web framework, built for speed, reliability, - and simplicity. Some stand out features: -
- -
Fresh embraces the tried and true design of server side rendering and
progressive enhancement on the client side.
@@ -141,32 +173,51 @@ function Intro() {
function GettingStarted(props: { origin: string }) {
return (
-
+
+ Deno CLI
+ {" "}
+ version 1.23.0 or higher is required.{" "}
+
+ Install
+ {" "}
+ or{" "}
+
+ update
+ .
+
- To get started, make sure you have the{" "}
-
- Deno CLI
- {" "}
- version 1.23.0 or higher installed.
+ To bootstrap a new project:
- Then you can use the Fresh init script to bootstrap a new project:
-
Enter the newly created project directory and run the following command
to start the development server:
You can now open{" "}
- A more in-depth getting started guide is available in{" "}
+ A more in-depth{" "}
+
+ Getting Started
+ {" "}
+ guide is available in{" "}
the docs.
+ Below is a selection of projects that have been built with Fresh.{" "}
+
+ Add yours!
+
+
+
- Getting started
+ Getting Started
+
+
+
+
+
- deno task start
-
+
+
+
Example
@@ -215,3 +273,56 @@ function Example() {
+
+ Showcase
+
+
+
+
+