screen based translate for cast
This commit is contained in:
parent
4558eeaee0
commit
21203ee06a
@ -6,8 +6,8 @@ function sourceCast(id, direction, idle) {
|
|||||||
const { x, y } = direction;
|
const { x, y } = direction;
|
||||||
return anime({
|
return anime({
|
||||||
targets: [document.getElementById(id)],
|
targets: [document.getElementById(id)],
|
||||||
translateX: x * 200,
|
translateX: x * window.screen.width * 0.15,
|
||||||
translateY: y * 200,
|
translateY: y * window.screen.height * 0.15,
|
||||||
easing: 'easeInOutElastic',
|
easing: 'easeInOutElastic',
|
||||||
direction: 'alternate',
|
direction: 'alternate',
|
||||||
duration: TIMES.SOURCE_DURATION_MS,
|
duration: TIMES.SOURCE_DURATION_MS,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user