Skip to content

Commit

Permalink
v1.1 (#28)
Browse files Browse the repository at this point in the history
* feat: pnpm -> bun

* chore: add walletconnect project id

* chore: update

* feat: update deps and delete everything

* feat: update all deps

* feat: ini nav bar

* feat: add connect button

* feat: add header

* feat: `<ChessFeature />`

* fix: `font-weight: 300` -> `400`

* chore: `FC` -> `React.FC`

* feat: add link features

* chore: delete unused code

* fix: make nav-bar highlight selected page

* refactor: naming

* feat: error pages

* fix: add @fiveoutofnine tweet ID

* feat: add `<TxDotCoolFeature />` w/o functionality

* feat: add `<TypingFeature />` w/o functionality

* perf: move randomization to server-side

* fix: add `pino-pretty` as external webpack config

* chore: register base

* feat: add `<ColormapRegistry />`

* chore: ini `<RunningFeature />`

* v1.1 UI updates (#29)

* chore: ini `<RunningFeature />`

* feat: modernize `<Badge />`

* fix(`Badge />`): use `text-white`/`text-black` on `intent="primary"`

* feat: modernize `<Button />`

* chore: cleaner `@/components/ui` exports

* fix: `<ConnectButton />` button props type error

* feat: modernize `<IconButton />`

* feat: modernize `<Select />`

* feat: modernize `<HoverCard />`

* feat: add `<Avatar />`

* fix: make logo hover styles consistent

* feat: add `<Accordion />`

* feat: add `<Checkbox />`

* chore: update

* feat: add `<Radio />`

* feat: add `<Switch />`

* fix: make checked styles consistent

* fix: `intent="primary"` -> `intent="info"

* chore: update

* chore: update

* feat: add `intent="white"`

* feat: modernize `<Tooltip />`

* feat: modernize `<Toaster />` and `toast`

* chore: update

* feat: add `<TextArea />`

* fix: adjust text area padding

* feat: add `<Input />`

* feat: add `<Popover />`

* feat: modernize `<CodeBlock />`

* feat: add `<Table />`

* feat: add `<Tabs />`

* fix: focus state on logo

* feat: add `<Command />` and `<Dialog />`

* feat: add `<Drawer />`

* feat: add `<Form />`

* feat: add `<Dropdown />`

* fix: dropdown disabled states

* chore: bump deps

* fix: remove unnecessary tooltip

* feat: add multichain sending functionality to tx.cool feature

* chore: update

* chore: update

* chore: update

* feat: add colormap definitino viewer

* feat: add colormap ID copy

* feat: ini `<RunningFeature />`

* feat: add supabase type gen (#30)

* feat: add supabase type gen

* fix: lint

* chore: run lint

* feat: impl running bar chart

* fix: hydration

* fix: display time only to last-updated data

* chore: delete unused file

* feat: ini running heatmap

* v1.1 `/design` (#31)

* feat: ini running heatmap

* feat: ini /design layout

* fix: add more visual hierarchy and consistency to nav bar

* chore: migrate `<DesignPageNav />`

* feat: ini mdx

* feat: ini first page

* feat: ini MDX components

* feat: add `<pre>`

* feat: add `<a>`, `<code>`, `<p>`

* feat: add design component display accordion

* feat: use existing `ToastProps`

* chore: update metadata

* chore: update metadata

* chore: update metadata

* chore: add small animation

* fix: add `backdrop-blur` to `<CodeBlock />` UI actions

* chore: migrate color.mdx

* chore: fix button intent

* fix: color scale hover styles

* chore: update OG image generation to new colors

* chore: delete unused files

* feat: `<Callout />` component

* feat: add metadata export

* docs: update colors

* fix: `code` styles

* chore: add blog page

* fix: running bar chart tabs

* feat: add running heatmap

* chore: twitter -> X

* chore: update bio

* fix: scroll padding

* chore: update

* fix: close navbar drawer on navigation

* fix: `ariaLabel` -> `aria-label`

* v1.1 `/design` docs (#32)

* docs: add /`design/libraries`

* docs: edit `/design/colors` content

* docs: edit `/design/badge` content

* docs: edit `/design/button` content

* docs: add `<CodeBlock />` content

* fix: hard code in display name

* docs: edit `<CodeBlock />` content

* chore: update

* docs: add `<Tooltip />` content

* docs: add `<Toast />` content

* docs: add `<Select />` content

* docs: add `<HoverCard />` content
  • Loading branch information
fiveoutofnine authored May 18, 2024
1 parent 7029233 commit c3b5ae9
Show file tree
Hide file tree
Showing 193 changed files with 17,124 additions and 8,502 deletions.
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ SUPABASE_SERVICE_KEY=''
################################################################################

NEXT_PUBLIC_ALCHEMY_ID=''
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=''
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = {
'next',
'prettier',
],
ignorePatterns: ['/generated/*'],
overrides: [],
parser: '@typescript-eslint/parser',
parserOptions: {
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"editor.rulers": [80, 100],
"editor.tabSize": 2,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"editor.formatOnSave": true,
"eslint.validate": ["javascript", "javascriptreact"],
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 5/9
Copyright (c) 2024 5/9

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**5/9**](https://twitter.com/fiveoutofnine)'s personal website: [**fiveoutofnine.com**](https://fiveoutofnine.com).
[**5/9**](https://x.com/fiveoutofnine)'s personal website: [**fiveoutofnine.com**](https://fiveoutofnine.com).

## Structure

Expand All @@ -9,10 +9,19 @@ The site is divided into 4 categories:
- [`/design`](https://fiveoutofnine.com/design), documentation for my design system.
- Other projects, pages, etc.

## Running Locally
## Local development

### Installation

```sh
git clone https://github.com/fiveoutofnine/www.git
pnpm install
pnpm run dev
```

### Building

```sh
supabase gen types typescript --project-id $PROJECT_ID > generated/database.types.ts
pnpm dlx next build
```
32 changes: 7 additions & 25 deletions components/pages/home/header.tsx → app/(components)/header.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { FC } from 'react';

import { Github, Twitter } from 'lucide-react';
import { Github } from 'lucide-react';

import FiveoutofnineAvatar from '@/components/common/fiveoutofnine-avatar';
import LogoIcon from '@/components/common/logo-icon';
import LinkPreview from '@/components/templates/link-preview';
import { Button } from '@/components/ui';

const FiveoutofnineHeader: FC = () => {
const FiveoutofnineHeader: React.FC = () => {
return (
<div className="flex flex-col items-center rounded-xl border border-gray-6 bg-gray-2 p-3 md:flex-row md:justify-between md:rounded-2xl md:p-6">
<div className="flex w-full items-center">
Expand All @@ -18,16 +17,6 @@ const FiveoutofnineHeader: FC = () => {
<div className="text-base font-semibold md:text-2xl">5/9</div>
<span className="mt-0.5 text-sm text-gray-11 md:mt-1 md:text-base">
Working on{' '}
<LinkPreview
className="font-medium text-gray-12 hover:underline"
href="https://waterfall.market"
src="/static/waterfall-market-preview.webp"
target="_blank"
rel="noreferrer noopener"
>
Waterfall
</LinkPreview>{' '}
and{' '}
<LinkPreview
className="font-medium text-gray-12 hover:underline"
href="https://curta.wtf"
Expand All @@ -44,12 +33,7 @@ const FiveoutofnineHeader: FC = () => {

{/* Links (desktop) */}
<div className="hidden space-x-2 md:flex">
<Button
intent="primary"
href="https://twitter.com/fiveoutofnine"
leftIcon={<Twitter />}
newTab
>
<Button intent="info" href="https://x.com/fiveoutofnine" leftIcon={<LogoIcon.X />} newTab>
Twitter
</Button>
<Button href="https://github.com/fiveoutofnine" leftIcon={<Github />} newTab>
Expand All @@ -60,10 +44,10 @@ const FiveoutofnineHeader: FC = () => {
<div className="mt-4 flex w-full space-x-2 md:hidden">
<Button
size="md"
intent="primary"
intent="info"
className="w-full"
href="https://twitter.com/fiveoutofnine"
leftIcon={<Twitter />}
href="https://x.com/fiveoutofnine"
leftIcon={<LogoIcon.X />}
>
Twitter
</Button>
Expand All @@ -80,6 +64,4 @@ const FiveoutofnineHeader: FC = () => {
);
};

FiveoutofnineHeader.displayName = 'FiveoutofnineHeader';

export default FiveoutofnineHeader;
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import type { FC } from 'react';

import { ExternalLink, PenTool } from 'lucide-react';

import FeatureDisplayMinimal from '@/components/templates/feature-display-minimal';
import { Button } from '@/components/ui';

const BitTwiddlingFeature: FC = () => {
const BitTwiddlingFeature: React.FC = () => {
return (
<FeatureDisplayMinimal
className="col-span-2 w-full min-[960px]:col-span-3"
Expand All @@ -26,6 +24,4 @@ const BitTwiddlingFeature: FC = () => {
);
};

BitTwiddlingFeature.displayName = 'BitTwiddlingFeature';

export default BitTwiddlingFeature;
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import { type FC, useState } from 'react';
'use client';

import { useState } from 'react';

import clsx from 'clsx';
import { ChevronLeft, ChevronRight } from 'lucide-react';

import type { ChessFeature } from '@/lib/types/chess';
import { CHESS_NFT_FALLBACK } from '@/lib/constants/chess-nfts';
import type { ChessFeature } from '@/lib/types/chess';

import ChessPiece from '@/components/common/chess-piece';
import CategoryTag from '@/components/templates/category-tag';
import FeatureDisplay from '@/components/templates/feature-display';
import { Button, IconButton, Tooltip } from '@/components/ui';

const ChessFeature: FC = () => {
const ChessFeature: React.FC = () => {
return (
<FeatureDisplay
className="w-full min-[960px]:w-64 col-span-2"
className="col-span-2 w-full min-[960px]:w-64"
name="Chess"
description="On-chain chess engine"
symbol={
Expand All @@ -35,11 +37,9 @@ const ChessFeature: FC = () => {
</svg>
}
button={
<Tooltip content='WIP'>
<Button size="sm" href="/chess" rightIcon={<ChevronRight />} disabled>
Play
</Button>
</Tooltip>
<Button size="sm" href="/chess" rightIcon={<ChevronRight />} disabled>
Play
</Button>
}
tags={[<CategoryTag key={0} category="NFT" />, <CategoryTag key={1} category="On-chain" />]}
>
Expand All @@ -48,7 +48,7 @@ const ChessFeature: FC = () => {
);
};

const ChessFeatureDetail: FC = () => {
const ChessFeatureDetail: React.FC = () => {
const [nft, setNft] = useState<ChessFeature>(CHESS_NFT_FALLBACK);

const fetchNextMove = async () => {
Expand All @@ -75,44 +75,56 @@ const ChessFeatureDetail: FC = () => {

return (
<div className="relative flex h-full w-full space-x-2 p-2">
<Tooltip content={nft.name}>
<Tooltip content={nft.name} triggerProps={{ asChild: true }} inverted>
<a
className="h-full rounded-lg"
className="h-full min-w-fit overflow-hidden rounded-lg border border-gray-7 transition-colors hover:border-gray-8"
href={`https://etherscan.io/tx/${nft.txHash}`}
style={{
aspectRatio: '1 / 1',
transform: 'scale(0.128)', /* Height is hard-coded, so this should always be `0.128` */
transformOrigin: '0 0',
}}
style={{ aspectRatio: '1 / 1' }}
target="_blank"
rel="noopener noreferrer"
aria-label='View NFT mint transaction on Etherscan'
dangerouslySetInnerHTML={{
__html: Buffer.from(nft.image, 'base64')
.toString()
/* 62.5 = 8 * (1000 / 128) */
.replace('<section', '<section style="border-radius:62.5px"'),
}}
/>
aria-label="View NFT mint transaction on Etherscan"
>
<div
style={{
aspectRatio: '1 / 1',
transform:
'scale(0.124)' /* Height is hard-coded, so this should always be `0.124` */,
transformOrigin: '0 0',
}}
dangerouslySetInnerHTML={{
__html: Buffer.from(nft.image, 'base64')
.toString()
// We replace `<section>` with an ID to tighten the selector.
// There have been issues with `section` selectors being
// erroneously applied to unexpected elements (e.g. extensions).
.replace('<section>', '<section id="__fiveoutofnine-chess-display">')
.replace('}section{', '}section#__fiveoutofnine-chess-display{'),
}}
/>
</a>
</Tooltip>
<IconButton
className="absolute bottom-2.5 left-1"
size="sm"
onClick={fetchPrevMove}
disabled={nft.tokenId === 0}
aria-label='View previous move'
<Tooltip content="Previous move" align="start" triggerProps={{ asChild: true }} inverted>
<IconButton
className="absolute bottom-3 left-1"
size="sm"
onClick={fetchPrevMove}
disabled={nft.tokenId === 0}
aria-label="View previous move"
>
<ChevronLeft />
</IconButton>
<IconButton
className="absolute bottom-2.5 left-[6.25rem]"
size="sm"
onClick={fetchNextMove}
disabled={nft.tokenId === 100}
aria-label='View next move'
<ChevronLeft />
</IconButton>
</Tooltip>
<Tooltip content="Next move" align="end" triggerProps={{ asChild: true }} inverted>
<IconButton
className="absolute bottom-3 left-[6.125rem]"
size="sm"
onClick={fetchNextMove}
disabled={nft.tokenId === 100}
aria-label="View next move"
>
<ChevronRight />
</IconButton>
<ChevronRight />
</IconButton>
</Tooltip>

<div className="flex w-full flex-col justify-between">
<div className="mx-auto grid w-[96px] grid-cols-6 grid-rows-6 overflow-hidden rounded border border-gray-6">
Expand All @@ -134,49 +146,49 @@ const ChessFeatureDetail: FC = () => {
<div
key={index}
className={clsx(
'flex h-4 w-4 items-center justify-center text-[0.5rem]',
'flex size-4 items-center justify-center text-[0.5rem]',
pieceOverlap > 1
? 'bg-purple-9'
: nft.userMove.from === index
? 'bg-blue-3'
: nft.userMove.to === index
? 'bg-blue-9'
: nft.contractMove.from === index
? 'bg-red-3'
: nft.contractMove.to === index
? 'bg-red-9'
: (2709 >> index % 12) & 1
? 'bg-gray-9'
: 'bg-gray-4',
? 'bg-blue-3'
: nft.userMove.to === index
? 'bg-blue-9'
: nft.contractMove.from === index
? 'bg-red-3'
: nft.contractMove.to === index
? 'bg-red-9'
: (2709 >> index % 12) & 1
? 'bg-gray-9'
: 'bg-gray-4',
)}
>
{piece === '1' || piece === '9' ? (
<ChessPiece.Pawn className={clsx('h-3 w-3', pieceColor)} />
<ChessPiece.Pawn className={clsx('size-3', pieceColor)} />
) : piece === '2' || piece === 'a' ? (
<ChessPiece.Bishop className={clsx('h-3 w-3', pieceColor)} />
<ChessPiece.Bishop className={clsx('size-3', pieceColor)} />
) : piece === '3' || piece === 'b' ? (
<ChessPiece.Rook className={clsx('h-3 w-3', pieceColor)} />
<ChessPiece.Rook className={clsx('size-3', pieceColor)} />
) : piece === '4' || piece === 'c' ? (
<ChessPiece.Knight className={clsx('h-3 w-3', pieceColor)} />
<ChessPiece.Knight className={clsx('size-3', pieceColor)} />
) : piece === '5' || piece === 'd' ? (
<ChessPiece.Queen className={clsx('h-3 w-3', pieceColor)} />
<ChessPiece.Queen className={clsx('size-3', pieceColor)} />
) : piece === '6' || piece === 'e' ? (
<ChessPiece.King className={clsx('h-3 w-3', pieceColor)} />
<ChessPiece.King className={clsx('size-3', pieceColor)} />
) : null}
</div>
);
})}
</div>
<div className="flex justify-between text-[0.5rem] font-medium">
<div>
<div className="text-blue-9">User</div>
<div className="text-blue-11">User</div>
<div className="text-gray-12">
{getPieceNotation(nft.userMove.from)} <span className="text-gray-11">-&gt;</span>{' '}
{getPieceNotation(nft.userMove.to)}
</div>
</div>
<div className="flex flex-col items-end">
<div className="text-red-9">Contract</div>
<div className="text-red-11">Contract</div>
<div className="text-gray-12">
{getPieceNotation(nft.contractMove.from)} <span className="text-gray-11">-&gt;</span>{' '}
{getPieceNotation(nft.contractMove.to)}
Expand Down
Loading

0 comments on commit c3b5ae9

Please sign in to comment.