feat: animate Meshery Architecture Diagram and add GIF export
Description
This PR fixes #7661
This Pull Request implements the animated Meshery Architecture Diagram and a dynamic high-fidelity GIF export feature on the Layer5.io website.
The implementation respects all original node coordinates, styles, and pixel alignments exactly as defined in meshery-architecture.svg, while introducing dynamic interactive elements, responsive controls, and custom browser-based rendering exports.
Notes for Reviewers
Here is a breakdown of the key architecture changes introduced for your review:
- Pixel-Perfect Grouped SVG (
MesheryArchitectureSVG.js):- Programmatically grouped all 136 vector path nodes into 15 logical animation group IDs (
#arch-*). - Resolved contrast legibility by introducing
.arch-channel-labelstyling to path-drawn letters inside the dark channel (HTTP/gRPCandHTTPlabels), rendering them in bright neon green (#00d3a9) to match brand accents. - Folded internal card backdrops, Ingress, and Egress containers inside
#arch-adapters-clusterso they scale and fade in collectively at Step 7 instead of causing pre-rendering float bugs.
- Programmatically grouped all 136 vector path nodes into 15 logical animation group IDs (
- 15-Step GSAP Timeline Sequence (
index.js):- Scroll-triggered via GSAP ScrollTrigger to fire once at 65% viewport scroll.
- Staggered entrances for metrics modules, adapters, K8s operators, metrics engines, and load generators.
- Network connectivity lines drawn via
strokeDashoffsettransition. - Infinite idle loop pulsing connection lines (1.0 to 0.35 opacity) on a 2.8s yoyo cycle.
- Responsive Dark Glassmorphism Container (
meshery-architecture.style.js):- Translucent glass styling (
rgba(30, 33, 23, 0.88)withbackdrop-filter: blur(14px)and glowing brand borders). - Mobile-responsive horizontal scroll lock preventing text from scaling below legibility limits.
- Elegant right-aligned Replay and Brand-Colored Export buttons.
- Translucent glass styling (
- Lazy-Loaded Dynamic GIF Export:
- Lazily imports heavy dependencies (
html2canvas,gifshot) only when requested by the user. - Scrubs the timeline across 98 points (6.5s at 15fps) while displaying an interactive progress spinner overlay.
- Employs double
requestAnimationFrame(waitForPaint) checks to allow browser draw-calls to fully paint before canvas snapshots are captured.
- Lazily imports heavy dependencies (
Verification and Quality Checks Done:
- [x] ESLint Validated: Verified with
npx eslint, passing with 0 errors and 0 warnings. - [x] SSR/SSG Build Safety: Cleaned and check-wrapped all window/document dependencies (
typeof window !== "undefined"), ensuring perfect Gatsby SSR/SSG compatibility. - [x] Responsive Mobile Layout: Tested mobile viewport layout.
- [x] Yes, I signed my commits.
Preview deployment for PR #7758 removed.
This PR preview was automatically pruned because we keep only the 6 most recently updated previews on GitHub Pages to stay within deployment size limits.
If needed, push a new commit to this PR to generate a fresh preview.
@mishradwaterlaw Please attach screen recording of your changes.
Let me know if this aligns with the desired behavior or if you'd like any adjustments to the animation timing
hi @saurabhraghuvanshii @Rajesh-Nagarajan-11 (for some reason I can't see the previous comment where you linked the docs, but here is my update):
thanks for pointing me to the documentation.. I apologize for the misunderstanding regarding the original issue description. I've completely scrapped the custom GSAP/SVG animation and refactored the component to natively embed the design using the
my code is ready, but I currently have placeholders for the embedScriptSrc and embedId. Could you provide the exported .js script and ID for the Meshery Architecture design, or grant me access to it in Kanvas or point me on how to do it..so I can export it myself? Once I have those, i can plug them in and finalize the PR
@mishradwaterlaw I don't know why but, I'm not able to see your changes here https://layer5.io/pr-preview/pr-7758/cloud-native-management/meshery
my code is ready, but I currently have placeholders for the embedScriptSrc and embedId. Could you provide the exported .js script and ID for the Meshery Architecture design, or grant me access to it in Kanvas or point me on how to do it..so I can export it myself? Once I have those, i can plug them in and finalize the PR
hi @saurabhraghuvanshii sooo, the changes wont be visible on the preview just yet because i am currently using placeholder values for the embedScriptSrc and embedId, to get the diagram rendering properly, could you either provide the exported .js script and ID for the Meshery Architecture design, or grant me access to the design in Kanvas (with a quick pointer on how to export it) so I can grab it myself?... once I have the real script and ID plugged in, the embedded architecture diagram will show up perfectly
@mishradwaterlaw Thank you for your contribution! Let's discuss this during the website call tomorrow at 5:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would :slightly_smiling_face:
hi @KUMARNiru007 thats where i got stuck and cant update this pr to verify, can you please help me with that.. idk how to get the kanvas embed details as mentioned in my comments above too
hi @KUMARNiru007 thats where i got stuck and cant update this pr to verify, can you please help me with that.. idk how to get the kanvas embed details as mentioned in my comments above too
I will bw glad to help, and for the embedding details we need to talk to layer5 maintainers regarding that.. I'm also a regular contributor here
hi @saurabhraghuvanshii @Rajesh-Nagarajan-11 could either of you please provide the exported .js script and ID, or grant me Kanvas access so I can export them myself? once I have those, I can plug them in, then we can verify the preview