-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
feat(news): rewrite the carousel and improve ux #1513
feat(news): rewrite the carousel and improve ux #1513
Conversation
Nice catch, addressed in 77ace74.
Intentional -- I can fix this if it's deemed a showstopper, but this behavior was intentionally coded in the TypeScript implementation because of the nature of the CSS scroll snap API. Because the entire carousel lives on a dynamically sized "track" (div), the user's current slide is easily lost when resizing the browser window. To avoid this, it's reset to the first index on resize. The problem is solvable, but not without adding a lot of client-side complexity. |
That's fine. I was just noting the change in behavior. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is functional. Noted a couple of minor things.
Would like to get @luchaos's approval on the implementation.
This PR rewrites the news carousel on the home page in an effort to make numerous UX improvements and bug fixes.
Why?
The current news carousel is implemented using a legacy jQuery
rcarousel
component.rcarousel
has not received an update in almost 10 years. It has a large bundle size, is tethered to jQuery, is not responsive, and is not mobile-friendly. It was an impressive library for its time, but it unfortunately does not leverage features of the modern web.There are numerous bugs in its implementation. Two that come to mind:
rcarousel
requires the component's structure to be managed by client-side code, there is a flash of unstructured content that appears on the home page on first load for every user with a modest connection speed. The duration of this flash is at the mercy of the user's network speed.rcarousel
was written before mobile browsers were all that capable.I know at some point there is a desire to move away from a carousel for news entirely. However until that can happen, it makes sense to enable this feature to be the best it can possibly be.
How?
The carousel has been rewritten to be fully implemented in Blade, Tailwind, Alpine.js, and TypeScript. Additionally, the implementation has integration test coverage.
High level UX highlights:
Implementation highlights:
Working.Autoscroll.mp4
Desktop.Hover.Effect.mp4
Carousel.Manual.Navigate.mp4
Mobile.Swiping.mp4