Closed nancy-luu closed 2 months ago
Thanks for sharing.
Could you provide a few more details on this?
@liabru thanks for following up!
Could the slow first initial load / rendering / animation be related to the website being deployed on vercel? Thank you for any suggestions you can provide!
@liabru
Was able to find a solution for this!
I had a lot of large image files in the index page of my site that seemed to have been contributing to the overall lag. I simply offloaded image hosting to a CDN that provided image optimization to reduce the bandwidth and server load on my hosting environment. This seemed to have freed up resources for matter.js to render smoother.
Hi community - I am currently rendering a collection of bodies falling upon page load on my landing page. The animation / rendering works as intended when viewing on my laptop on both safari and chrome.
For some reason when I look at the website on my iphone (iphone 14 pro) using safari the falling effect of the bodies is incredibly laggy.
Is there a way I can improve this performance?
For additional context (not sure if this affects my issue) - I am using react.js / next.js and deployed on vercel. And this is my code below:
`import { useEffect, useRef, useState } from 'react'; import Matter from 'matter-js';
import styles from '@/styles/Home.module.scss'
const ToyBox = ({ cw, ch }) => { const containerRef = useRef(null); const [shapesAdded, setShapesAdded] = useState(false);
};
export default ToyBox; `