commit c0ee8a4a11785e5b80507e67964254758e684f54 Author: ryanchristo Date: Tue Nov 17 18:44:03 2026 -0800 init commit diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..adc0468 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,24 @@ +{ + "plugins": ["react"], + "extends": [ + "eslint:recommended", + "next/core-web-vitals", + "plugin:@typescript-eslint/recommended" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module", + "ecmaFeatures": { + "jsx": true + } + }, + "rules": { + "@typescript-eslint/no-explicit-any": "off" + }, + "settings": { + "react": { + "version": "detect" + } + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5de81b4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.next +dist +node_modules diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..8581ed2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "artifacts"] + path = artifacts + url = https://github.com/chora-io/artifacts diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..b2095be --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "semi": false, + "singleQuote": true +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..ec1f076 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# website + +chora website diff --git a/app/artifacts/choreography/[id]/page.module.css b/app/artifacts/choreography/[id]/page.module.css new file mode 100644 index 0000000..7d2c1fc --- /dev/null +++ b/app/artifacts/choreography/[id]/page.module.css @@ -0,0 +1,11 @@ +.page { + composes: page from '../../../../styles/page.css'; +} + +.banner { + composes: banner-document from '../../../../styles/banner.css'; +} + +.content { + composes: content-full from '../../../../styles/content.css'; +} diff --git a/app/artifacts/choreography/[id]/page.tsx b/app/artifacts/choreography/[id]/page.tsx new file mode 100644 index 0000000..e7e97fc --- /dev/null +++ b/app/artifacts/choreography/[id]/page.tsx @@ -0,0 +1,35 @@ +import { Metadata } from 'next' + +import { getArtifact, getArtifacts } from '@utils' + +import styles from './page.module.css' + +export const metadata: Metadata = { + title: 'chora studio | research', +} + +export const generateStaticParams = () => { + return getArtifacts('choreography') +} + +const ArtifactPage = async ({ params }: any) => { + const artifact = await getArtifact('choreography', params.id) + return ( +
+
+
+

{`author: ${artifact.author}`}

+

{`title: ${artifact.title}`}

+

{`description: ${artifact.description}`}

+

{`created: ${artifact.created.toDateString()}`}

+

{`updated: ${artifact.updated.toDateString()}`}

+
+
+
+
+
+
+ ) +} + +export default ArtifactPage diff --git a/app/artifacts/page.module.css b/app/artifacts/page.module.css new file mode 100644 index 0000000..6f026c6 --- /dev/null +++ b/app/artifacts/page.module.css @@ -0,0 +1,24 @@ +.page { + composes: page from '../../styles/page.css'; +} + +.banner { + composes: banner from '../../styles/banner.css'; +} + +.content { + composes: content-full from '../../styles/content.css'; +} + +.content ul { + list-style: none inside none; +} + +.content li { + margin: 2em 0; +} + +.content p { + color: var(--color-text); + font-weight: 300; +} diff --git a/app/artifacts/page.tsx b/app/artifacts/page.tsx new file mode 100644 index 0000000..801eec1 --- /dev/null +++ b/app/artifacts/page.tsx @@ -0,0 +1,65 @@ +import { Metadata } from 'next' +import Link from 'next/link' + +import { getArtifacts } from '@utils' + +import styles from './page.module.css' + +export const metadata: Metadata = { + title: 'chora | artifacts', +} + +async function getResearchArtifacts() { + return [ + { group: 'choreography', items: getArtifacts('choreography') }, + ] +} + +const ResearchPage = async () => { + const artifacts = await getResearchArtifacts() + return ( +
+
+
+

{'artifacts'}

+
+
+
+
+ {!artifacts.length ? ( +

+ {'failed to load artifacts'} +

+ ) : ( +
+ {artifacts.map(({ group, items }) => ( +
+

{group}

+
    + {items.map( + ({ id, title, description, created, updated }) => ( +
  • + +

    {title}

    +

    {description}

    +

    + {`created: ${created.toDateString()}`} + {' | '} + {`updated: ${updated.toDateString()}`} +

    + +
  • + ), + )} +
+
+ ))} +
+ )} +
+
+
+ ) +} + +export default ResearchPage diff --git a/app/globals.css b/app/globals.css new file mode 100644 index 0000000..7b05eee --- /dev/null +++ b/app/globals.css @@ -0,0 +1,196 @@ +@font-face { + font-family: 'Ubuntu'; + font-style: normal; + font-weight: normal; + src: url('../assets/font/Ubuntu-Regular.ttf'); +} + +@font-face { + font-family: 'Ubuntu'; + font-style: italic; + font-weight: normal; + src: url('../assets/font/Ubuntu-Italic.ttf'); +} + +@font-face { + font-family: 'Ubuntu'; + font-style: normal; + font-weight: bold; + src: url('../assets/font/Ubuntu-Bold.ttf'); +} + +@font-face { + font-family: 'Ubuntu'; + font-style: italic; + font-weight: bold; + src: url('../assets/font/Ubuntu-BoldItalic.ttf'); +} + +@font-face { + font-family: 'Ubuntu'; + font-style: normal; + font-weight: 300; + src: url('../assets/font/Ubuntu-Light.ttf'); +} + +@font-face { + font-family: 'Ubuntu'; + font-style: italic; + font-weight: 300; + src: url('../assets/font/Ubuntu-LightItalic.ttf'); +} + +@font-face { + font-family: 'Ubuntu'; + font-style: normal; + font-weight: 500; + src: url('../assets/font/Ubuntu-Medium.ttf'); +} + +@font-face { + font-family: 'Ubuntu'; + font-style: italic; + font-weight: 500; + src: url('../assets/font/Ubuntu-MediumItalic.ttf'); +} + +:root { + --color-error: rgb(245, 45, 45); + --color-theme: rgb(0, 195, 165); + --font-family: 'Ubuntu', sans-serif; + --footer-height: 320px; + --header-height: 80px; + --sidebar-width: 240px; + --transition: 0.25s; + + /* light theme */ + --background-primary: rgb(255, 255, 255); + --background-primary-transparent: rgba(255, 255, 255, 0.98); + --background-secondary: rgb(250, 250, 250); + --background-secondary-transparent: rgba(250, 250, 250, 0.98); + --box-shadow: 0 0 4px rgb(245, 245, 245); + --box-shadow-color: rgb(245, 245, 245); + --color-text: rgb(10, 10, 10); + --color-text-placeholder: rgba(10, 10, 10, 0.5); +} + +@media (max-width: 850px) { + :root { + --footer-height: 80px; + } +} + +.dark-theme { + --background-primary: rgb(17, 17, 17); + --background-primary-transparent: rgba(17, 17, 17, 0.98); + --background-secondary: rgb(22, 22, 22); + --background-secondary-transparent: rgba(22, 22, 22, 0.98); + --box-shadow: 0 0 4px rgb(27, 27, 27); + --box-shadow-color: rgb(27, 27, 27); + --color-text: rgb(245, 245, 245); + --color-text-placeholder: rgba(245, 245, 245, 0.5); +} + +* { + margin: 0; + padding: 0; +} + +html { + cursor: default; +} + +body { + color: var(--color-text); + font-family: var(--font-family); + font-weight: 300; +} + +main { + overflow: hidden; +} + +h1, +h2, +h3, +h4, +h5 { + font-weight: 300; +} + +p { + line-height: 1.75; +} + +a, +a:active { + color: var(--color-theme); + font-weight: 400; + text-decoration: none; + transition: var(--transition); +} + +a:hover { + opacity: 0.75; +} + +button { + background: var(--color-theme); + border: none; + border-radius: 1em; + color: var(--background-primary); + font-family: var(--font-family); + font-size: 1em; + outline: none; + transition: var(--transition); +} + +button:hover { + cursor: pointer; + opacity: 0.75; +} + +input, +textarea, +select { + background: var(--background-primary); + border: none; + box-shadow: var(--box-shadow); + color: var(--color-text); + font-family: var(--font-family); + outline: none; +} + +textarea { + line-height: 1.5; + white-space: pre; +} + +input::placeholder, +textarea::placeholder { + color: var(--color-text-placeholder); +} + +pre { + overflow-x: scroll; + scrollbar-width: none; /* hide scrollbar - Firefox */ + -ms-overflow-style: none; /* hide scrollbar - Internet Explorer 10+ */ +} + +pre::-webkit-scrollbar { + display: none; /* hide scrollbar - Safari and Chrome */ +} + +hr { + border: 0.05em solid var(--box-shadow-color); +} + +td { + overflow-x: scroll; + scrollbar-width: none; /* hide scrollbar - Firefox */ + -ms-overflow-style: none; /* hide scrollbar - Internet Explorer 10+ */ +} + +td::-webkit-scrollbar { + display: none; /* hide scrollbar - Safari and Chrome */ +} diff --git a/app/layout.tsx b/app/layout.tsx new file mode 100644 index 0000000..d353ff3 --- /dev/null +++ b/app/layout.tsx @@ -0,0 +1,50 @@ +'use client' + +import { Background, Header, Sidebar } from 'chora/components' +import { MenuContextProvider, ThemeContextProvider } from 'chora/contexts' + +import './globals.css' + +const Layout = ({ children }: any) => ( + + + + + +
+ +
{children}
+ + + + +) + +export default Layout diff --git a/app/not-found.module.css b/app/not-found.module.css new file mode 100644 index 0000000..38e6395 --- /dev/null +++ b/app/not-found.module.css @@ -0,0 +1,3 @@ +.page { + composes: page-center-not-found from '../styles/page.css'; +} diff --git a/app/not-found.tsx b/app/not-found.tsx new file mode 100644 index 0000000..eda36ac --- /dev/null +++ b/app/not-found.tsx @@ -0,0 +1,18 @@ +import { Metadata } from 'next' + +import styles from './not-found.module.css' + +export const metadata: Metadata = { + title: '404 | a placeless place', +} + +const NotFoundPage = () => ( +
+
+

{'404'}

+

{'a placeless place'}

+
+
+) + +export default NotFoundPage diff --git a/app/page.module.css b/app/page.module.css new file mode 100644 index 0000000..7c49f36 --- /dev/null +++ b/app/page.module.css @@ -0,0 +1,25 @@ +.page { + composes: page from '../styles/page.css'; +} + +.banner { + composes: banner-full from '../styles/banner.css'; +} + +.content { + composes: content-full from '../styles/content.css'; +} + +.content > div { + padding: 6em 0 !important; +} + +@media (max-width: 850px) { + .content > div { + padding: 4em 0 !important; + } +} + +.content > div > a { + margin-bottom: 3em !important; +} diff --git a/app/page.tsx b/app/page.tsx new file mode 100644 index 0000000..b81d8ef --- /dev/null +++ b/app/page.tsx @@ -0,0 +1,27 @@ +import { Metadata } from 'next' + +import styles from './page.module.css' + +export const metadata: Metadata = { + title: 'chora | open protocol', +} + +const HomePage = () => { + return ( +
+
+
+

+ {'chora'} +

+

+ {'a third thing or perhaps no thing'} +

+

{'open protocol'}

+
+
+
+ ) +} + +export default HomePage diff --git a/artifacts b/artifacts new file mode 160000 index 0000000..f3ccc93 --- /dev/null +++ b/artifacts @@ -0,0 +1 @@ +Subproject commit f3ccc93ecc7f8c61a7c06c90a34d2445b331909b diff --git a/assets/font/UFL.txt b/assets/font/UFL.txt new file mode 100644 index 0000000..6e722c8 --- /dev/null +++ b/assets/font/UFL.txt @@ -0,0 +1,96 @@ +------------------------------- +UBUNTU FONT LICENCE Version 1.0 +------------------------------- + +PREAMBLE +This licence allows the licensed fonts to be used, studied, modified and +redistributed freely. The fonts, including any derivative works, can be +bundled, embedded, and redistributed provided the terms of this licence +are met. The fonts and derivatives, however, cannot be released under +any other licence. The requirement for fonts to remain under this +licence does not require any document created using the fonts or their +derivatives to be published under this licence, as long as the primary +purpose of the document is not to be a vehicle for the distribution of +the fonts. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this licence and clearly marked as such. This may +include source files, build scripts and documentation. + +"Original Version" refers to the collection of Font Software components +as received under this licence. + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to +a new environment. + +"Copyright Holder(s)" refers to all individuals and companies who have a +copyright ownership of the Font Software. + +"Substantially Changed" refers to Modified Versions which can be easily +identified as dissimilar to the Font Software by users of the Font +Software comparing the Original Version with the Modified Version. + +To "Propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification and with or without charging +a redistribution fee), making available to the public, and in some +countries other activities as well. + +PERMISSION & CONDITIONS +This licence does not grant any rights under trademark law and all such +rights are reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of the Font Software, to propagate the Font Software, subject to +the below conditions: + +1) Each copy of the Font Software must contain the above copyright +notice and this licence. These can be included either as stand-alone +text files, human-readable headers or in the appropriate machine- +readable metadata fields within text or binary files as long as those +fields can be easily viewed by the user. + +2) The font name complies with the following: +(a) The Original Version must retain its name, unmodified. +(b) Modified Versions which are Substantially Changed must be renamed to +avoid use of the name of the Original Version or similar names entirely. +(c) Modified Versions which are not Substantially Changed must be +renamed to both (i) retain the name of the Original Version and (ii) add +additional naming elements to distinguish the Modified Version from the +Original Version. The name of such Modified Versions must be the name of +the Original Version, with "derivative X" where X represents the name of +the new work, appended to that name. + +3) The name(s) of the Copyright Holder(s) and any contributor to the +Font Software shall not be used to promote, endorse or advertise any +Modified Version, except (i) as required by this licence, (ii) to +acknowledge the contribution(s) of the Copyright Holder(s) or (iii) with +their explicit written permission. + +4) The Font Software, modified or unmodified, in part or in whole, must +be distributed entirely under this licence, and must not be distributed +under any other licence. The requirement for fonts to remain under this +licence does not affect any document created using the Font Software, +except any version of the Font Software extracted from a document +created using the Font Software may only be distributed under this +licence. + +TERMINATION +This licence becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF +COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER +DEALINGS IN THE FONT SOFTWARE. diff --git a/assets/font/Ubuntu-Bold.ttf b/assets/font/Ubuntu-Bold.ttf new file mode 100644 index 0000000..4af149a Binary files /dev/null and b/assets/font/Ubuntu-Bold.ttf differ diff --git a/assets/font/Ubuntu-BoldItalic.ttf b/assets/font/Ubuntu-BoldItalic.ttf new file mode 100644 index 0000000..a68afb6 Binary files /dev/null and b/assets/font/Ubuntu-BoldItalic.ttf differ diff --git a/assets/font/Ubuntu-Italic.ttf b/assets/font/Ubuntu-Italic.ttf new file mode 100644 index 0000000..b022726 Binary files /dev/null and b/assets/font/Ubuntu-Italic.ttf differ diff --git a/assets/font/Ubuntu-Light.ttf b/assets/font/Ubuntu-Light.ttf new file mode 100644 index 0000000..0e9f90d Binary files /dev/null and b/assets/font/Ubuntu-Light.ttf differ diff --git a/assets/font/Ubuntu-LightItalic.ttf b/assets/font/Ubuntu-LightItalic.ttf new file mode 100644 index 0000000..2e007de Binary files /dev/null and b/assets/font/Ubuntu-LightItalic.ttf differ diff --git a/assets/font/Ubuntu-Medium.ttf b/assets/font/Ubuntu-Medium.ttf new file mode 100644 index 0000000..5296045 Binary files /dev/null and b/assets/font/Ubuntu-Medium.ttf differ diff --git a/assets/font/Ubuntu-MediumItalic.ttf b/assets/font/Ubuntu-MediumItalic.ttf new file mode 100644 index 0000000..5dc193d Binary files /dev/null and b/assets/font/Ubuntu-MediumItalic.ttf differ diff --git a/assets/font/Ubuntu-Regular.ttf b/assets/font/Ubuntu-Regular.ttf new file mode 100644 index 0000000..dbb834a Binary files /dev/null and b/assets/font/Ubuntu-Regular.ttf differ diff --git a/assets/images/chora_dark.png b/assets/images/chora_dark.png new file mode 100644 index 0000000..caca714 Binary files /dev/null and b/assets/images/chora_dark.png differ diff --git a/assets/images/chora_dark_background.png b/assets/images/chora_dark_background.png new file mode 100644 index 0000000..aa1fa6b Binary files /dev/null and b/assets/images/chora_dark_background.png differ diff --git a/assets/images/chora_dark_icon.png b/assets/images/chora_dark_icon.png new file mode 100644 index 0000000..b977249 Binary files /dev/null and b/assets/images/chora_dark_icon.png differ diff --git a/assets/images/chora_dark_large.png b/assets/images/chora_dark_large.png new file mode 100644 index 0000000..3328a11 Binary files /dev/null and b/assets/images/chora_dark_large.png differ diff --git a/assets/images/chora_dark_small.png b/assets/images/chora_dark_small.png new file mode 100644 index 0000000..ef8eed7 Binary files /dev/null and b/assets/images/chora_dark_small.png differ diff --git a/assets/images/chora_light.png b/assets/images/chora_light.png new file mode 100644 index 0000000..df0aef6 Binary files /dev/null and b/assets/images/chora_light.png differ diff --git a/assets/images/chora_light_background.png b/assets/images/chora_light_background.png new file mode 100644 index 0000000..20fc1cd Binary files /dev/null and b/assets/images/chora_light_background.png differ diff --git a/assets/images/chora_light_icon.png b/assets/images/chora_light_icon.png new file mode 100644 index 0000000..de0d3f4 Binary files /dev/null and b/assets/images/chora_light_icon.png differ diff --git a/assets/images/chora_light_large.png b/assets/images/chora_light_large.png new file mode 100644 index 0000000..04a6cd4 Binary files /dev/null and b/assets/images/chora_light_large.png differ diff --git a/assets/images/chora_light_small.png b/assets/images/chora_light_small.png new file mode 100644 index 0000000..9258977 Binary files /dev/null and b/assets/images/chora_light_small.png differ diff --git a/assets/images/favicon.ico b/assets/images/favicon.ico new file mode 100644 index 0000000..7fa4473 Binary files /dev/null and b/assets/images/favicon.ico differ diff --git a/bun.lockb b/bun.lockb new file mode 100644 index 0000000..2c73027 Binary files /dev/null and b/bun.lockb differ diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..0abc29d --- /dev/null +++ b/deploy.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env sh + +# abort on errors +set -e + +# clean up previous +rm -rf dist + +# build website +bun run build + +# change to build directory +cd dist + +# create .nojekyll file +touch .nojekyll + +# git init +git init + +# git remote (required for .gitconfig) +git remote add origin git@github.com:chora-io/website.git + +# git commit +git add -A +git commit -m 'publish' + +# push to gh-pages branch +git push origin main:gh-pages -f + +cd - diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..227b212 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1782847189, + "narHash": "sha256-twXPFqFsrrY5r28Zh7Homgcp2gUMBgQ6WDS98Q/3xFI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b6018f87da91d19d0ab4cf979885689b469cdd41", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..b243728 --- /dev/null +++ b/flake.nix @@ -0,0 +1,26 @@ +{ + description = "flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + }; + + outputs = { self, nixpkgs }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in + { + # shell for `nix develop` + devShells.${system}.default = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + bun + ]; + }; + + # packages for `nix build` and `nix run` + packages.${system} = { + + }; + }; +} diff --git a/module.d.ts b/module.d.ts new file mode 100644 index 0000000..6c344ed --- /dev/null +++ b/module.d.ts @@ -0,0 +1 @@ +declare module '*.module.css' diff --git a/next-env.d.ts b/next-env.d.ts new file mode 100644 index 0000000..4f11a03 --- /dev/null +++ b/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/next.config.js b/next.config.js new file mode 100644 index 0000000..6d6c6e3 --- /dev/null +++ b/next.config.js @@ -0,0 +1,8 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = { + distDir: 'dist', + output: 'export', + images: { unoptimized: true }, +} + +module.exports = nextConfig diff --git a/package.json b/package.json new file mode 100644 index 0000000..c551389 --- /dev/null +++ b/package.json @@ -0,0 +1,44 @@ +{ + "name": "website", + "private": true, + "description": "chora website", + "version": "0.0.0", + "homepage": "https://chora.io", + "bugs": { + "url": "https://github.com/chora-io/website/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/chora-io/website" + }, + "scripts": { + "dev": "next dev", + "build": "next build", + "lint": "next lint", + "format": "prettier --write .", + "test": "echo 'test not configured'", + "clean": "rm -rf .next dist node_modules" + }, + "dependencies": { + "gray-matter": "^4", + "next": "^14", + "react": "^18", + "react-dom": "^18", + "remark": "^15", + "remark-html": "^16" + }, + "devDependencies": { + "@types/node": "^20", + "@types/react": "^18", + "@types/react-dom": "^18", + "@typescript-eslint/eslint-plugin": "^6", + "@typescript-eslint/parser": "^6", + "autoprefixer": "^10", + "eslint": "^8", + "eslint-config-next": "^14", + "postcss": "^8", + "prettier": "^3", + "sharp": "^0.33", + "typescript": "^5" + } +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..90d9fff --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + autoprefixer: {}, + }, +} diff --git a/public/CNAME b/public/CNAME new file mode 100644 index 0000000..a1b5eaf --- /dev/null +++ b/public/CNAME @@ -0,0 +1 @@ +chora.io diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..7fa4473 Binary files /dev/null and b/public/favicon.ico differ diff --git a/styles/banner.css b/styles/banner.css new file mode 100644 index 0000000..6eba31c --- /dev/null +++ b/styles/banner.css @@ -0,0 +1,86 @@ +/* banner */ + +.banner { + align-items: center; + display: flex; + font-size: 1.5em; + justify-content: center; + min-height: 10vh; + padding: 2em 0; + text-align: center; +} + +@media (max-width: 850px) { + .banner { + font-size: 1em; + } +} + +.banner h1 { + font-size: 1.75em; + margin-top: 2.5%; + padding: 0.15em 0; +} + +@media (max-width: 850px) { + .banner h1 { + padding: 0.1em 0 !important; + } +} + +.banner p { + padding: 0.2em 0; +} + +@media (max-width: 850px) { + .banner p { + padding: 0.15em 0 !important; + } +} + +.banner p > i { + color: var(--color-theme); +} + +/* banner-full */ + +.banner-full { + composes: banner; + min-height: calc(100vh - var(--header-height)); + padding: 0; +} + +.banner-full > div { + margin-bottom: calc(1% + var(--header-height)); +} + +/* banner-document */ + +.banner-document { + composes: banner; + font-size: 1em; +} + +.banner-document h1 { + color: var(--color-theme); + font-size: 1.5em; + margin: 0.5em 0; +} + +@media (max-width: 850px) { + .banner-document h1 { + font-size: 1.25em; + } +} + +.banner-document h2, +.banner-document h3 { + color: var(--color-text); + font-size: 1em; + font-weight: 300; + opacity: 0.8; +} + +.banner-document h3 { + margin-top: 1em; +} diff --git a/styles/content.css b/styles/content.css new file mode 100644 index 0000000..8d71841 --- /dev/null +++ b/styles/content.css @@ -0,0 +1,78 @@ +/* content */ + +.content { + align-items: center; + background: var(--background-primary); + display: flex; + font-size: 1.2em; + justify-content: center; +} + +@media (max-width: 850px) { + .content { + font-size: 1em; + padding: 0 2em; + } +} + +.content > div { + display: block; + max-width: 650px; + padding: 2em 0 4em 0; +} + +@media (max-width: 850px) { + .content > div { + padding: 1em 0 2em 0; + } +} + +.content > div > h1 { + font-size: 1.8em; + padding: 0.5em 0; +} + +.content > div > h2 { + padding: 0.25em 0; +} + +@media (max-width: 850px) { + .content > div > h2 { + padding-bottom: 0; + } +} + +.content > div > p { + padding: 1em 0; +} + +.content > div > a { + display: block; +} + +.content h2 { + margin: 0.5em 0; +} + +.content ul { + list-style-position: inside; + margin: 0.5em 0 2em 0; +} + +.content li { + line-height: 1.75; +} + +.content hr { + border: 1px solid var(--box-shadow-color); + border-bottom-width: 0; + box-shadow: 0 0 1px var(--box-shadow-color); + margin: 5vh 0; +} + +/* content-full */ + +.content-full { + composes: content; + min-height: calc(100vh - var(--header-height) - var(--footer-height)); +} diff --git a/styles/page.css b/styles/page.css new file mode 100644 index 0000000..efb2492 --- /dev/null +++ b/styles/page.css @@ -0,0 +1,61 @@ +/* page */ + +.page { + margin-top: var(--header-height); + min-height: calc(100vh - var(--header-height) - var(--footer-height)); +} + +/* page-center */ + +.page-center { + composes: page; + align-items: center; + display: flex; + justify-content: center; + text-align: center; +} + +.page-center > div { + margin-bottom: 10vh; +} + +/* page-center-not-found */ + +.page-center-not-found { + composes: page-center; + background: var(--background-primary); +} + +@media (max-width: 850px) { + .page-center-not-found { + padding: 0 1.5em; + } +} + +.page-center-not-found h1 { + color: var(--color-theme); + font-size: 3em; + margin-bottom: 0.25em; +} + +@media (max-width: 850px) { + .page-center-not-found h1 { + font-size: 2em; + } +} + +.page-center-not-found h2 { + font-size: 2em; + font-weight: 300; + margin-bottom: 0.5em; +} + +@media (max-width: 850px) { + .page-center-not-found h2 { + font-size: 1.25em; + } +} + +.page-center-not-found p { + font-style: italic; +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..a4667fd --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,34 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "plugins": [ + { + "name": "next" + } + ], + "paths": { + "@utils": ["utils/index.ts"] + } + }, + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts", + "dist/types/**/*.ts" + ], + "exclude": ["node_modules"] +} diff --git a/utils/getArtifact.ts b/utils/getArtifact.ts new file mode 100644 index 0000000..faf1e2d --- /dev/null +++ b/utils/getArtifact.ts @@ -0,0 +1,27 @@ +import fs from 'fs' +import path from 'path' +import matter from 'gray-matter' +import { remark } from 'remark' +import html from 'remark-html' + +const root = path.join(process.cwd(), 'artifacts') + +export async function getArtifact(dir: string, id: string) { + const fullPath = path.join(root, dir, `${id}.md`) + + // read file contents + const fileContents = fs.readFileSync(fullPath, 'utf8') + + // parse file contents + const { content, data } = matter(fileContents) + + // convert markdown to html + const processedContent = await remark().use(html).process(content) + + // return id, content, and data + return { + id, + content: processedContent.toString(), + ...data, + } as any +} diff --git a/utils/getArtifacts.ts b/utils/getArtifacts.ts new file mode 100644 index 0000000..55bf388 --- /dev/null +++ b/utils/getArtifacts.ts @@ -0,0 +1,31 @@ +import fs from 'fs' +import path from 'path' +import matter from 'gray-matter' + +const root = path.join(process.cwd(), 'artifacts') + +export const getArtifacts = (dir: string) => { + const fileNames = fs.readdirSync(root + '/' + dir) + + const filtered = fileNames.filter((fileName) => fileName.includes(`.md`)) + + return filtered.map((fileName) => { + // set id + const id = fileName.replace(/\.md$/, '') + + // set full path + const fullPath = path.join(root, dir, fileName) + + // read file contents + const fileContents = fs.readFileSync(fullPath, 'utf8') + + // parse file contents + const { data } = matter(fileContents) + + // return id and data + return { + id, + ...data, + } + }) as any[] +} diff --git a/utils/index.ts b/utils/index.ts new file mode 100644 index 0000000..bed4bcc --- /dev/null +++ b/utils/index.ts @@ -0,0 +1,2 @@ +export { getArtifact } from './getArtifact' +export { getArtifacts } from './getArtifacts'