Edit background canvas
All checks were successful
Build frontend / build (push) Successful in 29s

This commit is contained in:
Rahaf
2026-01-18 14:02:00 +03:00
parent 56051026db
commit bccefd097f

View File

@ -127,7 +127,7 @@ const BackgroundCanvas = ({ theme = 'light' }) => {
camera.acceleration.z *= 0.9;
};
const initCanvas = () => {
const initCanvas = () => {
const canvas = canvasRef.current;
if (!canvas) return;
@ -153,8 +153,17 @@ const BackgroundCanvas = ({ theme = 'light' }) => {
1
);
jointsRef.current = generateJoints(300, worldRef.current.width, worldRef.current.height);
};
const isMobile = window.innerWidth < 768;
const numberOfJoints = isMobile ? 80 : 300;
jointsRef.current = generateJoints(numberOfJoints, worldRef.current.width, worldRef.current.height);
if (isMobile) {
jointsRef.current.forEach(joint => {
joint.bone_length = 120;
joint.speed = 0.4;
});
}
};
const animate = () => {
const canvas = canvasRef.current;