fix: center dashboard avatar using auto margins to ensure consistent alignment across locales

This commit is contained in:
2025-12-29 16:14:27 +08:00
parent c0cc08a163
commit 7103fee6bc

View File

@@ -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);
}