Effects / Cards
Neon Glass Card
TestingA frosted glass card lit from behind: two light sources bloom under the pane and reach the eye already diffused, while a thread of light runs along the edge.
Live demos
activation="hover"
Lit from behind
Hover the pane: the two lights wake up under the glass and lean towards your pointer, and a thread of light runs along the edge. Reach the button with the Tab key and it lights up the same way.
activation="always"
Already on
Lit from the start. The comet makes one lap and the lights settle, then everything rests: motion that starts by itself stops within five seconds.
Same mechanics, another identity
Cold light, round corners.
Same component. The website chose cyan and violet, a clearer pane, rounder corners and a card that rises a little under the pointer. Nothing in the package changed.
Use it in a website
Wrap any content in the component. What you put inside stays your own HTML:
---
import NeonGlassCard from '@innovando/in-fx/components/NeonGlassCard.astro';
---
<NeonGlassCard as="article">
<h3>Your title</h3>
<p>Your text. Links and buttons stay fully reachable.</p>
</NeonGlassCard>Then give it the website's identity from the website's stylesheet. The glass only reads as glass when there is something behind it to blur: an image, a pattern, shapes. On a flat background it is a dark card with lights — still fine, just quieter.
/* In the website's own stylesheet — not in the package */
.ifx-neon-glass {
--ifx-neon-glass-color-1: #00e0ff;
--ifx-neon-glass-color-2: #7c4dff;
--ifx-neon-glass-radius: 24px;
--ifx-neon-glass-lift: 4px;
}Variables
Every visual or timing decision is a CSS variable with a fallback.
| Variable | Fallback | What it does |
|---|---|---|
--ifx-neon-glass-color-1 | WebKit accent → currentColor | First light behind the glass, and the head of the edge comet |
--ifx-neon-glass-color-2 | WebKit accent strong → currentColor | Second light behind the glass, and the tail of the comet |
--ifx-neon-glass-radius | WebKit radius → 0px | Corner radius |
--ifx-neon-glass-surface | WebKit surface → Canvas | Colour of the glass |
--ifx-neon-glass-tint | 55% | How much of that colour the glass carries |
--ifx-neon-glass-frost | 14px | Blur of what lies behind the card |
--ifx-neon-glass-saturate | 1.3 | Colour boost of what lies behind |
--ifx-neon-glass-ink | inherit | Text colour inside the card |
--ifx-neon-glass-padding | WebKit large spacing → 2rem | Inner padding |
--ifx-neon-glass-hairline | currentColor at 16% | Resting outline |
--ifx-neon-glass-hairline-lit | currentColor at 28% | Outline when lit |
--ifx-neon-glass-hairline-width | 1px | Outline width |
--ifx-neon-glass-sheen | currentColor at 14% | Thin highlight on the top edge of the pane |
--ifx-neon-glass-bloom-size | 75% | Size of each light, relative to the card width |
--ifx-neon-glass-bloom-strength | 0.85 | Strength of each light |
--ifx-neon-glass-rest | 0.35 | How much light is left when the card is not lit |
--ifx-neon-glass-edge | 1.5px | Width of the light thread on the edge |
--ifx-neon-glass-edge-strength | 1 | Maximum opacity of the thread |
--ifx-neon-glass-sweep | 3.6s | One lap of the comet along the edge |
--ifx-neon-glass-drift | 9s | Slow drift of the lights behind the glass |
--ifx-neon-glass-transition | 320ms | Light-up and fade-out time |
--ifx-neon-glass-lift | 0px | How far the card rises on hover |
--ifx-neon-glass-parallax | 0.12 | How much the lights lean towards the pointer, 0–1 |
How it behaves for everyone
Keyboard
Keyboard focus inside the card lights it exactly like the pointer does. A mouse click does not keep it lit. Your focus ring stays instant and untouched.
Touch
There is no hover on a phone: in hover mode the card rests half-lit. Use activation="always" where the glow matters on touch.
Reduced motion
The lights still glow, but they do not drift, lean or sweep.
High contrast
In forced-colours mode the decorative light is removed and the outline uses the system colour.
Without JavaScript
Everything works except the lights leaning towards the pointer. Glass, glow and edge are pure CSS.
Performance
The glass blurs only the page behind it, which does not move. The lights move with translate and the comet with rotate: work the graphics card does on its own.