naver / egjs-axes

A module used to change the information of user action entered by various input devices such as touch screen or mouse into the logical virtual coordinates.
https://naver.github.io/egjs-axes/
MIT License
179 stars 32 forks source link

feat: add nested option #181

Closed malangfox closed 2 years ago

malangfox commented 2 years ago

Details

nestedmove

added nested: boolean option with demo.

Basically, when a change event occurs in any one Axes, coordinate change and change events do not occur in other Axes. If nested is true and when one of the axes of Axes reaches the end of the range and bounce areas which can no longer move in the entered direction, other Axes can trigger a change event.

It has been changed to manage the triggering order of the pointermove event that occurs in the input of Axes so that it is always in the same order as the pointerdown event attached to the element.

daybrush commented 2 years ago

I think the examples in the gif and demo are wrong?

The example seems to be related to thresholdAngle. Even if the axes do not reach the end, vertical should work due to thresholdAngle.

The demo of horizontal + horizontal is probably the best demo to understand nested.

malangfox commented 2 years ago

I think the examples in the gif and demo are wrong?

The example seems to be related to thresholdAngle. Even if the axes do not reach the end, vertical should work due to thresholdAngle.

The demo of horizontal + horizontal is probably the best demo to understand nested.

It was an example when a cloud with x axis and y axis is a child element of a separate parent elements with x axis and y axis movements. The cloud moves freely, but when the cloud reaches the end of the x or y axis, the same axis associated with the parent elements will move.

nestedgallery Also after checking the comment, I made a demo that uses horizontal axis inside the horizontal axis, and when the internal horizontal axis moves to the end, the axis associated with the parent element and the event moves.

nestedgallery2

This demo shows two nested axes in one axes, but seems bit ugly. I would like to improve it and use it as a real demo.

CLAassistant commented 2 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

:white_check_mark: malangfox
:x: morgrave
You have signed the CLA already but the status is still pending? Let us recheck it.