Overview
TheFlightStatusLedComponent is a simple visual indicator that displays the current state of a flight using an LED-style circle. It shows a pulsing green LED for flights in the air and a static red LED for aircraft on the ground.
Selector: app-flight-status-led
Location: src/app/features/flights/ui/flight-status-led/flight-status-led.component.ts:5
Component API
Inputs
Indicates whether the aircraft is on the ground. When
true, displays a red LED. When false, displays an animated green LED.Visual States
Flying State (onGround = false)
Appearance:
- Green pulsing LED (10px diameter)
- Animated glow effect
- Radial gradient background
- Box shadow with green tint
- Continuous pulse animation (1.8s cycle)
- Expanding glow halo (1s cycle)
.led-pilot.flying
Tooltip: “In Flight”
Source: flight-status-led.component.scss:13-32
Grounded State (onGround = true)
Appearance:
- Solid red LED (10px diameter)
- Static glow (no animation)
- Radial gradient background
- Box shadow with red tint
.led-pilot.grounded
Tooltip: “On Ground”
Source: flight-status-led.component.scss:34-39
Styling Details
The component uses sophisticated CSS styling to create a realistic LED effect:Animations
Pulse Animation (ledPulse - 1.8s cycle):
- Alternates opacity between 1.0 and 0.7
- Slightly scales the LED (1.0 to 1.05)
- Creates breathing effect
ledGlow - 1s cycle):
- Applied to the
::afterpseudo-element - Expands and contracts the glow halo
- Opacity fades between 0.6 and 0.3
flight-status-led.component.scss:43-63
Usage Examples
In Flight List
In Flight Detail Views
In Polling Status Component
Static States (For Legends/Examples)
Template Structure
The component uses a minimal template (flight-status-led.component.html:1-3):
- Container: Wraps the LED with tooltip support
- LED Element: Applies conditional CSS classes based on
onGroundstate - Tooltip: Shows human-readable status text on hover
Dependencies
- MatTooltipModule: Provides tooltip functionality for status description
Features
- Minimal footprint (simple boolean input)
- Smooth CSS animations
- Accessible via tooltip descriptions
- Responsive visual feedback
- No external image dependencies
- Works in real-time with signal-based updates
