From c4f6f1caaa9d95e0dc525dcf2c00521af257ab53 Mon Sep 17 00:00:00 2001 From: Danila Poyarkov Date: Sat, 28 Feb 2026 20:40:03 +0300 Subject: [PATCH] Redesign Effects section to match Figma's layout - Compact row: color swatch + type dropdown + eye toggle + minus - Expanded controls in a floating popover anchored to the left - Labeled rows: Position (X/Y), Blur, Spread, Color with hex + opacity - Type dropdown in popover header with X close button - Eye/minus icons hidden until row hover (matches fill/stroke rows) --- components.d.ts | 1 + src/components/properties/EffectsSection.vue | 177 ++++++++++++------- 2 files changed, 113 insertions(+), 65 deletions(-) diff --git a/components.d.ts b/components.d.ts index e174cd2a5..c0c74e250 100644 --- a/components.d.ts +++ b/components.d.ts @@ -44,6 +44,7 @@ declare module 'vue' { IconLucideRotateCcw: typeof import('~icons/lucide/rotate-ccw')['default'] IconLucideRotateCw: typeof import('~icons/lucide/rotate-cw')['default'] IconLucideSearch: typeof import('~icons/lucide/search')['default'] + IconLucideX: typeof import('~icons/lucide/x')['default'] LayersPanel: typeof import('./src/components/LayersPanel.vue')['default'] LayoutSection: typeof import('./src/components/properties/LayoutSection.vue')['default'] PageSection: typeof import('./src/components/properties/PageSection.vue')['default'] diff --git a/src/components/properties/EffectsSection.vue b/src/components/properties/EffectsSection.vue index c7e87b98a..e9b75e81c 100644 --- a/src/components/properties/EffectsSection.vue +++ b/src/components/properties/EffectsSection.vue @@ -13,7 +13,7 @@ const expandedIndex = ref(null) type EffectType = Effect['type'] -const EFFECT_LABELS: Record = { +const EFFECT_LABELS: Record = { DROP_SHADOW: 'Drop shadow', INNER_SHADOW: 'Inner shadow', LAYER_BLUR: 'Layer blur', @@ -23,7 +23,7 @@ const EFFECT_LABELS: Record = { const EFFECT_TYPES = Object.keys(EFFECT_LABELS) as EffectType[] -function isShadow(type: EffectType) { +function isShadow(type: string) { return type === 'DROP_SHADOW' || type === 'INNER_SHADOW' } @@ -69,6 +69,9 @@ function updateType(index: number, type: EffectType) { if (!isShadow(type)) { changes.offset = { x: 0, y: 0 } changes.spread = 0 + } else if (!isShadow(node.value!.effects[index].type)) { + changes.offset = { x: 0, y: 4 } + changes.spread = 0 } updateEffect(index, changes) } @@ -76,7 +79,6 @@ function updateType(index: number, type: EffectType) { function add() { const effects = [...node.value!.effects, defaultEffect()] store.updateNodeWithUndo(node.value!.id, { effects }, 'Add effect') - expandedIndex.value = effects.length - 1 } function remove(index: number) { @@ -104,89 +106,134 @@ function toggleExpand(index: number) { >+ -
+
+
+ + + + - - -
-
- + +
+
+ + +