diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..3d744b0 --- /dev/null +++ b/.env.example @@ -0,0 +1,6 @@ +# Next +NEXT_PUBLIC_ORIGIN=https://plasticlabs.ai/ + +# Posthog +NEXT_PUBLIC_POSTHOG_KEY= +NEXT_PUBLIC_POSTHOG_HOST= diff --git a/.eslintrc.json b/.eslintrc.json index bffb357..c8fb1ad 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,141 @@ { - "extends": "next/core-web-vitals" -} + "root": true, + "plugins": [ + "no-unsanitized", + "jsx-a11y", + "@typescript-eslint", + "import", + "prettier", + "react" + ], + "extends": [ + "airbnb", + "airbnb/hooks", + "airbnb-typescript", + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:import/typescript", + "plugin:prettier/recommended", + "plugin:react/recommended", + "plugin:react/jsx-runtime", + "prettier", + "next/core-web-vitals", + "next/typescript", + "plugin:storybook/recommended" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": 2018, + "project": "./tsconfig.json" + }, + "rules": { + "no-console": "error", + "arrow-parens": [ + "error", + "as-needed" + ], + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": [ + "**/*.spec.ts" + ] + } + ], + "import/order": [ + "error", + { + "groups": [ + "builtin", + "external", + "internal", + "unknown", + "parent", + "sibling", + "index", + "object", + "type" + ], + "pathGroups": [], + "pathGroupsExcludedImportTypes": [ + "internal" + ], + "alphabetize": { + "order": "asc", + "caseInsensitive": true + } + } + ], + "react/function-component-definition": [ + 2, + { + "namedComponents": "arrow-function" + } + ], + "react/jsx-props-no-spreading": "off", + "semi": "off", + "sort-imports": [ + "error", + { + "ignoreCase": true, + "ignoreDeclarationSort": true, + "ignoreMemberSort": true, + "memberSyntaxSortOrder": [ + "none", + "all", + "multiple", + "single" + ], + "allowSeparatedGroups": true + } + ], + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "interface", + "format": [ + "PascalCase" + ], + "modifiers": [ + "exported" + ] + }, + { + "selector": "enum", + "format": [ + "PascalCase", + "UPPER_CASE" + ], + "modifiers": [ + "exported" + ] + }, + { + "selector": "typeAlias", + "format": [ + "PascalCase" + ], + "modifiers": [ + "exported" + ] + } + ], + "@typescript-eslint/semi": [ + "error", + "never" + ], + "import/prefer-default-export": "off", + "import/no-default-export": "error", + "no-unused-vars": "error", + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/dot-notation": "off", + "no-underscore-dangle": "off", + "react/require-default-props": "off", + "react/prop-types": "off", + "import/no-cycle": "error" + } +} \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..38c72d8 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,21 @@ +name: "Lint" + +on: + pull_request + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup node from node version file + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + - name: Install correct npm version + run: npm install -g npm@^10 + - name: Install dependencies + run: npm install + - name: Lint + run: npm run lint \ No newline at end of file diff --git a/.gitignore b/.gitignore index e22b934..a9d511f 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,5 @@ yarn-error.log* next-env.d.ts .env + +*storybook.log diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..4fd0219 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +engine-strict=true \ No newline at end of file diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..67e145b --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v20.18.0 diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..b56db23 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +{ + "arrowParens": "avoid", + "printWidth": 80, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "all" +} \ No newline at end of file diff --git a/.storybook/main.ts b/.storybook/main.ts new file mode 100644 index 0000000..c81588d --- /dev/null +++ b/.storybook/main.ts @@ -0,0 +1,17 @@ +import type { StorybookConfig } from '@storybook/nextjs' + +const config: StorybookConfig = { + stories: ['../components/**/*.stories.@(ts|tsx)'], + addons: [ + '@storybook/addon-essentials', + '@chromatic-com/storybook', + '@storybook/addon-interactions', + '@storybook/addon-themes', + ], + framework: { + name: '@storybook/nextjs', + options: {}, + }, + staticDirs: ['../public', { from: '../fonts', to: '/fonts' }], +} +export default config diff --git a/.storybook/manager.ts b/.storybook/manager.ts new file mode 100644 index 0000000..16a021f --- /dev/null +++ b/.storybook/manager.ts @@ -0,0 +1,6 @@ +import { addons } from '@storybook/manager-api' +import { BaseTheme } from './theme' + +addons.setConfig({ + theme: BaseTheme, +}) diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx new file mode 100644 index 0000000..593e66a --- /dev/null +++ b/.storybook/preview.tsx @@ -0,0 +1,69 @@ +import type { Preview } from '@storybook/react' +import { withThemeFromJSXProvider } from '@storybook/addon-themes' +import { ThemeProvider } from 'styled-components' +import { GlobalStyles } from '../styles/global-styles' +import { themes } from '../styles/themes' + +const viewports = { + mobileSe: { + name: 'Mobile SE', + styles: { + width: '375px', + height: '844px', + }, + }, + mobileXr: { + name: 'Mobile', + styles: { + width: '414px', + height: '896px', + }, + }, + tablet: { + name: 'Tablet', + styles: { + width: '768px', + height: '1024px', + }, + }, + laptop: { + name: 'Laptop', + styles: { + width: '1280px', + height: '982px', + }, + }, + laptopWide: { + name: 'Laptop (Wide)', + styles: { + width: '1440px', + height: '1024px', + }, + }, +} + +export const decorators = [ + withThemeFromJSXProvider({ + themes, + defaultTheme: 'light', + Provider: ThemeProvider, + GlobalStyles, + }), +] + +const preview: Preview = { + parameters: { + backgrounds: { disable: true }, + controls: { + matchers: { + color: /(background|color)$/i, + date: /Date$/i, + }, + }, + viewport: { + viewports, + } + }, +} + +export default preview diff --git a/.storybook/theme.ts b/.storybook/theme.ts new file mode 100644 index 0000000..c1be082 --- /dev/null +++ b/.storybook/theme.ts @@ -0,0 +1,9 @@ +import { create } from '@storybook/theming' + +export const BaseTheme = create({ + base: 'light', + brandTitle: 'Plastic Labs', + brandUrl: 'https://plasticlabs.ai/', + brandImage: 'http://localhost:6006/storybook-brand-asset.svg', + brandTarget: '_blank', +}) diff --git a/app/apple-icon1.png b/app/apple-icon1.png new file mode 100644 index 0000000..03ea454 Binary files /dev/null and b/app/apple-icon1.png differ diff --git a/app/apple-icon2.png b/app/apple-icon2.png new file mode 100644 index 0000000..ecc70bf Binary files /dev/null and b/app/apple-icon2.png differ diff --git a/app/apple-icon3.png b/app/apple-icon3.png new file mode 100644 index 0000000..1a99e5d Binary files /dev/null and b/app/apple-icon3.png differ diff --git a/app/favicon.ico b/app/favicon.ico index c9b486a..bc357b7 100644 Binary files a/app/favicon.ico and b/app/favicon.ico differ diff --git a/app/globals.css b/app/globals.css deleted file mode 100644 index 66c296d..0000000 --- a/app/globals.css +++ /dev/null @@ -1,40 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - -:root { - --foreground-rgb: 0, 0, 0; - --background-start-rgb: 214, 219, 220; - --background-end-rgb: 255, 255, 255; - scroll-behavior: smooth; -} - -/* @media (prefers-color-scheme: dark) { - :root { - --foreground-rgb: 255, 255, 255; - --background-start-rgb: 0, 0, 0; - --background-end-rgb: 0, 0, 0; - } -}*/ - -body { - color: rgb(var(--foreground-rgb)); - -} - -p { - font-size: 16px; -} - -h1 { - font-size: 24px; -} - -@media (max-width: 768px) { - p { - font-size: 16px; - } - h1 { - font-size: 24px; - } -} diff --git a/app/icon.svg b/app/icon.svg new file mode 100644 index 0000000..762e8ae --- /dev/null +++ b/app/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/icon1.png b/app/icon1.png new file mode 100644 index 0000000..edb9a30 Binary files /dev/null and b/app/icon1.png differ diff --git a/app/icon2.png b/app/icon2.png new file mode 100644 index 0000000..cfbc1bc Binary files /dev/null and b/app/icon2.png differ diff --git a/app/icon3.png b/app/icon3.png new file mode 100644 index 0000000..a22f6ed Binary files /dev/null and b/app/icon3.png differ diff --git a/app/icon4.png b/app/icon4.png new file mode 100644 index 0000000..deeb6bc Binary files /dev/null and b/app/icon4.png differ diff --git a/app/icon5.png b/app/icon5.png new file mode 100644 index 0000000..51e4034 Binary files /dev/null and b/app/icon5.png differ diff --git a/app/layout.tsx b/app/layout.tsx index e355b37..c04f5c6 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,49 +1,37 @@ -import './globals.css' -import type { Metadata } from 'next' -import { Inter, Exo_2 } from 'next/font/google' -import { CSPostHogProvider } from './providers' - -const inter = Inter({ subsets: ['latin'] }) - -const exo2 = Exo_2({ - subsets: ['latin'], - display: 'swap', - variable: '--font-exo2', -}) +/* eslint-disable import/no-default-export */ +import { Metadata } from 'next' +import { Footer } from '@/components/layout/footer' +import { Header } from '@/components/layout/header' +import { Main } from '@/components/layout/main' +import { Providers } from './providers' export const metadata: Metadata = { title: 'Plastic Labs 🥽', - authors: [{ name: "Plastic Labs", url: "https://plasticlabs.ai" }], + authors: [{ name: 'Plastic Labs', url: 'https://plasticlabs.ai' }], metadataBase: new URL('https://plasticlabs.ai'), openGraph: { - title: "Plastic Labs", - description: "Building at the intersection of Human and Machine Learning", - siteName: "Plastic Labs", - type: "website", - url: "https://plasticlabs.ai", - images: [ - { - url: "/opengraph-image.png", - width: 1200, - height: 630, - alt: "Plastic Labs" - } - ], - locale: "en_US", + title: 'Plastic Labs', + description: 'Radically Decentralizing Alignment', + siteName: 'Plastic Labs', + type: 'website', + url: 'https://plasticlabs.ai', + locale: 'en_US', }, - description: 'Building at the intersection of Human and Machine Learning', + description: 'Radically Decentralizing Alignment', } -export default function RootLayout({ - children, -}: { - children: React.ReactNode -}) { +const RootLayout = ({ children }: { children: React.ReactNode }) => { return ( - - {children} - + + +
+
{children}
+