Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carousel #49

Merged
merged 12 commits into from
Jan 28, 2020
Merged

Carousel #49

merged 12 commits into from
Jan 28, 2020

Conversation

danimoh
Copy link
Member

@danimoh danimoh commented Aug 23, 2019

Works fine so far. Some things could still be improved which has not been done so far:

  • Could directly work on children in a single slot (via MutationObserver) instead of requiring one slot per entry.
  • Could implement a better throttling strategy for arrow key events.
  • Could automatically calculate the width of the component (see
    0a59736)

@danimoh danimoh self-assigned this Aug 23, 2019
@danimoh danimoh requested review from nibhar and sisou August 23, 2019 23:19
@danimoh danimoh force-pushed the daniel/carousel branch 5 times, most recently from d5d2106 to 4737109 Compare August 25, 2019 23:44
@danimoh
Copy link
Member Author

danimoh commented Aug 28, 2019

I now moved the Tweenable to nimiq-utils.
This requires nimiq/nimiq-utils#27 to get merged and published first.

package.json Outdated Show resolved Hide resolved
src/components/Carousel.vue Outdated Show resolved Hide resolved
src/components/Carousel.vue Outdated Show resolved Hide resolved
src/components/Carousel.vue Outdated Show resolved Hide resolved
src/components/Carousel.vue Show resolved Hide resolved
src/components/Carousel.vue Outdated Show resolved Hide resolved
src/components/Carousel.vue Outdated Show resolved Hide resolved
src/components/Carousel.vue Show resolved Hide resolved
src/components/Carousel.vue Show resolved Hide resolved
src/stories/index.stories.js Show resolved Hide resolved
@danimoh danimoh mentioned this pull request Oct 23, 2019
Copy link
Member

@nibhar nibhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work.
Unfortunately some code that is meant to make this component operational with 4+ panels is potentially not going to see any use.

src/components/Carousel.vue Show resolved Hide resolved
src/components/Carousel.vue Show resolved Hide resolved
src/components/Carousel.vue Show resolved Hide resolved
src/components/Carousel.vue Show resolved Hide resolved
src/components/Carousel.vue Outdated Show resolved Hide resolved
src/components/Carousel.vue Outdated Show resolved Hide resolved
src/components/Carousel.vue Show resolved Hide resolved
src/components/Carousel.vue Show resolved Hide resolved
src/components/Carousel.vue Show resolved Hide resolved
src/components/Carousel.vue Show resolved Hide resolved
danimoh and others added 12 commits January 28, 2020 11:41
Calculate min-height as height of the largest entry such that the entry
fits into the component when it's in the front.
To calculate the required carousel width, we would need to perspectively
scale the distance between the points where the perspective rays starting
at the user meet the circle (with increased radius accounting for the
entry widths) as tangents. We're not currently doing this.
- Refactored as multiple methods can't watch the same property
  (resulting in watchers defined first getting overwritten)
- unified selection update into one method
- fix a bug that a change of entries prop resulted in switching
  to entries[0] even if effectiveSelectedEntry was different
- optimize update order (saves one rendering with intermediary
  values)
- rephrase some comments
- add a comment why we can't use transform-style: preserve-3d
- use array.includes
- specify function parameter types
- return early in _shouldHide if no entries should be hidden
danimoh added a commit that referenced this pull request Jan 28, 2020
@danimoh danimoh merged commit d8314c4 into master Jan 28, 2020
@danimoh danimoh deleted the daniel/carousel branch February 26, 2020 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants