#497 Add dynamic glow effect for selected
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
-
SVG Filter Definition: Created
#selected-glowfilter with animated Gaussian blur - Dynamic Application: Filter is conditionally applied to all components (pre, main, post) of selected elements based on Redux state
- Universal Compatibility: Works automatically for all element types without individual modifications
Key Changes
-
SVG Filter (
svg-wrapper.tsx): Added animated fluorescent yellow glow filter with fast 0.5-second pulsating cycle -
Conditional Rendering (
svg-layer.tsx): Wrap all selected element components (pre, main, post) with glow filter group -
State Integration (
svg-canvas-graph.tsx): Pass selection state to SVG layer
The filter uses feColorMatrix to create fluorescent yellow color and feGaussianBlur with <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
- Zero breaking changes: Preserves all existing functionality
- Performance optimized: Filter only applies to selected elements
- Maintainable: Centralized effect definition
- Universal: Works for stations, misc nodes, and line segments automatically (including pre and post components)
- Professional appearance: Smooth animated fluorescent yellow glow with proper layering and clear edges
- Fast feedback: Quick 0.5s animation cycle for responsive visual indication
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
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:
railmapgen.org
- Triggering command:
node /home/REDACTED/work/rmp/rmp/node_modules/.bin/vite --host(dns block)If you need me to access, download, or install something from one of these locations, you can either:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to the custom allowlist in this repository's Copilot coding agent settings (admins only)