Fixing Vercel's Landing Page

Apr 18, 2025

Vercel's landing page is cool, but it could be a lot better with this one little trick.

If you're like me, you tend to focus on the little details that might fly under the radar for most other people. When I visit Vercel's landing page, the first thing that catches my eye is the big rainbow prism triangle thingie:

The rainbow banner.

While impressive in a way, my eyes bleed every time I see this magnificent symphony of colors. The reason for my angst? Moiré patterns.

Close-up of a Moiré pattern; can you see it? If not, you might need to zoom out a bit.
Moiré pattern outlines drawn in red.

These little bastards show up because our screens don't have high enough resolution relative to the required sampling frequency (y'all remember Nyquist theorem from college, right?). The gaps between individual stripes create these weird interference patterns (I'm sure a mathematician or computer graphics expert could explain that more formally).

Luckily, there's a pretty simple cure: tweaking the anti-aliasing logic. Changing how SVGs alias things is actually a bit tricky, though you could try adjusting the shape-rendering attribute of individual lines (desired results not guaranteed). However, a surefire workaround to mask the issue is to apply a bit of blur to the whole shebang.

The code for it could look something like this:

<svg class="triangle_blackoutLines">
  <filter id="soften">
    <feGaussianBlur in="SourceGraphic" stdDeviation="1"></feGaussianBlur>
  </filter>
  <g filter="url(#soften)">
    <!-- your SVG sub-elements go here -->
  </g>
</svg>

Just play with the stdDeviation value until the Moiré patterns disappear, while still keeping the image crisp enough.

The rainbow banner with Gaussian blur applied to the background (note: you could fix the triangle similarly, but I didn't do that here because I'm lazy tonight). It might still show Moiré patterns when scaled really small, but in a live setting, you could maybe dynamically adjust the `stdDeviation` based on the size of the SVG.



P.S. By the way, LangChain's landing page has a similar issue, although they're using a video file instead of canvas + SVG.

LangChain's landing page has a similar issue.

P.P.S. As a sidenote, be careful with the id of the filter tag! I once spent hours debugging an issue where two SVGs defined linearGradient elements with the same id. Moral of the story: always make your id's unique!