removed numbers + card redesign

This commit is contained in:
2026-05-14 11:30:04 +02:00
parent 64c455f584
commit d74f682155
3 changed files with 43 additions and 73 deletions
+1 -23
View File
@@ -28,19 +28,6 @@ function formatDate(d: string) {
return new Date(d).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' });
}
function toRoman(n: number): string {
const map: [number, string][] = [
[1000, 'M'], [900, 'CM'], [500, 'D'], [400, 'CD'],
[100, 'C'], [90, 'XC'], [50, 'L'], [40, 'XL'],
[10, 'X'], [9, 'IX'], [5, 'V'], [4, 'IV'], [1, 'I'],
];
let out = '';
for (const [val, sym] of map) {
while (n >= val) { out += sym; n -= val; }
}
return out;
}
function formatSlug(s: string) {
if (!s) return '';
return s.split('-').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' ');
@@ -49,7 +36,7 @@ function formatSlug(s: string) {
let post: PostDetail | null = null;
let html = '';
let error = '';
let neighbors: { prev?: PostInfo; next?: PostInfo; index: number; total: number } = { index: -1, total: 0 };
let neighbors: { prev?: PostInfo; next?: PostInfo } = {};
try {
const [postRes, listRes] = await Promise.all([
@@ -67,8 +54,6 @@ try {
const i = list.findIndex(p => p.slug === slug);
if (i >= 0) {
neighbors = {
index: i,
total: list.length,
prev: i > 0 ? list[i - 1] : undefined,
next: i < list.length - 1 ? list[i + 1] : undefined,
};
@@ -82,7 +67,6 @@ try {
const isAdmin = Astro.cookies.get('admin_session')?.value === '1';
const displayTitle = post ? (post.title || formatSlug(post.slug)) : 'Work';
const exhibitNumber = neighbors.index >= 0 ? toRoman(neighbors.index + 1) : '';
---
<Layout
@@ -123,12 +107,6 @@ const exhibitNumber = neighbors.index >= 0 ? toRoman(neighbors.index + 1) : '';
{/* Plaque header */}
<header class="max-w-3xl mx-auto text-center mb-12 md:mb-16">
{exhibitNumber && (
<div class="font-display italic text-[var(--mauve)] tracking-[0.3em] text-sm mb-5">
№ {exhibitNumber} <span class="text-[var(--subtext0)] not-italic">/ {neighbors.total}</span>
</div>
)}
<h1 class="font-display italic font-semibold text-[var(--text)] text-4xl md:text-6xl lg:text-7xl leading-[0.95] tracking-tight mb-6">
{displayTitle}
</h1>