Skip to content

Open-source status page, incident response and uptime monitoring

wip: landing page design

mxkaskef277999dca0a
diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs
index 2ba612cc7..0a8ed67d4 100644
--- a/apps/web/next.config.mjs
+++ b/apps/web/next.config.mjs
@@ -4,6 +4,9 @@ import "./src/env.mjs";
const nextConfig = {
reactStrictMode: true,
transpilePackages: ["ui"],
+ experimental: {
+ serverActions: true,
+ },
};
-export default nextConfig;
\ No newline at end of file
+export default nextConfig;
diff --git a/apps/web/package.json b/apps/web/package.json
index 5417872a0..c0b4b2d30 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -15,6 +15,7 @@
"class-variance-authority": "^0.6.0",
"clsx": "^1.2.1",
"lucide-react": "^0.244.0",
+ "next-plausible": "3.7.2",
"next": "13.4.6",
"react": "18.2.0",
"react-dom": "18.2.0",
diff --git a/apps/web/src/app/action.ts b/apps/web/src/app/action.ts
new file mode 100644
index 000000000..6f20043e1
--- /dev/null
+++ b/apps/web/src/app/action.ts
@@ -0,0 +1,18 @@
+"use server";
+
+export async function waitlist(data: FormData) {
+ const email = data.get("email");
+ if (email) {
+ await wait(3000);
+ // TODO: save email to Highstorm
+ }
+ return;
+}
+
+const wait = (ms: number): Promise<void> => {
+ return new Promise((resolve) => {
+ setTimeout(() => {
+ resolve();
+ }, ms);
+ });
+};
diff --git a/apps/web/src/app/components/background.tsx b/apps/web/src/app/components/background.tsx
new file mode 100644
index 000000000..48db1a6e6
--- /dev/null
+++ b/apps/web/src/app/components/background.tsx
@@ -0,0 +1,58 @@
+"use client";
+import React from "react";
+
+export default function Background({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ React.useEffect(() => {
+ function mouseMoveEvent(e: MouseEvent) {
+ const body = document.body;
+
+ const targetX = e.clientX;
+ const targetY = e.clientY;
+
+ body.style.setProperty("--x", `${targetX}px`);
+ body.style.setProperty("--y", `${targetY}px`);
+ }
+
+ document.addEventListener("mousemove", mouseMoveEvent);
+ return () => document.removeEventListener("mousemove", mouseMoveEvent);
+ }, []);
+
+ return (
+ <>
+ <div className="absolute inset-0 z-[-1]">
+ <div className="absolute inset-0 z-[-1] bg-muted-foreground/20" />
+ <div
+ className="absolute z-[-1] h-56 w-56 rounded-full -translate-y-1/2 -translate-x-1/2 bg-gradient-radial from-muted-foreground/70 from-0% to-transparent to-90% blur-md"
+ style={{ left: "var(--x)", top: "var(--y)" }}
+ />
+ <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
+ <defs>
+ <pattern
+ id="dotted-pattern"
+ width="16"
+ height="16"
+ patternUnits="userSpaceOnUse"
+ >
+ <circle cx="2" cy="2" r="1" fill="black" />
+ </pattern>
+ <mask id="dots-mask">
+ <rect width="100%" height="100%" fill="white" />
+ <rect width="100%" height="100%" fill="url(#dotted-pattern)" />
+ </mask>
+ </defs>
+ <rect
+ width="100%"
+ height="100%"
+ fill="hsl(var(--background))"
+ mask="url(#dots-mask)"
+ />
+ </svg>
+ </div>
+ {children}
+ </>
+ );
+}
diff --git a/apps/web/src/app/components/submit-button.tsx b/apps/web/src/app/components/submit-button.tsx
new file mode 100644
index 000000000..ecce507df
--- /dev/null
+++ b/apps/web/src/app/components/submit-button.tsx
@@ -0,0 +1,25 @@
+"use client";
+
+import { Button } from "@/components/ui/button";
+import { experimental_useFormStatus as useFormStatus } from "react-dom";
+
+export function SubmitButton() {
+ const { pending } = useFormStatus();
+ return (
+ <Button
+ type="submit"
+ disabled={pending}
+ className="w-20 disabled:opacity-100"
+ >
+ {pending ? (
+ <div className="flex items-center justify-center gap-1">
+ <div className="h-1 w-1 animate-pulse direction-alternate duration-700 rounded-full bg-primary-foreground" />
+ <div className="h-1 w-1 animate-pulse direction-alternate duration-700 delay-150 rounded-full bg-primary-foreground" />
+ <div className="h-1 w-1 animate-pulse direction-alternate duration-700 delay-300 rounded-full bg-primary-foreground" />
+ </div>
+ ) : (
+ "Join"
+ )}
+ </Button>
+ );
+}
diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx
index fd0051eab..edc90f958 100644
--- a/apps/web/src/app/layout.tsx
+++ b/apps/web/src/app/layout.tsx
@@ -3,6 +3,9 @@ import { ClerkProvider } from "@clerk/nextjs";
import { Inter } from "next/font/google";
import LocalFont from "next/font/local";
+import PlausibleProvider from "next-plausible";
+import Background from "./components/background";
+
const inter = Inter({ subsets: ["latin"] });
const calSans = LocalFont({
@@ -16,10 +19,14 @@ export default function RootLayout({
children: React.ReactNode;
}) {
return (
- <ClerkProvider>
- <html lang="en">
- <body className={`${inter.className} ${calSans.variable}`}>{children}</body>
- </html>
- </ClerkProvider>
+ <html lang="en">
+ <ClerkProvider>
+ <PlausibleProvider domain="openstatus.dev">
+ <body className={`${inter.className} ${calSans.variable}`}>
+ <Background>{children}</Background>
+ </body>
+ </PlausibleProvider>
+ </ClerkProvider>
+ </html>
);
}
diff --git a/apps/web/src/app/page.tsx b/apps/web/src/app/page.tsx
index 0e3cce156..520a5fd29 100644
--- a/apps/web/src/app/page.tsx
+++ b/apps/web/src/app/page.tsx
@@ -1,10 +1,54 @@
-import { Button, Header } from "ui";
+import { Badge } from "@/components/ui/badge";
+import { Input } from "@/components/ui/input";
+import { waitlist } from "./action";
+import { SubmitButton } from "./components/submit-button";
export default function Page() {
return (
- <>
- <Header text="Web" />
- <Button />
- </>
+ <main className="min-h-screen w-full flex flex-col p-4 md:p-8 space-y-6">
+ <div className="flex-1 flex flex-col justify-center">
+ <div className="mx-auto max-w-xl text-center">
+ <div className="rounded-lg border border-border backdrop-blur-[2px] p-8">
+ <Badge>Announcing Post</Badge>
+ <h1 className="text-3xl text-foreground font-cal mb-6 mt-2">
+ OpenStatus
+ </h1>
+ <p className="text-muted-foreground mb-4">
+ Your Open Source Status Page.
+ </p>
+ <form action={waitlist} className="flex gap-1.5">
+ <Input
+ id="email"
+ name="email"
+ type="email"
+ placeholder="[email protected]"
+ required
+ />
+ <SubmitButton />
+ </form>
+ </div>
+ </div>
+ </div>
+ <footer className="text-center text-sm text-muted-foreground mx-auto rounded-full px-4 py-2 border border-border backdrop-blur-[2px]">
+ Creating by{" "}
+ <a
+ href="https://twitter.com/mxkaske"
+ target="_blank"
+ rel="noreferrer"
+ className="underline underline-offset-4 hover:no-underline"
+ >
+ @mxkaske
+ </a>{" "}
+ and{" "}
+ <a
+ href="https://twitter.com/thibaultleouay"
+ target="_blank"
+ rel="noreferrer"
+ className="underline underline-offset-4 hover:no-underline"
+ >
+ @thibaultleouay
+ </a>
+ </footer>
+ </main>
);
}
diff --git a/apps/web/tailwind.config.ts b/apps/web/tailwind.config.ts
index 8e6a7d599..4844d77f3 100644
--- a/apps/web/tailwind.config.ts
+++ b/apps/web/tailwind.config.ts
@@ -13,6 +13,10 @@ module.exports = {
},
},
extend: {
+ // REMINDER: added for background.tsx
+ backgroundImage: {
+ "gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
+ },
colors: {
border: "hsl(var(--border))",
input: "hsl(var(--input))",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a49efb48d..fa54dbea9 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -84,6 +84,9 @@ importers:
next:
specifier: 13.4.6
+ next-plausible:
+ specifier: 3.7.2
react:
specifier: 18.2.0
version: 18.2.0
@@ -2702,6 +2705,18 @@ packages:
resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==}
dev: true
+ resolution: {integrity: sha512-9PqFiVtD1kZO5gHFYTcgilHhg2WhMzD6I4NK/RUh9DGavD1N11IhNAvyGLFmvB3f4FtHC9IoAsauYDtQBt+riA==}
+ peerDependencies:
+ next: ^11.1.0 || ^12.0.0 || ^13.0.0
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
resolution: {integrity: sha512-sjVqjxU+U2aXZnYt4Ud6CTLNNwWjdSfMgemGpIQJcN3Z7Jni9xRWbR0ie5fQzCg87aLqQVhKA2ud2gPoqJ9lGw==}
engines: {node: '>=16.8.0'}