commit e9a9ffee71317c51fe6c8b9c8c32ff18bd006eea
parent 40bf645c3c1583909c7c6d3de6bf87ad0a32ce58
Author: Daniel D’Aquino <daniel@daquino.me>
Date: Sat, 7 Sep 2024 13:58:20 -0700
Merge pull request #27 from danieldaquino/#26
notedeck waitlist landing page
Diffstat:
12 files changed, 625 insertions(+), 9 deletions(-)
diff --git a/content/compiled-locales/en.json b/content/compiled-locales/en.json
@@ -293,6 +293,36 @@
"value": "shortName"
}
],
+ "notedeck.hero.description": [
+ {
+ "type": 0,
+ "value": "The highest performance Nostr client. Period."
+ }
+ ],
+ "notedeck.hero.signup-for-the-waitlist": [
+ {
+ "type": 0,
+ "value": "Sign up for the waitlist"
+ }
+ ],
+ "notedeck.meta_description": [
+ {
+ "type": 0,
+ "value": "Notedeck is a powerful, performant Nostr client for Linux, Windows, and macOS"
+ }
+ ],
+ "notedeck.waitlist.headline": [
+ {
+ "type": 0,
+ "value": "Coming soon!"
+ }
+ ],
+ "notedeck.waitlist.subheadline": [
+ {
+ "type": 0,
+ "value": "Sign up for our waitlist and be the first to know when notedeck is ready"
+ }
+ ],
"purple-checkout.account-will-renew": [
{
"type": 0,
@@ -305,6 +335,78 @@
"value": "Yay! We found your account"
}
],
+ "purple.account.account-creation": [
+ {
+ "type": 0,
+ "value": "Account creation"
+ }
+ ],
+ "purple.account.active": [
+ {
+ "type": 0,
+ "value": "Active account"
+ }
+ ],
+ "purple.account.back": [
+ {
+ "type": 0,
+ "value": "Go back"
+ }
+ ],
+ "purple.account.contact-support": [
+ {
+ "type": 0,
+ "value": "Contact support"
+ }
+ ],
+ "purple.account.email-support": [
+ {
+ "type": 0,
+ "value": "Via email"
+ }
+ ],
+ "purple.account.expired": [
+ {
+ "type": 0,
+ "value": "Expired account"
+ }
+ ],
+ "purple.account.expiry-date": [
+ {
+ "type": 0,
+ "value": "Expiry date"
+ }
+ ],
+ "purple.account.nostr-support": [
+ {
+ "type": 0,
+ "value": "Via Nostr"
+ }
+ ],
+ "purple.account.sign-out": [
+ {
+ "type": 0,
+ "value": "Sign out"
+ }
+ ],
+ "purple.account.subscriber-number": [
+ {
+ "type": 0,
+ "value": "Subscriber number"
+ }
+ ],
+ "purple.account.testflight-link": [
+ {
+ "type": 0,
+ "value": "Join TestFlight"
+ }
+ ],
+ "purple.account.unknown-user": [
+ {
+ "type": 0,
+ "value": "Generic user avatar"
+ }
+ ],
"purple.benefits.benefit1.description": [
{
"type": 0,
@@ -353,12 +455,6 @@
"value": "Get more from Damus."
}
],
- "purple.checkout.back": [
- {
- "type": 0,
- "value": "Go back"
- }
- ],
"purple.checkout.continue": [
{
"type": 0,
@@ -629,6 +725,102 @@
"value": "Already a member? Click here to renew!"
}
],
+ "purple.login.continue": [
+ {
+ "type": 0,
+ "value": "Continue"
+ }
+ ],
+ "purple.login.create-account": [
+ {
+ "type": 0,
+ "value": "Join Purple today"
+ }
+ ],
+ "purple.login.description": [
+ {
+ "type": 0,
+ "value": "Use this page to access your Purple account details"
+ }
+ ],
+ "purple.login.is-this-you": [
+ {
+ "type": 0,
+ "value": "Is this you?"
+ }
+ ],
+ "purple.login.login-successful": [
+ {
+ "type": 0,
+ "value": "Login successful. You should be automatically redirected. If not, please click the button below."
+ }
+ ],
+ "purple.login.npub-label": [
+ {
+ "type": 0,
+ "value": "Please enter your public key (npub) below"
+ }
+ ],
+ "purple.login.npub-placeholder": [
+ {
+ "type": 0,
+ "value": "npub…"
+ }
+ ],
+ "purple.login.npub-validation-error": [
+ {
+ "type": 0,
+ "value": "Please enter a valid npub"
+ }
+ ],
+ "purple.login.otp-invalid": [
+ {
+ "type": 0,
+ "value": "Invalid or expired OTP. Please try again."
+ }
+ ],
+ "purple.login.otp-sent": [
+ {
+ "type": 0,
+ "value": "We sent you a code via a Nostr DM.\n Please enter it below"
+ }
+ ],
+ "purple.login.stay-safe.message": [
+ {
+ "type": 0,
+ "value": "We will never ask you for your nsec or any other sensitive information via Nostr DMs. Beware of impersonators. Please do not share your OTP code with anyone.\n\n If you don't see the OTP code, please check the DM requests tab in Damus."
+ }
+ ],
+ "purple.login.stay-safe.title": [
+ {
+ "type": 0,
+ "value": "Stay safe"
+ }
+ ],
+ "purple.login.this-account-does-not-exist": [
+ {
+ "type": 0,
+ "value": "This account does not exist"
+ }
+ ],
+ "purple.login.this-account-exists": [
+ {
+ "type": 0,
+ "value": "Yay! We found your account"
+ }
+ ],
+ "purple.login.title": [
+ {
+ "type": 0,
+ "value": "Access your account"
+ }
+ ],
+ "purple.login.unknown-user": [
+ {
+ "type": 0,
+ "value": "Generic user avatar"
+ }
+ ],
"roles.brand-ambassador": [
{
"type": 0,
diff --git a/content/locales/en.json b/content/locales/en.json
@@ -140,12 +140,63 @@
"meet_the_team.view_profile": {
"string": "Follow {shortName}"
},
+ "notedeck.hero.description": {
+ "string": "The highest performance Nostr client. Period."
+ },
+ "notedeck.hero.signup-for-the-waitlist": {
+ "string": "Sign up for the waitlist"
+ },
+ "notedeck.meta_description": {
+ "string": "Notedeck is a powerful, performant Nostr client for Linux, Windows, and macOS"
+ },
+ "notedeck.waitlist.headline": {
+ "string": "Coming soon!"
+ },
+ "notedeck.waitlist.subheadline": {
+ "string": "Sign up for our waitlist and be the first to know when notedeck is ready"
+ },
"purple-checkout.account-will-renew": {
"string": "Paying will renew or extend your membership."
},
"purple-checkout.this-account-exists": {
"string": "Yay! We found your account"
},
+ "purple.account.account-creation": {
+ "string": "Account creation"
+ },
+ "purple.account.active": {
+ "string": "Active account"
+ },
+ "purple.account.back": {
+ "string": "Go back"
+ },
+ "purple.account.contact-support": {
+ "string": "Contact support"
+ },
+ "purple.account.email-support": {
+ "string": "Via email"
+ },
+ "purple.account.expired": {
+ "string": "Expired account"
+ },
+ "purple.account.expiry-date": {
+ "string": "Expiry date"
+ },
+ "purple.account.nostr-support": {
+ "string": "Via Nostr"
+ },
+ "purple.account.sign-out": {
+ "string": "Sign out"
+ },
+ "purple.account.subscriber-number": {
+ "string": "Subscriber number"
+ },
+ "purple.account.testflight-link": {
+ "string": "Join TestFlight"
+ },
+ "purple.account.unknown-user": {
+ "string": "Generic user avatar"
+ },
"purple.benefits.benefit1.description": {
"string": "Support Damus development to help build the future of decentralized communication on the web."
},
@@ -170,9 +221,6 @@
"purple.benefits.headline": {
"string": "Get more from Damus."
},
- "purple.checkout.back": {
- "string": "Go back"
- },
"purple.checkout.continue": {
"string": "Continue in the app"
},
@@ -308,6 +356,54 @@
"purple.hero.renew": {
"string": "Already a member? Click here to renew!"
},
+ "purple.login.continue": {
+ "string": "Continue"
+ },
+ "purple.login.create-account": {
+ "string": "Join Purple today"
+ },
+ "purple.login.description": {
+ "string": "Use this page to access your Purple account details"
+ },
+ "purple.login.is-this-you": {
+ "string": "Is this you?"
+ },
+ "purple.login.login-successful": {
+ "string": "Login successful. You should be automatically redirected. If not, please click the button below."
+ },
+ "purple.login.npub-label": {
+ "string": "Please enter your public key (npub) below"
+ },
+ "purple.login.npub-placeholder": {
+ "string": "npub…"
+ },
+ "purple.login.npub-validation-error": {
+ "string": "Please enter a valid npub"
+ },
+ "purple.login.otp-invalid": {
+ "string": "Invalid or expired OTP. Please try again."
+ },
+ "purple.login.otp-sent": {
+ "string": "We sent you a code via a Nostr DM.\n Please enter it below"
+ },
+ "purple.login.stay-safe.message": {
+ "string": "We will never ask you for your nsec or any other sensitive information via Nostr DMs. Beware of impersonators. Please do not share your OTP code with anyone.\n\n If you don't see the OTP code, please check the DM requests tab in Damus."
+ },
+ "purple.login.stay-safe.title": {
+ "string": "Stay safe"
+ },
+ "purple.login.this-account-does-not-exist": {
+ "string": "This account does not exist"
+ },
+ "purple.login.this-account-exists": {
+ "string": "Yay! We found your account"
+ },
+ "purple.login.title": {
+ "string": "Access your account"
+ },
+ "purple.login.unknown-user": {
+ "string": "Generic user avatar"
+ },
"roles.brand-ambassador": {
"string": "Brand Ambassador"
},
diff --git a/public/notedeck/notedeck-hero-laptop.png b/public/notedeck/notedeck-hero-laptop.png
Binary files differ.
diff --git a/public/notedeck/notedeck-hero-mobile.png b/public/notedeck/notedeck-hero-mobile.png
Binary files differ.
diff --git a/public/notedeck/notedeck-hero.png b/public/notedeck/notedeck-hero.png
Binary files differ.
diff --git a/public/notedeck/notedeck-logo.png b/public/notedeck/notedeck-logo.png
Binary files differ.
diff --git a/src/components/effects/StarField.tsx b/src/components/effects/StarField.tsx
@@ -0,0 +1,125 @@
+/*
+The code below was taken from https://codepen.io/ChuckWines/pen/OJPEzqN and licensed under the MIT License.
+
+The code was further modified to be used in a React component with TypeScript.
+---------
+Copyright (c) 2024 by Charles Wines (https://codepen.io/ChuckWines/pen/OJPEzqN)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+import { useScroll, useTransform } from 'framer-motion';
+import React, { useEffect, useRef, useState } from 'react';
+
+const STAR_COUNT = 300;
+const STAR_MIN_SPEED = 0.005;
+const STAR_MAX_SPEED = 0.09;
+const MIN_VISION_PERSISTENCE = 0.2;
+const MAX_VISION_PERSISTENCE = 0.99;
+
+export function StarField({ className }: { className?: string }) {
+ const canvasRef = useRef<HTMLCanvasElement>(null);
+ const contextRef = useRef<CanvasRenderingContext2D | null>(null);
+ const { scrollYProgress } = useScroll()
+ const speed = useTransform(scrollYProgress, [0, 0.3], [STAR_MIN_SPEED, STAR_MAX_SPEED]);
+ const visionPersistence = useTransform(scrollYProgress, [0, 0.3], [MIN_VISION_PERSISTENCE, MAX_VISION_PERSISTENCE]);
+
+ class Star {
+ x: number;
+ y: number;
+ prevX: number;
+ prevY: number;
+ z: number;
+
+ constructor(canvasWidth: number, canvasHeight: number) {
+ this.x = Math.random() * canvasWidth - canvasWidth / 2;
+ this.y = Math.random() * canvasHeight - canvasHeight / 2;
+ this.prevX = this.x;
+ this.prevY = this.y;
+ this.z = Math.random() * 4;
+ }
+
+ update(speed: number, canvasWidth: number, canvasHeight: number) {
+ this.prevX = this.x;
+ this.prevY = this.y;
+ this.z += speed;
+ this.x += this.x * (speed * 0.2) * this.z;
+ this.y += this.y * (speed * 0.2) * this.z;
+ if (
+ this.x > canvasWidth / 2 + 50 ||
+ this.x < -canvasWidth / 2 - 50 ||
+ this.y > canvasHeight / 2 + 50 ||
+ this.y < -canvasHeight / 2 - 50
+ ) {
+ this.x = Math.random() * canvasWidth - canvasWidth / 2;
+ this.y = Math.random() * canvasHeight - canvasHeight / 2;
+ this.prevX = this.x;
+ this.prevY = this.y;
+ this.z = 0;
+ }
+ }
+
+ show(context: CanvasRenderingContext2D) {
+ context.lineWidth = this.z;
+ context.beginPath();
+ context.moveTo(this.x, this.y);
+ context.lineTo(this.prevX, this.prevY);
+ context.stroke();
+ }
+ }
+
+ const getContext = () => {
+ if (!contextRef.current && canvasRef.current) {
+ let context = canvasRef.current.getContext('2d');
+ if (!context) throw new Error('Failed to get canvas context');
+ contextRef.current = context;
+ return context;
+ }
+ else {
+ if (!contextRef.current) throw new Error('Canvas context is not available');
+ return contextRef.current;
+ }
+ }
+
+ useEffect(() => {
+ const canvas = canvasRef.current;
+ if (!canvas) return;
+
+ const context = getContext();
+
+ canvas.width = window.innerWidth;
+ canvas.height = window.innerHeight;
+
+ let stars: Star[] = [];
+ for (let i = 0; i < STAR_COUNT; i++) {
+ stars.push(new Star(canvas.width, canvas.height));
+ }
+
+ context.fillStyle = `rgba(0, 0, 0, ${1 - visionPersistence.get()})`;
+ context.strokeStyle = 'rgba(235, 215, 255)';
+ context.translate(canvas.width / 2, canvas.height / 2);
+
+ function draw() {
+ if (!context) return;
+ if (!canvas) return;
+ context.fillStyle = `rgba(0, 0, 0, ${1 - visionPersistence.get()})`;
+ context.fillRect(-canvas.width / 2, -canvas.height / 2, canvas.width, canvas.height);
+ for (let star of stars) {
+ star.update(speed.get(), canvas.width, canvas.height);
+ star.show(context);
+ }
+ requestAnimationFrame(draw);
+ }
+
+ draw();
+ }, []);
+
+ return <canvas ref={canvasRef} className={className} style={{
+ zIndex: -1,
+ }} />;
+};
+
+export default StarField;+
\ No newline at end of file
diff --git a/src/components/pages/notedeck.tsx b/src/components/pages/notedeck.tsx
@@ -0,0 +1,21 @@
+import Head from "next/head";
+import { useIntl } from 'react-intl'
+import { Footer } from '@/components/sections/Footer';
+import { NotedeckHero } from '../sections/Notedeck/NotedeckHero';
+import { NotedeckWaitlistForm } from "../sections/Notedeck/WaitlistForm";
+
+export function Notedeck() {
+ const intl = useIntl()
+
+ return (<>
+ <Head>
+ <title>Notedeck</title>
+ <meta name="description" content={intl.formatMessage({ id: "notedeck.meta_description", defaultMessage: "Notedeck is a powerful, performant Nostr client for Linux, Windows, and macOS" })} />
+ </Head>
+ <main style={{ scrollBehavior: "smooth" }}>
+ <NotedeckHero/>
+ <NotedeckWaitlistForm />
+ <Footer />
+ </main>
+ </>)
+}
diff --git a/src/components/sections/Notedeck/NotedeckHero.tsx b/src/components/sections/Notedeck/NotedeckHero.tsx
@@ -0,0 +1,87 @@
+import { ArrowUpRight, ChevronRight, Globe2, LucideZapOff, Sparkles, Star, Zap, ZapIcon, ZapOff } from "lucide-react";
+import { MeshGradient1 } from "../../effects/MeshGradient.1";
+import { TopMenu } from "../TopMenu";
+import { Button } from "../../ui/Button";
+import { FormattedMessage, useIntl } from "react-intl";
+import Link from "next/link";
+import { motion } from "framer-motion";
+import Image from "next/image";
+import StarField from "@/components/effects/StarField";
+import { useScroll, useTransform } from "framer-motion";
+
+export function NotedeckHero({ className }: { className?: string }) {
+ const intl = useIntl()
+ const { scrollYProgress } = useScroll()
+ const heroOpacity = useTransform(scrollYProgress, [0.55, 0.8], [1.0, 0.0]);
+ const bgOpacity = useTransform(scrollYProgress, [0.3, 0.55], [1.0, 0.0]);
+ const mobileScreenshotOffsetX = useTransform(scrollYProgress, [0.2, 1], [0, -800]);
+
+ return (<>
+ <motion.div
+ className={`bg-black overflow-hidden relative ${className}`}
+ >
+ <motion.div className="absolute z-0 w-full h-full pointer-events-none" style={{ opacity: bgOpacity }}>
+ <StarField className="z-0 fixed top-0 left-0 object-cover object-center w-full h-full"/>
+ <MeshGradient1 className="-translate-x-1/3" />
+ </motion.div>
+ <motion.div className="container z-10 mx-auto px-6 pt-12 h-full min-h-screen flex flex-col justify-center" style={{ opacity: heroOpacity }}>
+ <motion.div
+ className="w-full z-10 backdrop-blur-sm bg-black/20 rounded-xl p-4 shadow-xl border border-black/30"
+ style={{ opacity: 0 }}
+ animate={{ opacity: 1, transition: { delay: 1.5, duration: 1 } }}
+ >
+ <TopMenu className="w-full z-10" />
+ </motion.div>
+ <motion.div
+ className="flex flex-col items-center justify-center h-full grow mt-48 z-10"
+ style={{ opacity: 0 }}
+ animate={{ opacity: 1, transition: { delay: 0.5, duration: 1 } }}
+ >
+ <div className="flex gap-x-4 items-center mb-2 md:mb-2">
+ <Image
+ src="/notedeck/notedeck-logo.png"
+ alt="notedeck logo"
+ width={500}
+ height={105}
+ />
+ </div>
+ <div className="text-purple-200/70 text-lg md:text-2xl text-center max-w-2xl mb-8 break-keep">
+ {intl.formatMessage({ id: "notedeck.hero.description", defaultMessage: "The highest performance Nostr client. Period." })}
+ </div>
+ <motion.div
+ className="mt-10 md:mt-4 mb-8 flex flex-col md:flex-row items-center md:items-center gap-y-4 gap-x-6 w-full md:w-auto"
+ style={{ opacity: 0 }}
+ animate={{ opacity: 1, transition: { delay: 1.5, duration: 1 } }}
+ >
+ <Link href="#tally-open=npVXbJ&tally-layout=modal&tally-align-left=1&tally-hide-title=1&tally-emoji-text=🚀&tally-emoji-animation=none&tally-auto-close=68000" className="w-full md:w-auto">
+ <Button variant="default" className="w-full">
+ {intl.formatMessage({ id: "notedeck.hero.signup-for-the-waitlist", defaultMessage: "Sign up for the waitlist" })}
+ </Button>
+ </Link>
+ </motion.div>
+ <div className="hidden md:flex gap-x-4 items-center mb-12 md:mb-6 z-20 relative">
+ <Image
+ src="/notedeck/notedeck-hero.png"
+ alt="notedeck screenshot"
+ className=""
+ width={1200}
+ height={105}
+ />
+ </div>
+ <div className="flex md:hidden mb-12 md:mb-6 z-20 relative overflow-hidden w-screen">
+ <motion.img
+ src="/notedeck/notedeck-hero.png"
+ alt="notedeck screenshot"
+ className="max-w-fit"
+ style={{
+ marginLeft: mobileScreenshotOffsetX
+ }}
+ width={1200}
+ height={105}
+ />
+ </div>
+ </motion.div>
+ </motion.div>
+ </motion.div>
+ </>)
+}
diff --git a/src/components/sections/Notedeck/WaitlistForm.tsx b/src/components/sections/Notedeck/WaitlistForm.tsx
@@ -0,0 +1,50 @@
+import { RoundedContainerWithGradientBorder } from "@/components/ui/RoundedContainerWithGradientBorder";
+import { useIntl } from "react-intl";
+import { CheckCircle, Frown, Mail, Sparkles } from "lucide-react";
+import { Button } from "@/components/ui/Button";
+import Link from "next/link";
+import Image from "next/image";
+import { Input } from "@/components/ui/Input"
+import { Label } from "@/components/ui/Label"
+import { useState } from "react";
+import { MeshGradient5 } from "@/components/effects/MeshGradient.5";
+import { MeshGradient4 } from "@/components/effects/MeshGradient.4";
+import { cn } from "@/lib/utils";
+import { motion } from "framer-motion";
+
+export function NotedeckWaitlistForm({ className }: { className?: string }) {
+ const intl = useIntl()
+
+ return (<>
+ <div className={cn("bg-black overflow-hidden relative", className)}>
+ <div className="container mx-auto px-6 pb-24 pt-48">
+ <div className="flex flex-col items-center justify-center mt-32 lg:mt-16">
+ <div className="relative mb-24 flex flex-col items-center justify-center">
+ <div className="absolute pointer-events-none">
+ <MeshGradient4 />
+ </div>
+ <motion.h2 className="mb-1 md:mb-4 text-4xl md:text-5xl lg:text-6xl text-center text-transparent bg-clip-text bg-gradient-to-r from-white from-5% to-[#E0A4D3] to-100% font-semibold pb-4 whitespace-pre-line leading-relaxed">
+ {intl.formatMessage({ id: "notedeck.waitlist.headline", defaultMessage: "Coming soon!" })}
+ </motion.h2>
+ <motion.label htmlFor="contact" className="text-xl text-center max-w-2xl mb-12 text-transparent bg-clip-text bg-gradient-to-br from-white from-5% to-[#8DEBF8] to-100% whitespace-pre-line leading-loose">
+ {(intl.locale != "ja" || process.env.FORCE_LOAD_ALL_JA_SECTIONS) && (<>
+ {intl.formatMessage({ id: "notedeck.waitlist.subheadline", defaultMessage: "Sign up for our waitlist and be the first to know when notedeck is ready" })}
+ </>)}
+ </motion.label>
+ <motion.div
+ className="flex flex-col items-center md:items-center gap-y-4 gap-x-6"
+ style={{ opacity: 0 }}
+ animate={{ opacity: 1, transition: { delay: 1.5, duration: 1 } }}
+ >
+ <Link href="#tally-open=npVXbJ&tally-layout=modal&tally-align-left=1&tally-hide-title=1&tally-emoji-text=🚀&tally-emoji-animation=none&tally-auto-close=68000" className="w-full md:w-auto">
+ <Button variant="default" className="w-full">
+ {intl.formatMessage({ id: "notedeck.hero.signup-for-the-waitlist", defaultMessage: "Sign up for the waitlist" })}
+ </Button>
+ </Link>
+ </motion.div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </>)
+}+
\ No newline at end of file
diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx
@@ -13,6 +13,7 @@ export default function Document() {
<meta name="twitter:image" content="https://damus.io/logo_icon.png"/>
<meta name="twitter:description" content="Damus - A new social network that you control"/>
<meta name="twitter:title" content="Damus"/>
+ <script async src="https://tally.so/widgets/embed.js"></script>
</Head>
<body>
<Main />
diff --git a/src/pages/notedeck/index.tsx b/src/pages/notedeck/index.tsx
@@ -0,0 +1,42 @@
+import { Inter } from 'next/font/google'
+import { IntlProvider, useIntl } from 'react-intl'
+import English from "@/../content/compiled-locales/en.json";
+import Japanese from "@/../content/compiled-locales/ja.json";
+import { useEffect } from 'react';
+import { useState } from 'react';
+import { Notedeck } from '@/components/pages/notedeck';
+
+export default function HomePage() {
+ // Automatically detect the user's locale based on their browser settings
+ const [language, setLanguage] = useState("en");
+ const [messages, setMessages] = useState(English);
+
+ useEffect(() => {
+ setLanguage(navigator.language);
+ }, []);
+
+ useEffect(() => {
+ switch (language) {
+ case "en":
+ setMessages(English);
+ break;
+ case "ja":
+ // TODO: Add Japanese translations and then switch to "Japanese" below
+ setMessages(English);
+ break;
+ default:
+ setMessages(English);
+ break;
+ }
+ }, [language]);
+
+ return (<>
+ <IntlProvider
+ locale={language}
+ messages={messages}
+ onError={() => null}>
+ <Notedeck />
+ </IntlProvider>
+ </>)
+}
+