www: landing page redesign (#1279)
This commit is contained in:
+36
-10
@@ -1,3 +1,5 @@
|
|||||||
|
import * as Icons from "./Icons.tsx";
|
||||||
|
|
||||||
const LINKS = [
|
const LINKS = [
|
||||||
{
|
{
|
||||||
title: "Source",
|
title: "Source",
|
||||||
@@ -15,16 +17,40 @@ const LINKS = [
|
|||||||
|
|
||||||
export default function Footer() {
|
export default function Footer() {
|
||||||
return (
|
return (
|
||||||
<footer class="border(t-2 gray-200) bg-gray-100 h-32 flex flex-col gap-4 justify-center">
|
<footer class="border-t-2 border-gray-200 bg-gray-100 md:h-16 flex gap-4 justify-center">
|
||||||
<div class="mx-auto max-w-screen-lg flex items-center justify-center gap-8">
|
<div class="flex flex-col sm:flex-row gap-4 justify-between items-center max-w-screen-xl mx-auto w-full px(4 sm:6 md:8) p-4">
|
||||||
{LINKS.map((link) => (
|
<div class="text(gray-600 center)">
|
||||||
<a href={link.href} class="text-gray-600 hover:underline">
|
<span>© {new Date().getFullYear()} the fresh authors</span>
|
||||||
{link.title}
|
</div>
|
||||||
</a>
|
|
||||||
))}
|
<div class="flex items-center gap-8">
|
||||||
</div>
|
{LINKS.map((link) => (
|
||||||
<div class="text(gray-600 center)">
|
<a href={link.href} class="text-gray-600 hover:underline">
|
||||||
<span>© {new Date().getFullYear()} the fresh authors</span>
|
{link.title}
|
||||||
|
</a>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class="flex justify-center items-center gap-4 md:ml-4 mt-2 mb-4 sm:mt-0 sm:mb-0 flex-wrap">
|
||||||
|
<li class="flex items-center">
|
||||||
|
<a
|
||||||
|
href="https://github.com/denoland/fresh"
|
||||||
|
class="hover:text-green-600 inline-block transition"
|
||||||
|
aria-label="GitHub"
|
||||||
|
>
|
||||||
|
<Icons.GitHub />
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="flex items-center">
|
||||||
|
<a
|
||||||
|
href="https://discord.com/invite/deno"
|
||||||
|
class="hover:text-green-600 inline-block transition"
|
||||||
|
aria-label="Discord"
|
||||||
|
>
|
||||||
|
<Icons.Discord />
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export default function NavigationBar(
|
|||||||
<li class="flex items-center">
|
<li class="flex items-center">
|
||||||
<a
|
<a
|
||||||
href="https://github.com/denoland/fresh"
|
href="https://github.com/denoland/fresh"
|
||||||
class="hover:text-green-600 inline-block"
|
class="hover:text-green-600 inline-block transition"
|
||||||
aria-label="GitHub"
|
aria-label="GitHub"
|
||||||
>
|
>
|
||||||
<Icons.GitHub />
|
<Icons.GitHub />
|
||||||
@@ -52,7 +52,7 @@ export default function NavigationBar(
|
|||||||
<li class="flex items-center">
|
<li class="flex items-center">
|
||||||
<a
|
<a
|
||||||
href="https://discord.com/invite/deno"
|
href="https://discord.com/invite/deno"
|
||||||
class="hover:text-green-600 inline-block"
|
class="hover:text-green-600 inline-block transition"
|
||||||
aria-label="Discord"
|
aria-label="Discord"
|
||||||
>
|
>
|
||||||
<Icons.Discord />
|
<Icons.Discord />
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ interface ProjectProps {
|
|||||||
export default function Projects(props: ProjectProps) {
|
export default function Projects(props: ProjectProps) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
class={`pt-8 grid grid-cols-1 md:grid-cols-3 items-center ${
|
class={`pt-8 grid grid-cols-1 sm:grid-cols-3 items-center ${
|
||||||
props.class ?? ""
|
props.class ?? ""
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
@@ -42,7 +42,7 @@ export default function Projects(props: ProjectProps) {
|
|||||||
class="ml-2 text-gray-500 hover:text-gray-700"
|
class="ml-2 text-gray-500 hover:text-gray-700"
|
||||||
>
|
>
|
||||||
<span class="sr-only">GitHub</span>
|
<span class="sr-only">GitHub</span>
|
||||||
<Icons.GitHub class="inline float-right" />
|
<Icons.GitHub class="inline float-right h-6 w-6" />
|
||||||
</a>
|
</a>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export default function CopyArea(props: { code: string }) {
|
|||||||
}, [copied.value]);
|
}, [copied.value]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class="bg(gray-800) rounded text-white flex items-center">
|
<div class="bg(gray-800) rounded text-white flex items-center min-w-0">
|
||||||
<pre class="overflow-x-auto flex-1 py-2 px-4">
|
<pre class="overflow-x-auto flex-1 py-2 px-4">
|
||||||
{props.code}
|
{props.code}
|
||||||
</pre>
|
</pre>
|
||||||
|
|||||||
+34
-16
@@ -1,7 +1,7 @@
|
|||||||
import { useSignal } from "@preact/signals";
|
import { useSignal } from "@preact/signals";
|
||||||
import { IS_BROWSER } from "$fresh/runtime.ts";
|
import { IS_BROWSER } from "$fresh/runtime.ts";
|
||||||
import { RoundedButton } from "../components/Button.tsx";
|
import { RoundedButton } from "../components/Button.tsx";
|
||||||
import { IconMinus, IconPlus } from "../components/Icons.tsx";
|
import * as Icons from "../components/Icons.tsx";
|
||||||
|
|
||||||
interface CounterProps {
|
interface CounterProps {
|
||||||
start: number;
|
start: number;
|
||||||
@@ -9,23 +9,41 @@ interface CounterProps {
|
|||||||
|
|
||||||
export default function Counter(props: CounterProps) {
|
export default function Counter(props: CounterProps) {
|
||||||
const count = useSignal(props.start);
|
const count = useSignal(props.start);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class="bg-gray-100 p-4 border border-gray-200 flex items-center justify-around">
|
<div
|
||||||
<RoundedButton
|
class="bg-green-100 p-8 border-8 border-green-300 text-center"
|
||||||
title="Subtract 1"
|
style="border-radius: 1rem"
|
||||||
onClick={() => count.value -= 1}
|
>
|
||||||
disabled={!IS_BROWSER || count.value <= 0}
|
<h3 class="green-300 text-2xl font-bold text-green-700">
|
||||||
|
This area is interactive
|
||||||
|
</h3>
|
||||||
|
<p class="text-gray-600">
|
||||||
|
The server supplied the initial value of 3.
|
||||||
|
</p>
|
||||||
|
<div
|
||||||
|
class="flex justify-between items-center mt-4 mx-auto"
|
||||||
|
style="max-width: 20rem"
|
||||||
>
|
>
|
||||||
<IconMinus />
|
<RoundedButton
|
||||||
</RoundedButton>
|
title="Subtract 1"
|
||||||
<div class="text-3xl tabular-nums">{count}</div>
|
onClick={() => count.value -= 1}
|
||||||
<RoundedButton
|
disabled={!IS_BROWSER || count.value <= 0}
|
||||||
title="Add 1"
|
>
|
||||||
onClick={() => count.value += 1}
|
<Icons.IconMinus />
|
||||||
disabled={!IS_BROWSER}
|
</RoundedButton>
|
||||||
>
|
<div class="text-6xl tabular-nums font-bold">
|
||||||
<IconPlus />
|
{count}
|
||||||
</RoundedButton>
|
</div>
|
||||||
|
|
||||||
|
<RoundedButton
|
||||||
|
title="Add 1"
|
||||||
|
onClick={() => count.value += 1}
|
||||||
|
disabled={!IS_BROWSER}
|
||||||
|
>
|
||||||
|
<Icons.IconPlus />
|
||||||
|
</RoundedButton>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+85
-127
@@ -61,10 +61,10 @@ export default function MainPage(props: PageProps) {
|
|||||||
<Hero />
|
<Hero />
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<Intro />
|
<Intro origin={origin} />
|
||||||
<GettingStarted origin={origin} />
|
|
||||||
<Example />
|
<Example />
|
||||||
<Showcase />
|
<Showcase />
|
||||||
|
<StartJourney />
|
||||||
</div>
|
</div>
|
||||||
<Footer />
|
<Footer />
|
||||||
</div>
|
</div>
|
||||||
@@ -96,11 +96,11 @@ function Hero() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Features() {
|
function Features() {
|
||||||
const item = "flex md:flex-col items-center gap-5";
|
const item = "flex items-center gap-5";
|
||||||
const desc = "flex-1 md:text-center";
|
const desc = "flex-1";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class="grid md:grid-cols-3 gap-6 md:gap-14">
|
<div class="grid md:grid-cols-2 lg:grid-cols-3 gap-6 md:gap-14">
|
||||||
<div class={item}>
|
<div class={item}>
|
||||||
<FeatureIcons.Globe />
|
<FeatureIcons.Globe />
|
||||||
<div class={desc}>
|
<div class={desc}>
|
||||||
@@ -147,146 +147,82 @@ function Features() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Intro() {
|
function Intro(props: { origin: string }) {
|
||||||
return (
|
return (
|
||||||
<section class="max-w-screen-md mx-auto my-16 px(4 sm:6 md:8) space-y-12">
|
<section class="max-w-screen-xl mx-auto my-8 sm:my-16 px(4 sm:6 md:8) space-y-8 sm:space-y-16 lg:mb-32">
|
||||||
<div class="md:flex items-center">
|
<div class="max-w-screen-xl mx-auto sm:my-8 md:my-16 sm:space-y-12 w-full">
|
||||||
<div class="flex-1 text-center md:text-left">
|
<div class="md:flex items-center">
|
||||||
<h2 class="py-2 text(5xl sm:5xl lg:5xl gray-900) sm:tracking-tight sm:leading-[1.1]! font-extrabold">
|
<div class="flex-1 text-center md:text-left">
|
||||||
The <span class="text-green-600">next-gen</span> web framework.
|
<h2 class="py-2 text(5xl sm:5xl lg:6xl gray-900) sm:tracking-tight sm:leading-[1.1]! font-extrabold lg:max-w-lg mx-auto sm:mx-0">
|
||||||
</h2>
|
The <span class="text-green-600">next-gen</span> web framework.
|
||||||
|
</h2>
|
||||||
|
|
||||||
<p class="mt-4 text-gray-600">
|
<p class="mt-2 text-gray-600 text-xl">
|
||||||
Built for speed, reliability, and simplicity.
|
Built for speed, reliability, and simplicity.
|
||||||
</p>
|
</p>
|
||||||
|
<div class="mt-8 flex flex-col justify-center md:justify-start sm:flex-row gap-4">
|
||||||
|
<div>
|
||||||
|
<a
|
||||||
|
href="/docs/getting-started"
|
||||||
|
class="inline-flex w-auto shrink-0 px-3 py-2 bg-white rounded border(gray-500 2) hover:bg-gray-200 active:bg-gray-300 disabled:(opacity-50 cursor-not-allowed) whitespace-nowrap"
|
||||||
|
>
|
||||||
|
Get started
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="flex justify-center">
|
||||||
|
<CopyArea code={`deno run -A -r ${props.origin}`} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<picture class="block mt-8 md:mt-0 mx-auto w-60 md:w-96 md:mr-16 xl:mr-32">
|
||||||
|
<img
|
||||||
|
src="/illustration/lemon-squash.svg"
|
||||||
|
width={800}
|
||||||
|
height={678}
|
||||||
|
alt="deno is drinking fresh lemon squash"
|
||||||
|
/>
|
||||||
|
</picture>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<picture class="block mt-4 md:mt-0">
|
|
||||||
<img
|
|
||||||
src="/illustration/lemon-squash.svg"
|
|
||||||
class="w-80 mx-auto"
|
|
||||||
width={800}
|
|
||||||
height={678}
|
|
||||||
alt="deno is drinking fresh lemon squash"
|
|
||||||
/>
|
|
||||||
</picture>
|
|
||||||
</div>
|
</div>
|
||||||
|
<p class="text-gray-600 text-xl">
|
||||||
<Features />
|
|
||||||
|
|
||||||
<p class="text-gray-600">
|
|
||||||
Fresh embraces the tried and true design of server side rendering and
|
Fresh embraces the tried and true design of server side rendering and
|
||||||
progressive enhancement on the client side.
|
progressive enhancement on the client side.
|
||||||
</p>
|
</p>
|
||||||
|
<Features />
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function GettingStarted(props: { origin: string }) {
|
|
||||||
return (
|
|
||||||
<section class="max-w-screen-md mx-auto my-16 px(4 sm:6 md:8) space-y-4">
|
|
||||||
<h2 id="getting-started" class="text(3xl gray-600) font-bold">
|
|
||||||
<a href="#getting-started" class="hover:underline">
|
|
||||||
Getting Started
|
|
||||||
</a>
|
|
||||||
</h2>
|
|
||||||
<div class="text-gray-600 flex gap-1 mb-4 bg-gray-100 p-2 rounded">
|
|
||||||
<div class="text-gray-400">
|
|
||||||
<Icons.Info />
|
|
||||||
</div>
|
|
||||||
<p>
|
|
||||||
<a href="https://deno.land" class="text-blue-600 hover:underline">
|
|
||||||
Deno CLI
|
|
||||||
</a>{" "}
|
|
||||||
version 1.31.0 or higher is required.{" "}
|
|
||||||
<a
|
|
||||||
href="https://deno.land/manual/getting_started/installation"
|
|
||||||
class="text-blue-600 hover:underline"
|
|
||||||
>
|
|
||||||
Install
|
|
||||||
</a>{" "}
|
|
||||||
or{" "}
|
|
||||||
<a
|
|
||||||
href="https://deno.land/manual/getting_started/installation#updating"
|
|
||||||
class="text-blue-600 hover:underline"
|
|
||||||
>
|
|
||||||
update
|
|
||||||
</a>.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<p class="text-gray-600">
|
|
||||||
To bootstrap a new project:
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<CopyArea code={`deno run -A -r ${props.origin}`} />
|
|
||||||
|
|
||||||
<p class="text-gray-600">
|
|
||||||
Enter the newly created project directory and run the following command
|
|
||||||
to start the development server:
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<CopyArea code={`deno task start`} />
|
|
||||||
|
|
||||||
<p class="text-gray-600">
|
|
||||||
You can now open{" "}
|
|
||||||
<a
|
|
||||||
href="http://localhost:8000"
|
|
||||||
class="text-blue-600 hover:underline"
|
|
||||||
>
|
|
||||||
http://localhost:8000
|
|
||||||
</a>{" "}
|
|
||||||
in your browser to view the page.
|
|
||||||
</p>
|
|
||||||
<p class="text-gray-600">
|
|
||||||
A more in-depth{" "}
|
|
||||||
<a
|
|
||||||
href="/docs/getting-started"
|
|
||||||
class="text-blue-600 hover:underline"
|
|
||||||
>
|
|
||||||
<i>Getting Started</i>
|
|
||||||
</a>{" "}
|
|
||||||
guide is available in{" "}
|
|
||||||
<a href="/docs" class="text-blue-600 hover:underline">the docs</a>.
|
|
||||||
</p>
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const timeFmt = new Intl.DateTimeFormat("en-US", {
|
|
||||||
timeStyle: "long",
|
|
||||||
hour12: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
function Example() {
|
function Example() {
|
||||||
return (
|
return (
|
||||||
<section class="max-w-screen-md mx-auto my-16 px(4 sm:6 md:8) space-y-4">
|
<section class="max-w-screen-xl mx-auto my-8 sm:my-16 md:my-24 px(4 sm:6 md:8) space-y-16">
|
||||||
<h2 id="example" class="text(3xl gray-600) font-bold">
|
<div class="flex gap-4 md:gap-16 flex-col md:flex-row justify-between items-center">
|
||||||
<a href="#example" class="hover:underline">
|
<div class="md:basis-1/2">
|
||||||
Example
|
<h2 id="example" class="text(4xl gray-600) font-bold mb-4">
|
||||||
</a>
|
<a href="#example" class="hover:underline">
|
||||||
</h2>
|
Interactive islands
|
||||||
<p class="text-gray-600">
|
</a>
|
||||||
This text is being server side rendered on the fly. It was rendered at
|
</h2>
|
||||||
{" "}
|
<p class="text-gray-600 mb-4">
|
||||||
{timeFmt.format(new Date())}.
|
Fresh optimizes the page by only shipping JavaScript for areas that
|
||||||
</p>
|
need it. The rest is completely static HTML rendered by the server.
|
||||||
<p class="text-gray-600">
|
This means browser need to load less code and can display your page
|
||||||
The counter below was rendered on the server with a starting value of 3,
|
quicker.
|
||||||
and was then hydrated on the client to provide interactivity. Try out
|
</p>
|
||||||
the buttons!
|
</div>
|
||||||
</p>
|
<div class="md:basis-1/2">
|
||||||
<Counter start={3} />
|
<Counter start={3} />
|
||||||
<p class="text-gray-600">
|
</div>
|
||||||
Only the JS required to render that counter is sent to the client.
|
</div>
|
||||||
</p>
|
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Showcase() {
|
function Showcase() {
|
||||||
return (
|
return (
|
||||||
<section class="max-w-screen-md mx-auto my-16 px(4 sm:6 md:8) space-y-4">
|
<section class="max-w-screen-xl mx-auto space-y-16 px(4 sm:6 md:8) space-y-4">
|
||||||
<h2 id="showcase" class="text(3xl gray-600) font-bold">
|
<h2 id="showcase" class="text(4xl gray-600) font-bold mb-4">
|
||||||
<a href="#showcase" class="hover:underline">
|
<a href="#showcase" class="hover:underline">
|
||||||
Showcase
|
Showcase
|
||||||
</a>
|
</a>
|
||||||
@@ -295,7 +231,7 @@ function Showcase() {
|
|||||||
Below is a selection of projects that have been built with Fresh.
|
Below is a selection of projects that have been built with Fresh.
|
||||||
</p>
|
</p>
|
||||||
<Projects items={projects.slice(0, 3)} class="gap-8" />
|
<Projects items={projects.slice(0, 3)} class="gap-8" />
|
||||||
<div class="flex gap-2 items-center justify-end text-blue-600">
|
<div class="flex gap-2 items-center justify-center sm:justify-end text-blue-600">
|
||||||
<Icons.ArrowRight />
|
<Icons.ArrowRight />
|
||||||
<a href="./showcase" class="hover:underline focus:underline">
|
<a href="./showcase" class="hover:underline focus:underline">
|
||||||
View more
|
View more
|
||||||
@@ -304,3 +240,25 @@ function Showcase() {
|
|||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function StartJourney() {
|
||||||
|
return (
|
||||||
|
<section class="max-w-screen-xl mx-auto py-16 px(4 sm:6 md:8) space-y-4 md:mb-16">
|
||||||
|
<h2 class="text(4xl gray-600) md:text-5xl font mb-4 mt-0">
|
||||||
|
Start your Fresh journey
|
||||||
|
</h2>
|
||||||
|
<div class="flex flex-col md:flex-row justify-start items-center gap-4">
|
||||||
|
<p class="text(xl gray-600)">
|
||||||
|
Jump right in and build your website with fresh. Lean everything you
|
||||||
|
need to know in seconds.
|
||||||
|
</p>
|
||||||
|
<a
|
||||||
|
href="/docs/getting-started"
|
||||||
|
class="inline-block px-3 py-2 bg-white rounded border(gray-500 2) hover:bg-gray-200 active:bg-gray-300 disabled:(opacity-50 cursor-not-allowed) whitespace-nowrap"
|
||||||
|
>
|
||||||
|
Get started
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,4 +14,20 @@ export default {
|
|||||||
transparent: "transparent",
|
transparent: "transparent",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
plugins: {
|
||||||
|
// Basic workaround for old twind version not supporting
|
||||||
|
// the `basis-*` keyword
|
||||||
|
"basis": (parts) => {
|
||||||
|
let value;
|
||||||
|
const arr = parts[0].split("/");
|
||||||
|
if (arr.length === 2) {
|
||||||
|
value = `${(+arr[0] / +arr[1]) * 100}%`;
|
||||||
|
} else if (parts.length === 1) {
|
||||||
|
value = parts[0];
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
"flex-basis": value,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
} as Options;
|
} as Options;
|
||||||
|
|||||||
Reference in New Issue
Block a user