Yu-Gi-Oh! OCG Secret Rare Effect with CSS
Background
This project was first published in January 2021. In March 2025, I re-evaluated my past projects and found this one to be the most in need of a revamp.
Remembering Simon Goellner's amazing Pokémon Cards Holographic Effect in CSS from 2022, I decided to explore and apply his technique.
If you have any suggestions for improvements, do leave a comment on the Github Repo.
Spotlight Layer
The Spotlight layer features a white-to-transparent radial gradient. It blends with the content below using the Plus-Lighter blend mode. Plus-Lighter sums the pixel values of the top and bottom layers.
This Plus-Lighter vs Color Dodge vs Screen Output Comparison Graph compares Plus-Lighter with other similar blend modes.
Plus-Lighter can simulate a bright light even at low strength, which preserves contrast and thereby details. It does so by enforcing a value floor and allowing overexposure. The former delineates the light spot and the latter conveys brightness.
Holographic Foil Layer
In the Holographic Foil layer, a rainbow linear gradient blends with a black-white layer mask using the Color blend mode. The output has the former's hue and saturation, and the latter's lightness.
This output is then blended with the content below using the Color Dodge blend mode. Color Dodge works like a highlighter. It brightens the bottom layer based on the top layer's values. If the top layer is black, the bottom layer stays the same.
Name and Hologram Layer
The shininess of the Name and Hologram is created by applying a CSS mask to an element containing a white-to-transparent radial gradient.
Challenges
On Safari 18.2 and earlier, 2 bugs were encountered:
- Blending with Color failed between elements on different composition layers. Since CSS transform promotes elements to their own composition layers, CPU-heavy background position changes were used for animations instead. Bug report on Webkit Bugzilla.
- Elements on composition layers that underwent tiling also failed to blend. Tiling is the process by which browsers split layers into distinct regions to be rendered progressively. This issue was happening to the rainbow gradient; setting it to no-repeat solved the problem. Bug report on Webkit Bugzilla.
On the latest version of Firefox, 2 different bugs were encountered:
- On Intel GPUs, blending with Color Dodge wrongly output a dark color when the top layer was white and had a specific opacity. In my case, the issue occurred only at 90% opacity; sidestepping this value avoided it. Bug report on Mozilla Bugzilla.
- Perspective-transformed elements can appear blurry from being rendered at an incorrectly low internal resolution. To fix this, the card was made 25% larger and scaled back to the intended size using CSS transform. Bug report on Mozilla Bugzilla.
The Japanese text was meant to be real text instead of SVG images. Because browsers avoid blurring text for legibility, the small font sizes made it harsh and overly bold: Comparison of 9px text (top) vs image (bottom). Also, Chrome 117 and earlier have a default minimum font size of 10px for Japanese. The card would need to be huge to accommodate such a minimum.
Other Implementation Details
For raster images, the WebP and AVIF formats are used. To balance file size and quality, an SSIMULACRA 2 score above 90 is maintained to ensure images are visually lossless.
The Official Proxy from the Infinity Chasers announcement page is used as a reference. For fans, I also found an official Madame Verre 9/17 Cute Day Promotional Image.
Accessibility
I've tested this webpage with NVDA (Non-Visual Desktop Access) and found all text and key elements to make sense to screen-reader users.
This webpage should be compatible with major browsers released in the last year or older. The oldest browser I have available for testing is Safari 15.4, released in March 2022.
Credits
- The artwork for the card was created by Alan.
- The card stock was sourced from Alixsep's Ultimate HQ Yu-Gi-Oh! Series 10 Card Template.
- The hologram was taken from Icycatelf's YGO Series 10 Master PSD.
- The attribute icon was made by Falzar FZ.



