feat: z distance scaling for text node
This commit is contained in:
parent
d5a9fb1fd8
commit
b9e3f76750
|
@ -43,10 +43,11 @@ export class TextNode {
|
|||
position[1] += realOffset[1];
|
||||
}
|
||||
const angle = rotation.x / (Math.PI * 2);
|
||||
const distanceScale = particle.p.z > 0 ? particle.p.z / 70 : 0;
|
||||
div.style.transform = `
|
||||
translate(${position[0]}px, ${-position[1]}px)
|
||||
rotate(${angle * 360}deg)
|
||||
scale(${scale})
|
||||
scale(${scale + distanceScale})
|
||||
`;
|
||||
const spanTranslate = 50 * (1 / scale);
|
||||
span.style.transform = `translate(-${spanTranslate}%, -${spanTranslate}%)`;
|
||||
|
|
Loading…
Reference in New Issue
Block a user