Open
Conversation
Co-authored-by: thekingofcity <3353040+thekingofcity@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] 我想给所有选中(selected)的元素(车站、杂项节点、线段样式)添加一个动态的外发光效果,最好用上svg的动画功能,有没有不修改每个元素实现的方法?
Add dynamic glow effect for selected elements using SVG animations
Sep 13, 2025
thekingofcity
requested changes
Sep 13, 2025
…ply to pre/post components Co-authored-by: thekingofcity <3353040+thekingofcity@users.noreply.github.com>
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot
AI
changed the title
Add dynamic glow effect for selected elements using SVG animations
Add dynamic fluorescent yellow glow effect for selected elements using SVG animations
Sep 13, 2025
langonginc
requested changes
Sep 13, 2025
Member
langonginc
left a comment
There was a problem hiding this comment.
- The horizontal and vertical lines will be disappeared when selected.
- Item in black will not be added with yellow effect.
Member
Both were fixed :) |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements a fluorescent yellow glow effect for selected elements (stations, misc nodes, and line styles) to provide visual feedback during selection. The implementation uses a centralized SVG filter approach that applies conditionally to selected elements without modifying individual component implementations.
Changes:
- Added SVG filter definition for selection glow effect with yellow color and blur
- Modified svg-layer.tsx to wrap all selected element components (pre, main, post) with the glow filter
- Updated svg-canvas-graph.tsx to pass selection state to SvgLayer component
- Added filter removal logic in download.ts to prevent glow effect in exported files
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/components/svg-wrapper.tsx | Added selected-glow SVG filter definition with yellow color matrix and blur effects |
| src/components/svg-layer.tsx | Wrapped all element components (lines, stations, misc-nodes) with conditional glow filter based on selection state; updated memoization to include selected prop |
| src/components/svg-canvas-graph.tsx | Passed selected Set to SvgLayer component |
| src/util/download.ts | Added logic to remove glow filter attribute from elements during export |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements a dynamic fluorescent yellow glow effect for all selected elements (stations, misc nodes, and line styles) using SVG filter animations, addressing the user request for visual feedback without modifying individual element components.
Problem
Users needed a visual indicator to clearly identify selected elements on the canvas. The requirement was to implement a dynamic glow effect (外发光效果) using SVG animation functionality while avoiding modifications to each individual element implementation.
Solution
Added an animated SVG filter that applies a fluorescent yellow pulsating glow effect to selected elements:
Technical Implementation
#selected-glowfilter with animated Gaussian blurKey Changes
svg-wrapper.tsx): Added animated fluorescent yellow glow filter with fast 0.5-second pulsating cyclesvg-layer.tsx): Wrap all selected element components (pre, main, post) with glow filter groupsvg-canvas-graph.tsx): Pass selection state to SVG layerThe filter uses
feColorMatrixto create fluorescent yellow color andfeGaussianBlurwith<animate>to create a smooth fast pulsating effect from 1px to 3px blur radius, providing clear visual feedback with crisp edges for element selection.Visual Result
The screenshot shows a station with the bright fluorescent yellow animated glow effect applied, demonstrating the smooth visual feedback for selected elements.
Benefits
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.