From 7103fee6bc4764c674faee6823b1a6309d3164f3 Mon Sep 17 00:00:00 2001 From: awfufu Date: Mon, 29 Dec 2025 16:14:27 +0800 Subject: [PATCH] fix: center dashboard avatar using auto margins to ensure consistent alignment across locales --- src/components/central-island/DashboardView.astro | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/components/central-island/DashboardView.astro b/src/components/central-island/DashboardView.astro index 0ea6778..4faf32a 100644 --- a/src/components/central-island/DashboardView.astro +++ b/src/components/central-island/DashboardView.astro @@ -248,20 +248,14 @@ const t = getTranslations(lang); btnConfirm.addEventListener("click", () => { if (!cropper) return; - const canvas = cropper.getCroppedCanvas({ + // biome-ignore lint/suspicious/noExplicitAny: Missing type definition for getCroppedCanvas + const canvas = (cropper as any).getCroppedCanvas({ width: 640, height: 640, imageSmoothingQuality: "high", }); if (!canvas) return; - - // Show processing immediately before compression loop starts - // But compression loop is synchronous in JS (except toBlob which is callback based). - // Let's wrap compression in a small timeout too or just rely on async nature of toBlob? - // Canvas operations are sync. We should show loading before starting canvas ops. - // It's safer to show loading then setTimeout. - showLoading(processingText); setTimeout(() => { @@ -419,7 +413,7 @@ const t = getTranslations(lang); height: 128px; border-radius: 32px; overflow: hidden; - margin-bottom: 1.5rem; + margin: 0 auto 1.5rem auto; border: 3px solid rgba(255, 255, 255, 0.2); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }