From d03837233697147d9fd836b400c76c64be08973c Mon Sep 17 00:00:00 2001 From: cc Date: Wed, 24 Jun 2026 21:29:14 +0800 Subject: [PATCH] feat(photo-wall): larger adjust steps + rotation/scale presets in context menu Co-Authored-By: Claude Opus 4.8 --- Client/src/components/PhotoWallPage.tsx | 29 ++++++++++++++++++++----- Client/src/index.css | 7 ++++++ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Client/src/components/PhotoWallPage.tsx b/Client/src/components/PhotoWallPage.tsx index b175395..c14d40e 100644 --- a/Client/src/components/PhotoWallPage.tsx +++ b/Client/src/components/PhotoWallPage.tsx @@ -536,6 +536,10 @@ export function PhotoWallPage({ onExit, token }: PhotoWallPageProps) { }) const recolorNote = (id: number, color: string) => mutate((p) => p.map((e) => (e.id === id ? { ...e, color } : e))) + const setRotation = (id: number, deg: number) => + mutate((p) => p.map((e) => (e.id === id ? { ...e, rot: deg } : e))) + const setScale = (id: number, s: number) => + mutate((p) => p.map((e) => (e.id === id ? { ...e, scale: s } : e))) const removeEl = (id: number) => { const target = elsRef.current.find((e) => e.id === id) if (target?.type === 'photo' && target.photoId) { @@ -917,17 +921,17 @@ export function PhotoWallPage({ onExit, token }: PhotoWallPageProps) {
{menuEl.type !== 'doodle' && ( <> -
{ rotate(menu.id, 5); setMenu(null) }}>旋转 +5°
-
{ rotate(menu.id, -5); setMenu(null) }}>旋转 -5°
+
{ rotate(menu.id, 15); setMenu(null) }}>旋转 +15°
+
{ rotate(menu.id, -15); setMenu(null) }}>旋转 -15°
{menuEl.type === 'photo' ? ( <> -
{ resizePhoto(menu.id, 10); setMenu(null) }}>放大
-
{ resizePhoto(menu.id, -10); setMenu(null) }}>缩小
+
{ resizePhoto(menu.id, 30); setMenu(null) }}>放大
+
{ resizePhoto(menu.id, -30); setMenu(null) }}>缩小
) : ( <> -
{ scaleEl(menu.id, 0.12); setMenu(null) }}>放大
-
{ scaleEl(menu.id, -0.12); setMenu(null) }}>缩小
+
{ scaleEl(menu.id, 0.25); setMenu(null) }}>放大
+
{ scaleEl(menu.id, -0.25); setMenu(null) }}>缩小
)}
@@ -951,6 +955,19 @@ export function PhotoWallPage({ onExit, token }: PhotoWallPageProps) { )}
+
+ 旋转 + {[0, 15, 30, 45, 90].map((d) => ( + + ))} +
+
+ 比例 + {[0.5, 0.75, 1, 1.5, 2].map((s) => ( + + ))} +
+
removeEl(menu.id)}> 删除 Del diff --git a/Client/src/index.css b/Client/src/index.css index 38de30f..6fbb908 100644 --- a/Client/src/index.css +++ b/Client/src/index.css @@ -355,6 +355,13 @@ textarea, font-size: 13px; } .pw-colorrow { display: flex; gap: 6px; padding: 6px 8px; } +.pw-preset { display: flex; align-items: center; gap: 5px; padding: 5px 8px; flex-wrap: wrap; } +.pw-preset-label { font-size: 12px; color: #888; width: 28px; } +.pw-chip { + border: 1px solid #e0e0e0; background: #fff; border-radius: 12px; + padding: 3px 9px; font-size: 12px; cursor: pointer; color: #444; +} +.pw-chip:hover { background: #f5f5f5; } .pw-sw { width: 20px; height: 20px;