CSS Animation Example: The Glassmorphism Shimmer

"The Glassmorphism Shimmer" recreates a premium, metallic or frosted-glass reflection passing rapidly over a card, often used to draw attention to pricing tiers or premium features.

Pro Plan

$19.99 / mo

This effect is accomplished by assigning a ::before pseudo-element to the card and creating a semi-transparent, white linear-gradient(). Importantly, we use transform: skewX(-20deg) to give it a slanted, ray-like appearance. By hiding any overflow on the parent card with overflow: hidden, we can then animate the left property in our @keyframes to sweep the streak entirely across the frame from start to finish.

Here is the code to create The Glassmorphism Shimmer animation.

View Output

Accessibility Considerations

Persistent, looping animations that cross large portions of the screen can be quite distracting. prefers-reduced-motion is a CSS media feature used to detect if a user has enabled a setting on their device to minimize the amount of non-essential animation or motion.

If a user prefers reduced motion, it's best to completely remove the shimmer pseudo-element using display: none, as it serves purely an aesthetic purpose and stopping it dead in its tracks might look like a glitch.

Here's what we used in our example:


@media (prefers-reduced-motion: reduce) {
    .glass-card::before {
        /* Remove the shimmer layer entirely */
        display: none; 
    }
}