From a5099f088bc223ad459ee65a4f705e9ab4eccc35 Mon Sep 17 00:00:00 2001 From: Orion Reed Date: Wed, 27 Mar 2024 04:08:02 -0700 Subject: [PATCH] Added "things I made recently" section --- src/components/Default.tsx | 23 +++++++++++++++++++---- src/css/style.css | 9 +++++---- src/hooks/useCanvas.ts | 2 +- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/components/Default.tsx b/src/components/Default.tsx index ac6d4d2..c2686cd 100644 --- a/src/components/Default.tsx +++ b/src/components/Default.tsx @@ -37,20 +37,35 @@ export function Default() { ***

Talks

- +

Writing

- + +

Things I made recently

+
    +
  1. Tiny 3D HTML/DOM viewer (you can paste it into your console) +
  2. +
  3. DOM to canvas translation (it's that button in the top right of this page) +
  4. +
  5. Constraint-based graph layout in tldraw +
  6. +
  7. Physics in tldraw +
  8. +
); } diff --git a/src/css/style.css b/src/css/style.css index 0be517b..e2ef291 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -84,10 +84,9 @@ p a { margin-bottom: 0em; } -ul { +ol { padding-left: 0; font-size: 1rem; - list-style: decimal-leading-zero; & li::marker { color: rgba(0, 0, 0, 0.322); } @@ -134,7 +133,7 @@ ul { header { margin-bottom: 1em; } - ul { + ol { list-style-position: inside; } } @@ -147,9 +146,11 @@ ul { p, span, header, - ul { + ul, + ol { margin: 0; } + & header { font-size: 1.5rem; } diff --git a/src/hooks/useCanvas.ts b/src/hooks/useCanvas.ts index 6d01834..f68b1ec 100644 --- a/src/hooks/useCanvas.ts +++ b/src/hooks/useCanvas.ts @@ -52,7 +52,7 @@ async function gatherElementsInfo() { if (['BUTTON'].includes(child.tagName)) continue; const rect = child.getBoundingClientRect(); let w = rect.width; - if (!['P', 'UL'].includes(child.tagName)) { + if (!['P', 'UL', 'OL'].includes(child.tagName)) { w = measureElementTextWidth(child as HTMLElement); } // Check if the element is centered