Skip to content

[experiment] feat: refactor Hero component to use WebGL background#2246

Draft
bjohansebas wants to merge 7 commits intoredesignfrom
experiment-with-webgl
Draft

[experiment] feat: refactor Hero component to use WebGL background#2246
bjohansebas wants to merge 7 commits intoredesignfrom
experiment-with-webgl

Conversation

@bjohansebas
Copy link
Copy Markdown
Member

No description provided.

@bjohansebas bjohansebas requested a review from a team as a code owner March 31, 2026 23:57
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 31, 2026

Deploy Preview for expressjscom-preview ready!

Name Link
🔨 Latest commit c42f5d2
🔍 Latest deploy log https://app.netlify.com/projects/expressjscom-preview/deploys/69ceb33126f05a0008ca13d6
😎 Deploy Preview https://deploy-preview-2246--expressjscom-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 80 (🔴 down 16 from production)
Accessibility: 100 (🟢 up 13 from production)
Best Practices: 100 (no change from production)
SEO: 100 (🟢 up 6 from production)
PWA: 80 (🟢 up 50 from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@bjohansebas bjohansebas marked this pull request as draft April 1, 2026 00:09
Copy link
Copy Markdown
Member

@ShubhamOulkar ShubhamOulkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve tried a similar approach before using SVG with a continuous raf loop, and it ended up being quite heavy on the main thread especially for background animations.

A few concerns with this approach, continuous WebGL/canvas animation for a background is hurting performance, particularly on mobile and lower-end devices. There’s an initial blank state before the canvas renders, which is causing background blank visual flash. Replicating the current video background with code is time-consuming and hard to match visually (my main reason to skip svg implementation).

In general, these techniques are better suited for interactive elements, not passive backgrounds. For a quick check, just open the preview and monitor GPU usage you’ll likely notice the difference immediately. I’d recommend sticking with the current 1st load image then show video based approach ensures measurable performance gains.

@g-francesca
Copy link
Copy Markdown
Collaborator

@bjohansebas the visual effect looks nice to me! Still, I see that there's a drop in performance/increased GPU cost. Also, I see there's no way to play/pause the animation.
I would probably investigate more on how to improve performance with this approach, or stick to the old approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants