Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.1 #28

Merged
merged 53 commits into from
May 18, 2024
Merged

v1.1 #28

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
1da3b9c
feat: pnpm -> bun
fiveoutofnine Jan 11, 2024
61235c6
chore: add walletconnect project id
fiveoutofnine Mar 24, 2024
fcae71b
chore: update
fiveoutofnine Mar 24, 2024
d1e9126
feat: update deps and delete everything
fiveoutofnine Mar 24, 2024
1571215
feat: update all deps
fiveoutofnine Apr 6, 2024
2343a68
feat: ini nav bar
fiveoutofnine Apr 6, 2024
b1adb3d
feat: add connect button
fiveoutofnine Apr 6, 2024
a1ad234
feat: add header
fiveoutofnine Apr 6, 2024
27e525d
feat: `<ChessFeature />`
fiveoutofnine Apr 6, 2024
16becf9
fix: `font-weight: 300` -> `400`
fiveoutofnine Apr 6, 2024
0c3462d
chore: `FC` -> `React.FC`
fiveoutofnine Apr 6, 2024
76cbbe7
feat: add link features
fiveoutofnine Apr 6, 2024
7df25f0
chore: delete unused code
fiveoutofnine Apr 6, 2024
6b9453c
fix: make nav-bar highlight selected page
fiveoutofnine Apr 15, 2024
e1c5903
refactor: naming
fiveoutofnine Apr 15, 2024
72612a6
feat: error pages
fiveoutofnine Apr 15, 2024
f41b61e
fix: add @fiveoutofnine tweet ID
fiveoutofnine Apr 15, 2024
c04625c
feat: add `<TxDotCoolFeature />` w/o functionality
fiveoutofnine Apr 26, 2024
9789eb5
feat: add `<TypingFeature />` w/o functionality
fiveoutofnine Apr 26, 2024
4a05ed1
perf: move randomization to server-side
fiveoutofnine Apr 26, 2024
6c524e7
fix: add `pino-pretty` as external webpack config
fiveoutofnine Apr 26, 2024
16e2ac0
chore: register base
fiveoutofnine May 7, 2024
59b5b12
feat: add `<ColormapRegistry />`
fiveoutofnine May 7, 2024
f536a48
chore: ini `<RunningFeature />`
fiveoutofnine May 7, 2024
dbc4264
v1.1 UI updates (#29)
fiveoutofnine May 8, 2024
f25f730
Merge branch 'v1.1' of https://github.com/fiveoutofnine/www into v1.1
fiveoutofnine May 8, 2024
787a0ba
chore: bump deps
fiveoutofnine May 8, 2024
f582148
fix: remove unnecessary tooltip
fiveoutofnine May 9, 2024
918c3ec
feat: add multichain sending functionality to tx.cool feature
fiveoutofnine May 10, 2024
c6fb578
chore: update
fiveoutofnine May 10, 2024
3df8acd
chore: update
fiveoutofnine May 10, 2024
b80a079
chore: update
fiveoutofnine May 10, 2024
72703f4
feat: add colormap definitino viewer
fiveoutofnine May 11, 2024
c179e7d
feat: add colormap ID copy
fiveoutofnine May 11, 2024
5f51dcd
feat: ini `<RunningFeature />`
fiveoutofnine May 11, 2024
a453995
feat: add supabase type gen (#30)
fiveoutofnine May 12, 2024
bb8cfad
feat: impl running bar chart
fiveoutofnine May 12, 2024
6a46c7a
fix: hydration
fiveoutofnine May 12, 2024
5fdf63b
fix: display time only to last-updated data
fiveoutofnine May 12, 2024
6269bf4
chore: delete unused file
fiveoutofnine May 12, 2024
a05286f
feat: ini running heatmap
fiveoutofnine May 13, 2024
9c218e9
v1.1 `/design` (#31)
fiveoutofnine May 17, 2024
8a24829
Merge branch 'v1.1' of https://github.com/fiveoutofnine/www into v1.1
fiveoutofnine May 17, 2024
079c315
chore: add blog page
fiveoutofnine May 17, 2024
cb0cdcd
fix: running bar chart tabs
fiveoutofnine May 17, 2024
92e2e0f
feat: add running heatmap
fiveoutofnine May 17, 2024
6f4ad2c
chore: twitter -> X
fiveoutofnine May 17, 2024
6cb4d9e
chore: update bio
fiveoutofnine May 17, 2024
2f491dd
fix: scroll padding
fiveoutofnine May 17, 2024
fd35c96
chore: update
fiveoutofnine May 17, 2024
6725640
fix: close navbar drawer on navigation
fiveoutofnine May 17, 2024
c6a4f92
fix: `ariaLabel` -> `aria-label`
fiveoutofnine May 17, 2024
13002fc
v1.1 `/design` docs (#32)
fiveoutofnine May 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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