This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user