Most blogging tools give you a text box and a theme. Journal gives you a notes app where a note can hold a chart, a 3D island or a little painting machine, and then lets you publish that note from your own Homebase, at your own address.
This post is a tour. Everything on this page, from the photos to the island you can spin, lives in a single note.
import { Card, CardHeader, CardTitle, CardDescription, CardContent, Slider, Switch, Badge, Progress } from 'journal-ui';
import { Clock, Coffee } from 'lucide-react';
const WORDS = 850;
const BLOCKS = 7;
export default function App() {
const [wpm, setWpm] = useState([230]);
const [play, setPlay] = useState(true);
const minutes = Math.max(1, Math.round(WORDS / wpm[0] + (play ? BLOCKS * 1.5 : 0)));
const label = minutes <= 6 ? 'A quick read' : minutes <= 15 ? 'A coffee read' : 'A long lunch';
return (
<Card>
<CardHeader>
<CardTitle className="flex items-center gap-2">
<Clock className="size-5 text-muted-foreground" /> How long will this take?
</CardTitle>
<CardDescription>This card is built from Journal's own UI kit: a slider, a switch, a badge and a progress bar.</CardDescription>
</CardHeader>
<CardContent className="space-y-4">
<div className="space-y-2">
<div className="flex justify-between text-sm">
<span>Reading speed</span>
<span className="tabular-nums text-muted-foreground">{wpm[0]} words a minute</span>
</div>
<Slider value={wpm} onValueChange={setWpm} min={120} max={450} step={10} />
</div>
<label className="flex items-center gap-3 text-sm cursor-pointer">
<Switch checked={play} onCheckedChange={setPlay} /> Include time for playing with the blocks
</label>
<div className="flex items-end justify-between gap-3 flex-wrap">
<div>
<span className="text-4xl font-semibold tabular-nums">{minutes}</span>
<span className="ml-1 text-muted-foreground">minutes</span>
</div>
<Badge variant="secondary" className="gap-1">
<Coffee className="size-3" /> {label}
</Badge>
</div>
<Progress value={Math.min(100, (minutes / 30) * 100)} />
</CardContent>
</Card>
);
}
Before anything moves, a post is writing. Journal keeps that part plain: headings, bold, italic, second thoughts, code, quotes and links, all saved as ordinary markdown that you can take anywhere.
A good post is mostly words. The interactive parts should earn their place by showing something the words can't.
When you need more structure, a note has blocks for it:
Block | Good for |
|---|---|
Callouts | Tips, warnings and asides |
Toggles | Detail that only some readers want |
Tables | Comparisons, like this one |
Math | Formulas, typeset properly |
Footnotes | Sources and side notes[1] |
Task lists | Plans and checklists |
Mermaid | Diagrams from a few lines of text |
HTML and React | Anything that moves |
The daylight chart further down uses the sunrise equation. Journal typesets it for you:
\cos \omega_0 = \frac{\sin(-0.83^\circ) - \sin\varphi \, \sin\delta}{\cos\varphi \, \cos\delta}
Here \varphi is your latitude, \delta is the sun's angle above the equator that day, and \omega_0 is how far the earth turns between sunrise and noon.
Homebase is your own place on the web, at an address you own. Your notes, photos and messages are stored there, encrypted, instead of on someone else's servers. Journal keeps its notes in your Homebase, and sharing a note publishes it from there. There is no Journal server in the middle holding a copy.
A photo sits in the text column, with its caption underneath.
Put several photos on one line and they become a gallery. A carousel shows one at a time: swipe, or use the arrows.
A grid lays them out as tiles, three across, or two on a phone.
The cover at the top isn't a photo. It's generated: layers of hills drawn in Journal's own colours. It also has a night-time version for the dark theme, so switch your theme and look up.
A diagram is a few lines of text, and Journal draws it in the note's colours. This is how this very post got from my keyboard to you:
flowchart LR
A[I write in Journal] --> B[(My Homebase)]
C[Claude, through Journal MCP] -->|only the folders I grant| B
B -->|Share| D[A public page at my own address]
D --> E[You, on any device]
An SVG block holds a fixed drawing, like this small home on a hill:
<svg viewBox="0 0 640 220" xmlns="http://www.w3.org/2000/svg">
<circle cx="520" cy="62" r="26" fill="#BF9F68" opacity="0.9"/>
<path d="M0 190 C 120 120, 220 120, 330 150 S 540 200, 640 150 L 640 220 L 0 220 Z" fill="#86977D"/>
<path d="M0 205 C 140 170, 300 175, 420 195 S 600 215, 640 200 L 640 220 L 0 220 Z" fill="#718968"/>
<g transform="translate(250 92)">
<rect x="0" y="36" width="80" height="58" rx="3" fill="#8A5344"/>
<path d="M-10 40 L40 4 L90 40 Z" fill="#4F7A96"/>
<rect x="12" y="52" width="20" height="18" rx="2" fill="#F1D9A8"/>
<rect x="48" y="58" width="18" height="36" rx="2" fill="#5E3A30"/>
<rect x="58" y="10" width="10" height="20" fill="#5E3A30"/>
</g>
<g fill="#4F7A96" opacity="0.8">
<path d="M90 150 l14 -40 l14 40 Z"/>
<path d="M118 150 l12 -32 l12 32 Z"/>
<path d="M470 168 l14 -40 l14 40 Z"/>
</g>
</svg>
A chart is best when it lets the reader ask their own question. Pick two cities and compare how much daylight each gets through the year. The dashed line is today.
import { ResponsiveContainer, AreaChart, Area, XAxis, YAxis, Tooltip, ReferenceLine, CartesianGrid } from 'recharts';
import { Select, SelectItem } from 'journal-ui';
import { Sun, Sunset } from 'lucide-react';
const CITIES = {
tromso: { name: 'Tromsø', lat: 69.65 },
copenhagen: { name: 'Copenhagen', lat: 55.68 },
berlin: { name: 'Berlin', lat: 52.52 },
rome: { name: 'Rome', lat: 41.9 },
nairobi: { name: 'Nairobi', lat: -1.29 },
sydney: { name: 'Sydney', lat: -33.87 },
};
const MONTH_STARTS = [1, 32, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
const MONTH_LETTERS = 'JFMAMJJASOND';
const RAD = Math.PI / 180;
function dayLength(lat, n) {
const decl = 23.44 * RAD * Math.sin((2 * Math.PI * (284 + n)) / 365);
const phi = lat * RAD;
const c = (Math.sin(-0.833 * RAD) - Math.sin(phi) * Math.sin(decl)) / (Math.cos(phi) * Math.cos(decl));
if (c >= 1) return 0;
if (c <= -1) return 24;
return (2 * Math.acos(c)) / RAD / 15;
}
function hm(h) {
let hh = Math.floor(h);
let mm = Math.round((h - hh) * 60);
if (mm === 60) { hh += 1; mm = 0; }
return `${hh}h ${String(mm).padStart(2, '0')}m`;
}
function dayOfYear(d) {
return Math.min(365, Math.floor((d - new Date(d.getFullYear(), 0, 0)) / 86400000));
}
function dateLabel(n) {
return new Date(2026, 0, n).toLocaleDateString('en-GB', { day: 'numeric', month: 'short' });
}
function Stats({ city, data, k, today, color }) {
const values = data.map((d) => d[k]);
return (
<div className="rounded-lg bg-muted p-3 text-sm space-y-1">
<div className="flex items-center gap-2 font-semibold">
<span className="inline-block size-3 rounded-full" style={{ background: color }} />
{city.name}
</div>
<div className="flex justify-between gap-2"><span className="text-muted-foreground">Today</span><span className="tabular-nums">{hm(values[today - 1])}</span></div>
<div className="flex justify-between gap-2"><span className="text-muted-foreground">Longest day</span><span className="tabular-nums">{hm(Math.max(...values))}</span></div>
<div className="flex justify-between gap-2"><span className="text-muted-foreground">Shortest day</span><span className="tabular-nums">{hm(Math.min(...values))}</span></div>
</div>
);
}
export default function App() {
const [a, setA] = useState('copenhagen');
const [b, setB] = useState('rome');
const today = dayOfYear(new Date());
const data = useMemo(
() => Array.from({ length: 365 }, (_, i) => ({ n: i + 1, a: dayLength(CITIES[a].lat, i + 1), b: dayLength(CITIES[b].lat, i + 1) })),
[a, b]
);
const options = Object.entries(CITIES).map(([k, c]) => <SelectItem key={k} value={k}>{c.name}</SelectItem>);
return (
<div className="space-y-3">
<div className="flex flex-wrap items-center gap-2 text-sm">
<Sun className="size-4 text-muted-foreground" />
<Select value={a} onValueChange={setA}>{options}</Select>
<span className="text-muted-foreground">against</span>
<Select value={b} onValueChange={setB}>{options}</Select>
</div>
<ResponsiveContainer width="100%" height={240}>
<AreaChart data={data} margin={{ top: 16, right: 12, left: 0, bottom: 0 }}>
<CartesianGrid vertical={false} strokeDasharray="2 4" />
<XAxis dataKey="n" type="number" domain={[1, 365]} ticks={MONTH_STARTS} tickFormatter={(n) => MONTH_LETTERS[MONTH_STARTS.indexOf(n)]} tickLine={false} />
<YAxis domain={[0, 24]} ticks={[0, 6, 12, 18, 24]} tickFormatter={(v) => `${v}h`} width={36} tickLine={false} axisLine={false} />
<Tooltip labelFormatter={dateLabel} formatter={(v, name) => [hm(v), name]} />
<ReferenceLine x={today} stroke="var(--muted-foreground)" strokeDasharray="4 4" label={{ value: 'Today', position: 'top', fill: 'var(--muted-foreground)', fontSize: 11 }} />
<Area type="monotone" dataKey="a" name={CITIES[a].name} strokeWidth={2} fillOpacity={0.25} dot={false} />
<Area type="monotone" dataKey="b" name={CITIES[b].name} strokeWidth={2} fillOpacity={0.25} dot={false} />
</AreaChart>
</ResponsiveContainer>
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(170px, 1fr))', gap: 8 }}>
<Stats city={CITIES[a]} data={data} k="a" today={today} color="var(--chart-2)" />
<Stats city={CITIES[b]} data={data} k="b" today={today} color="var(--chart-3)" />
</div>
<p className="flex items-center gap-1 text-xs text-muted-foreground">
<Sunset className="size-3" /> Computed from the sunrise equation above, so it can be a few minutes off what an almanac says.
</p>
</div>
);
}
Some ideas are easier to feel than to read. Here, each dot is a home and each line is two homes talking to each other directly, with no server in the middle. Drag a home around, or tap one to see who it talks to. (That's the idea behind The honeypot problem.)
import * as d3 from 'd3';
import { Button } from 'journal-ui';
import { Shuffle } from 'lucide-react';
const NAMES = ['Ana', 'Ben', 'Chloé', 'Dev', 'Emil', 'Frida', 'Gus', 'Hana', 'Ivo', 'Jun', 'Kai', 'Lea', 'Mo', 'Nia', 'Oskar', 'Pia', 'Rui', 'Sol'];
function makeGraph(seed) {
const rnd = d3.randomLcg(seed);
const nodes = NAMES.map((name, i) => ({ id: i, name, group: i % 4 }));
const links = [];
const seen = new Set();
const add = (s, t) => {
if (s === t) return;
const key = s < t ? `${s}-${t}` : `${t}-${s}`;
if (seen.has(key)) return;
seen.add(key);
links.push({ source: s, target: t });
};
for (let i = 1; i < nodes.length; i++) add(i, Math.floor(rnd() * i));
for (let k = 0; k < 9; k++) add(Math.floor(rnd() * nodes.length), Math.floor(rnd() * nodes.length));
return { nodes, links };
}
export default function App() {
const wrap = useRef(null);
const svgRef = useRef(null);
const [seed, setSeed] = useState(0.42);
const [width, setWidth] = useState(0);
const [info, setInfo] = useState('Tap a home.');
useEffect(() => {
const ro = new ResizeObserver(([entry]) => setWidth(Math.round(entry.contentRect.width)));
ro.observe(wrap.current);
return () => ro.disconnect();
}, []);
useEffect(() => {
if (!width) return;
const height = Math.round(Math.max(280, Math.min(420, width * 0.62)));
const svg = d3.select(svgRef.current).attr('viewBox', [0, 0, width, height]).attr('width', width).attr('height', height);
svg.selectAll('*').remove();
const { nodes, links } = makeGraph(seed);
const sim = d3
.forceSimulation(nodes)
.force('link', d3.forceLink(links).id((d) => d.id).distance(Math.min(64, width / 9)))
.force('charge', d3.forceManyBody().strength(-200))
.force('x', d3.forceX(width / 2).strength(0.07))
.force('y', d3.forceY(height / 2).strength(0.12))
.force('collide', d3.forceCollide(24));
const link = svg.append('g').selectAll('line').data(links).join('line')
.style('stroke', 'var(--border)').style('stroke-width', 1.5);
const node = svg.append('g').selectAll('g').data(nodes).join('g').style('cursor', 'grab');
node.append('circle').attr('r', 13)
.style('fill', (d) => `var(--chart-${2 + d.group})`)
.style('stroke', 'var(--background)').style('stroke-width', 2.5);
node.append('text').text((d) => d.name).attr('y', 28).attr('text-anchor', 'middle')
.style('font-size', '11px').style('fill', 'var(--muted-foreground)');
node.on('click', (event, d) => {
const near = links.filter((l) => l.source === d || l.target === d).map((l) => (l.source === d ? l.target : l.source));
link.style('stroke', (l) => (l.source === d || l.target === d ? 'var(--foreground)' : 'var(--border)'))
.style('stroke-width', (l) => (l.source === d || l.target === d ? 2.5 : 1.5));
node.select('circle').style('stroke', (n) => (n === d ? 'var(--foreground)' : 'var(--background)'));
setInfo(`${d.name} talks directly to ${near.map((n) => n.name).join(', ')}. Nobody else sees those messages.`);
});
node.call(
d3.drag()
.on('start', (event, d) => { if (!event.active) sim.alphaTarget(0.3).restart(); d.fx = d.x; d.fy = d.y; })
.on('drag', (event, d) => { d.fx = event.x; d.fy = event.y; })
.on('end', (event, d) => { if (!event.active) sim.alphaTarget(0); d.fx = null; d.fy = null; })
);
sim.on('tick', () => {
for (const d of nodes) {
d.x = Math.max(18, Math.min(width - 18, d.x));
d.y = Math.max(18, Math.min(height - 32, d.y));
}
link.attr('x1', (d) => d.source.x).attr('y1', (d) => d.source.y).attr('x2', (d) => d.target.x).attr('y2', (d) => d.target.y);
node.attr('transform', (d) => `translate(${d.x},${d.y})`);
});
setInfo('Tap a home.');
return () => sim.stop();
}, [seed, width]);
return (
<div ref={wrap} className="space-y-2">
<svg ref={svgRef} style={{ display: 'block', width: '100%', touchAction: 'none' }} />
<div className="flex items-center justify-between gap-3 flex-wrap">
<p className="text-sm text-muted-foreground flex-1" aria-live="polite">{info}</p>
<Button size="sm" variant="outline" onClick={() => setSeed(Math.random())}>
<Shuffle className="size-4" /> New neighbourhood
</Button>
</div>
</div>
);
}
A block can draw in 3D, too. Here is a small island, raised fresh from a random seed each time you ask. Drag sideways to turn it.
import * as THREE from 'three';
import { Button } from 'journal-ui';
import { Mountain } from 'lucide-react';
function rng(seed) {
let s = seed >>> 0;
return () => {
s = (s + 0x6d2b79f5) >>> 0;
let t = Math.imul(s ^ (s >>> 15), 1 | s);
t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
};
}
function makeHeight(seed) {
const r = rng(seed);
const waves = Array.from({ length: 8 }, (_, i) => {
const f = 0.5 + i * 0.45;
const angle = r() * Math.PI * 2;
return { fx: Math.cos(angle) * f, fz: Math.sin(angle) * f, p: r() * Math.PI * 2, a: 0.55 / (1 + i * 0.8) };
});
return (x, z) => {
const d = Math.sqrt(x * x + z * z) / 4.4;
const mask = Math.max(0, 1 - d * d);
let n = 0;
for (const w of waves) n += w.a * Math.sin(w.fx * x + w.fz * z + w.p);
return Math.max(-0.35, mask * mask * (1.5 + 1.1 * n) - 0.3);
};
}
const SAND = new THREE.Color('#d8c08f');
const GRASS = new THREE.Color('#86977d');
const FOREST = new THREE.Color('#55684f');
const ROCK = new THREE.Color('#8b8478');
const SNOW = new THREE.Color('#f1ede2');
function colourFor(h) {
if (h < 0.08) return SAND;
if (h < 0.7) return GRASS;
if (h < 1.35) return FOREST;
if (h < 1.8) return ROCK;
return SNOW;
}
export default function App() {
const mount = useRef(null);
const [seed, setSeed] = useState(20261124);
useEffect(() => {
const el = mount.current;
const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
renderer.setPixelRatio(Math.min(2, window.devicePixelRatio || 1));
renderer.setClearColor(0x000000, 0);
el.appendChild(renderer.domElement);
renderer.domElement.style.display = 'block';
renderer.domElement.style.touchAction = 'pan-y';
renderer.domElement.style.cursor = 'grab';
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(34, 1, 0.1, 100);
camera.position.set(0, 7, 12.5);
camera.lookAt(0, 0.3, 0);
scene.add(new THREE.HemisphereLight(0xdfe8ef, 0x55684f, 1.1));
const sun = new THREE.DirectionalLight(0xfff1dc, 2.2);
sun.position.set(6, 9, 4);
scene.add(sun);
const island = new THREE.Group();
scene.add(island);
const height = makeHeight(seed);
const geo = new THREE.PlaneGeometry(10, 10, 72, 72);
geo.rotateX(-Math.PI / 2);
const pos = geo.attributes.position;
const colours = new Float32Array(pos.count * 3);
for (let i = 0; i < pos.count; i++) {
const h = height(pos.getX(i), pos.getZ(i));
pos.setY(i, h);
colourFor(h).toArray(colours, i * 3);
}
geo.setAttribute('color', new THREE.BufferAttribute(colours, 3));
geo.computeVertexNormals();
const land = new THREE.Mesh(geo, new THREE.MeshStandardMaterial({ vertexColors: true, flatShading: true, roughness: 0.95 }));
island.add(land);
const waterGeo = new THREE.CircleGeometry(5.6, 64);
waterGeo.rotateX(-Math.PI / 2);
const water = new THREE.Mesh(waterGeo, new THREE.MeshStandardMaterial({ color: 0x4f7a96, transparent: true, opacity: 0.8, roughness: 0.25, metalness: 0.1 }));
water.position.y = 0.02;
island.add(water);
const resize = () => {
const w = el.clientWidth;
const h = Math.round(Math.max(240, Math.min(440, w * 0.6)));
renderer.setSize(w, h);
camera.aspect = w / h;
camera.updateProjectionMatrix();
};
const ro = new ResizeObserver(resize);
ro.observe(el);
resize();
const still = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
let dragging = false;
let lastX = 0;
const down = (e) => { dragging = true; lastX = e.clientX; renderer.domElement.setPointerCapture(e.pointerId); };
const move = (e) => { if (!dragging) return; island.rotation.y += (e.clientX - lastX) * 0.01; lastX = e.clientX; };
const up = () => { dragging = false; };
renderer.domElement.addEventListener('pointerdown', down);
renderer.domElement.addEventListener('pointermove', move);
renderer.domElement.addEventListener('pointerup', up);
renderer.domElement.addEventListener('pointercancel', up);
let raf = 0;
let last = performance.now();
const loop = (now) => {
const dt = (now - last) / 1000;
last = now;
if (!dragging && !still) island.rotation.y += dt * 0.15;
renderer.render(scene, camera);
raf = requestAnimationFrame(loop);
};
raf = requestAnimationFrame(loop);
return () => {
cancelAnimationFrame(raf);
ro.disconnect();
geo.dispose();
waterGeo.dispose();
land.material.dispose();
water.material.dispose();
renderer.dispose();
el.removeChild(renderer.domElement);
};
}, [seed]);
return (
<div className="space-y-2">
<div ref={mount} />
<div className="flex items-center justify-between gap-3 flex-wrap">
<span className="text-sm text-muted-foreground">Island no. {seed}</span>
<Button size="sm" variant="outline" onClick={() => setSeed(Math.floor(Math.random() * 1e8))}>
<Mountain className="size-4" /> Raise a new island
</Button>
</div>
</div>
);
}
Blocks can also be small tools. This one is a calculator that understands units. Try one of the examples, or type your own.
import { evaluate, format } from 'mathjs';
import { Input, Button } from 'journal-ui';
import { Calculator } from 'lucide-react';
const EXAMPLES = ['5 km / 25 minutes to km/h', '2 cups to ml', '180 lb to kg', '20 degC to degF', '3 feet + 4 inch to cm', 'sqrt(3^2 + 4^2) m to inch'];
export default function App() {
const [expr, setExpr] = useState(EXAMPLES[0]);
const result = useMemo(() => {
if (!expr.trim()) return { text: '' };
try {
const value = evaluate(expr);
if (typeof value === 'function') return { error: 'That is a function, not a value.' };
return { text: format(value, { precision: 6 }) };
} catch (e) {
return { error: e.message };
}
}, [expr]);
return (
<div className="space-y-3">
<div className="flex items-center gap-2">
<Calculator className="size-5 shrink-0 text-muted-foreground" />
<Input value={expr} onChange={(e) => setExpr(e.target.value)} aria-label="Expression" className="font-mono" />
</div>
<div className="rounded-lg bg-muted p-4 min-h-16" aria-live="polite">
{result.error ? (
<p className="text-sm text-muted-foreground">{result.error}</p>
) : (
<p className="text-2xl font-semibold tabular-nums break-words">{result.text}</p>
)}
</div>
<div className="flex flex-wrap gap-2">
{EXAMPLES.map((x) => (
<Button key={x} size="sm" variant="secondary" onClick={() => setExpr(x)} className="font-mono text-xs">
{x}
</Button>
))}
</div>
</div>
);
}
A block can remember things. Paste a few rows from a spreadsheet and they turn into a chart. When I edit the data, it's saved with the note. You can change it too, but your version goes away when you reload the page. The sample numbers are made up.
import Papa from 'papaparse';
import { ResponsiveContainer, BarChart, Bar, XAxis, YAxis, Tooltip, Legend, CartesianGrid } from 'recharts';
import { Button } from 'journal-ui';
import { RotateCcw, Table } from 'lucide-react';
const SAMPLE = `Month,Walks,Swims
Jan,12,2
Feb,15,3
Mar,18,4
Apr,22,6
May,26,9
Jun,24,14`;
export default function App() {
const [text, setText] = useState(SAMPLE);
useEffect(() => {
window.journal?.storage.get('csv').then((saved) => {
if (typeof saved === 'string') setText(saved);
}).catch(() => {});
}, []);
const update = (value) => {
setText(value);
window.journal?.storage.set('csv', value).catch(() => {});
};
const { rows, xKey, series } = useMemo(() => {
const parsed = Papa.parse(text.trim(), { header: true, dynamicTyping: true, skipEmptyLines: true });
const fields = parsed.meta.fields || [];
const numeric = fields.slice(1).filter((f) => parsed.data.some((r) => typeof r[f] === 'number')).slice(0, 4);
return { rows: parsed.data, xKey: fields[0], series: numeric };
}, [text]);
return (
<div className="space-y-3">
<label className="flex items-center gap-2 text-sm font-semibold" htmlFor="csv-input">
<Table className="size-4 text-muted-foreground" /> Your data, comma-separated
</label>
<textarea id="csv-input" value={text} onChange={(e) => update(e.target.value)} rows={7} spellCheck={false} className="w-full font-mono text-sm" />
{series.length ? (
<ResponsiveContainer width="100%" height={240}>
<BarChart data={rows} margin={{ top: 8, right: 12, left: 0, bottom: 0 }}>
<CartesianGrid vertical={false} strokeDasharray="2 4" />
<XAxis dataKey={xKey} tickLine={false} />
<YAxis width={36} tickLine={false} axisLine={false} />
<Tooltip cursor={{ fill: 'var(--muted)' }} />
<Legend />
{series.map((s) => <Bar key={s} dataKey={s} radius={[4, 4, 0, 0]} />)}
</BarChart>
</ResponsiveContainer>
) : (
<p className="text-sm text-muted-foreground">Add a header row and at least one column of numbers.</p>
)}
<Button size="sm" variant="ghost" onClick={() => update(SAMPLE)} disabled={text === SAMPLE}>
<RotateCcw className="size-4" /> Back to the sample
</Button>
</div>
);
}
And a block doesn't have to be React. This one is plain HTML, a canvas and a few lines of script: a painting machine. Every press paints something new, in the note's colours. Keep this one saves the painting's seed in the note, so the next visitor sees the one I liked best.
<canvas id="art" style="display:block;width:100%;border-radius:var(--radius)"></canvas>
<div style="display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:10px">
<button id="again">Paint another</button>
<button id="keep">Keep this one</button>
<span id="status" style="color:var(--muted-foreground);font-size:13px"></span>
</div>
<script>
const canvas = document.getElementById('art');
const ctx = canvas.getContext('2d');
const status = document.getElementById('status');
const css = (name) => getComputedStyle(document.documentElement).getPropertyValue(name).trim();
let seed = 20261124;
let raf = 0;
let drawnWidth = 0;
function rng(s) {
return () => {
s = (s + 0x6d2b79f5) | 0;
let t = Math.imul(s ^ (s >>> 15), 1 | s);
t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
};
}
function paint() {
cancelAnimationFrame(raf);
const w = canvas.clientWidth;
if (!w) return;
drawnWidth = w;
const h = Math.round(Math.max(220, Math.min(400, w * 0.56)));
const dpr = Math.min(2, window.devicePixelRatio || 1);
canvas.width = w * dpr;
canvas.height = h * dpr;
canvas.style.height = h + 'px';
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
ctx.globalAlpha = 1;
ctx.fillStyle = css('--muted') || '#eeeae2';
ctx.fillRect(0, 0, w, h);
const r = rng(seed);
const colours = ['--chart-2', '--chart-3', '--chart-4', '--chart-5'].map(css).map((c, i) => c || ['#8a5344', '#718968', '#9d7f42', '#4f7a96'][i]);
const waves = Array.from({ length: 4 }, () => ({ a: 0.002 + r() * 0.007, b: 0.002 + r() * 0.007, p: r() * 6.283 }));
const angle = (x, y) => waves.reduce((s, k) => s + Math.sin(x * k.a + k.p) + Math.cos(y * k.b - k.p), 0) * 1.2;
const groups = colours.map((c) => ({ c, parts: [] }));
for (let i = 0; i < 1100; i++) {
groups[Math.floor(r() * groups.length)].parts.push({ x: r() * w, y: r() * h, life: 50 + r() * 160 });
}
ctx.lineWidth = 1.1;
ctx.lineCap = 'round';
ctx.globalAlpha = 0.32;
let frame = 0;
const step = () => {
for (const g of groups) {
ctx.strokeStyle = g.c;
ctx.beginPath();
for (const p of g.parts) {
if (p.life-- <= 0) continue;
const a = angle(p.x, p.y);
ctx.moveTo(p.x, p.y);
p.x += Math.cos(a) * 1.7;
p.y += Math.sin(a) * 1.7;
ctx.lineTo(p.x, p.y);
}
ctx.stroke();
}
if (++frame < 210) raf = requestAnimationFrame(step);
};
step();
status.textContent = 'Painting no. ' + seed;
}
document.getElementById('again').onclick = () => {
seed = Math.floor(Math.random() * 1e8);
paint();
};
document.getElementById('keep').onclick = () => {
journal.storage.set('seed', seed).then(
() => { status.textContent = 'Kept painting no. ' + seed + '.'; },
() => { status.textContent = 'Could not keep it, sorry.'; }
);
};
new ResizeObserver(() => {
if (Math.abs(canvas.clientWidth - drawnWidth) > 1) paint();
}).observe(canvas);
journal.storage.get('seed').then(
(saved) => { if (typeof saved === 'number') seed = saved; paint(); },
() => paint()
);
</script>
A link on its own line becomes a card, with the page's title and picture:
Journal: private notes, encrypted
I didn't type every line of this. I wrote it together with Claude, which can read and write my notes through Journal MCP, but only the folders I've granted it under Journal → Settings → Agent access. It drafted the blocks, I chose what stayed, and the whole post lives in one note in my own Homebase.
If you want to try it yourself:
☑ Write the words first
☑ Add a cover, with a dark version for night readers
☐ Check every block on a phone and in the dark theme
☐ Share the note
Like this one. Footnotes collect at the end of the post.
↩