Effects / Cards
Pixel Card
TestingA grid of tiny pixels lights up across the card in a wave from where the pointer enters, shimmers or moves aside as you go, and drains away through the point where you leave.
Live demos
activation="hover"
Enter from any side
The pixels light up in a wave from the point where your pointer comes in, shimmer while you stay, and drain away through the point where you leave. Reach the button with the Tab key and the wave starts from the centre.
activation="always"
Already on
The first time the card comes into view, the wave plays once from the centre. Then the pixels stay lit and still. Hover it and they shimmer.
--ifx-pixel-card-repel: 14
Magnetic
Finer pixels, a wave that speeds up and slows down. Once they cover the card, move your pointer inside it: the pixels gently move aside, as if pushed by a magnet, and settle back when you go. Leave the card and they drain away through that point.
Same mechanics, another identity
Green field, bigger pixels, no shimmer.
Same component. The website chose three greens and blues, larger and closer pixels, a slower wave, rounder corners and pixels that hold still. 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 PixelCard from '@innovando/in-fx/components/PixelCard.astro';
---
<PixelCard as="article">
<h3>Your title</h3>
<p>Your text. Links and buttons stay fully reachable.</p>
</PixelCard>Then give it the website's identity from the website's stylesheet. Three colours are mixed at random across the grid; with one colour set three times, the card lights up in a single tone.
/* In the website's own stylesheet — not in the package */
.ifx-pixel-card {
--ifx-pixel-card-color-1: #3ddc97;
--ifx-pixel-card-color-2: #00b3ff;
--ifx-pixel-card-color-3: #c6f432;
--ifx-pixel-card-pixel: 4px;
--ifx-pixel-card-gap: 4px;
}Variables
Every visual or timing decision is a CSS variable with a fallback.
| Variable | Fallback | What it does |
|---|---|---|
--ifx-pixel-card-color-1 | WebKit accent → currentColor | First pixel colour |
--ifx-pixel-card-color-2 | WebKit accent strong → currentColor | Second pixel colour |
--ifx-pixel-card-color-3 | WebKit focus → currentColor | Third pixel colour |
--ifx-pixel-card-pixel | 3px | Side of one pixel |
--ifx-pixel-card-gap | 5px | Space between two pixels |
--ifx-pixel-card-density | 0.9 | Share of pixels that light up, 0–1 |
--ifx-pixel-card-pixel-strength | 0.85 | Maximum opacity of the pixels |
--ifx-pixel-card-wave | 700ms | Time the light-up wave takes to cross the card |
--ifx-pixel-card-release | 450ms | Time the fade-out wave takes |
--ifx-pixel-card-fade | 220ms | Time a single pixel takes to light up |
--ifx-pixel-card-shimmer | 0.4 | How much the pixels shimmer under the pointer, 0–1 (0 = still) |
--ifx-pixel-card-shimmer-period | 1800ms | Length of one shimmer |
--ifx-pixel-card-repel | 0 | How far, in px, the pixels move away from the pointer (0 = no magnet) |
--ifx-pixel-card-repel-radius | 90 | Distance from the pointer, in px, within which pixels move aside |
--ifx-pixel-card-repel-follow | 260ms | How softly the pixels follow: move away and come back |
--ifx-pixel-card-radius | WebKit radius → 0px | Corner radius |
--ifx-pixel-card-surface | WebKit surface → Canvas | Card background |
--ifx-pixel-card-ink | inherit | Text colour inside the card |
--ifx-pixel-card-padding | WebKit large spacing → 2rem | Inner padding |
--ifx-pixel-card-hairline | currentColor at 16% | Resting outline |
--ifx-pixel-card-hairline-lit | currentColor at 28% | Outline when lit |
--ifx-pixel-card-hairline-width | 1px | Outline width |
--ifx-pixel-card-transition | 320ms | Outline light-up time |
How it behaves for everyone
Keyboard
Keyboard focus inside the card starts the wave from the centre. 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, and the magnet is off. Use activation="always" where the pixels matter on touch.
Reduced motion
The pixels appear all at once and hold still: no wave, no shimmer, no magnet.
High contrast
In forced-colours mode the pixels are removed and the outline uses the system colour.
Without JavaScript
The pixels are drawn by a small script. Without it you get the content in a clean card.
Performance
The pixels are drawn on one canvas per card, only while something moves. When the wave is over, the pixels have settled and the pointer is still or gone, or the card is off screen, nothing runs.