Тёмный

Thinking on ways to solve CAROUSELS 

Chrome for Developers
Подписаться 760 тыс.
Просмотров 24 тыс.
50% 1

Опубликовано:

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 73   
@briankgarland
@briankgarland 2 года назад
Yes, cyclical and auto-play are features my clients ask for on a regular basis.
@k-yo
@k-yo 2 года назад
Considering a KISS approach, you could cycle it by setting a `scrollTo(0, 0)` if the scroll position is at the end (something like: `carousel.clientWidth + carousel.scrollLeft >= carousel.scrollWidth) when running the `next()` method. This ensures the carousel will scroll back to the beginning when in the last slide (albeit not like an infinite carousel, but I did mention KISS). Then for auto-playing, just use a `setInterval(next(), intervalYouWantInMs)` and you are set.
@enijar
@enijar 2 года назад
Adam's videos are always amazing - especially the demos, wow they are awesome!
@GimmeMoreMilk
@GimmeMoreMilk 2 года назад
This looks like the gold standard of carousel design, if I need to add one I'm definitely gonna use this! 🙌
@RickBeacham
@RickBeacham 2 года назад
Adman always has the good stuff!
@bencecsik8758
@bencecsik8758 2 года назад
I would love to see a second episode where you implement auto scroll and cyclical play :)
@markovujanic
@markovujanic Год назад
Wow, this is probably the greatest carousel the world has ever seen :).
@Dorchwoods
@Dorchwoods Год назад
It's wild how much thought and engineering goes into something you'd think would be so simple. Excellent stuff Adam!!
@RickBeacham
@RickBeacham 2 года назад
Dude I'm very impressed. A round of applause! Never ending scrolling was something I could never figure out.
@victordelacruz8440
@victordelacruz8440 2 года назад
Thank you for talking about ARIA. I've always been in being aware of the general or basics about it.
@ishwarrimal1393
@ishwarrimal1393 2 года назад
LOL your HULK mode swiping is crazy :D "huuiaaa huiiaaaa"
@denischudinov2379
@denischudinov2379 7 месяцев назад
Great job, love it!
@pdsnpsnldlqnop3330
@pdsnpsnldlqnop3330 2 года назад
Round of applause! I am going straight for the demo, then the repo and then in the project it goes, homepage first. Couple of questions: Why use divs instead of an unordered list to contain the figures? Would that make a difference to accessibility? I definitely see a 'list' of 'images'. Next question. I am going to have to use this for product carousels, and the product images on a ecommerce product page. I will need to add a zoom feature that loads a very large but webp/avif compressed zoom image. Given devices have a native zoom feature and I can just show a basic couple of zoom buttons for full screen desktop, any ideas on the gotchas, regarding accessibility? Or will I learn that by the time I have my homepage slider done? Thanks a million. That was the best accessibility talk ever. I personally search and replace 'accessibility' with 'putting the customer first'. Just thought I would share that with you.
@k-yo
@k-yo 2 года назад
Same question regarding the divs. We've made one using a list inside a div with listbox role
@AdamArgyleInk
@AdamArgyleInk 2 года назад
hi! thanks for the kind words =) I was told that a list was the wrong way to markup the carousel because lists create various assumption about interaction and presentation patterns that carousels don't follow. Like a screen reader may announce it as a list of items but the user wont be able to interact with them like they would normally a list, plus it is kinda noise in regards to announcing the contents. Regarding adding zoom and the accessibility gotchas, I'd say just make sure a keyboard can interact with the desktop zoom buttons too. Mobile users can pinch in and pan around, do your best to give a keyboard user a similar experience with their arrow keys. Maybe even consider a dialog element so when the zoom experience is launched, the background page is inert. Thanks for watching, hope this was helpful!
@pdsnpsnldlqnop3330
@pdsnpsnldlqnop3330 2 года назад
@@AdamArgyleInk I am doing a theme for a Magento 2 store. The frontend was written before CSS Grid and custom variables so it has mountains of less/sass/bloat and does badly at layout shift and so much else. I need a universal carousel and zoom tool, ideally to work with the existing markup for ease of upgrades. None of the 'owl carousels' and other things in its framework are anywhere near what you presented here in technical accomplishment, hence there are lighthouse errors for accessibility. In your series you present ideas that push the weeds back for the likes of me to be able to venture in. Thanks so much! I also learned of postCSS which is so the way to go, thanks to your series! Got my mojo back, I can do these things and the knowledge is easy to learn because it deals with intrinsic things in the web spec not random framework stuff.
@brokeloser
@brokeloser 2 года назад
For some reason all carousel tutorials skip the cyclical feature that is often requested for carousels. Why is this always so hard with modern dev tooling? And why not properly addressed in this video, who wants to get to the end of the carousel then click multiple times all the way back to the start
@AdamArgyleInk
@AdamArgyleInk 2 года назад
there's proposals for CSS overflow to feature cyclical scrolling natively, and I'm kinda holding out for it. I tested a few quick hacky ways to do the cyclical scrolling and it just felt like mess on top of something clean. I'll revisit it and add it later when I've found a good solution that's seamless.
@OmarElmasry1
@OmarElmasry1 2 года назад
@@AdamArgyleInk thanks for your great efforts Adam, I would really like a second episode on the same topic (digging deeper into it).
@remymartins6778
@remymartins6778 2 года назад
I was impressed by the accessibility. Accessibility has always been a concern for me in these kinds of UI. @Adam Argyle can you add the link to the State Machine, would love to explore that too.
@AdamArgyleInk
@AdamArgyleInk 2 года назад
here ya go! stately.ai/registry/editor/d132db3c-ccbe-4a99-97f9-de162bb65607
@dbroche
@dbroche 2 года назад
@@AdamArgyleInk as soon as I saw the diagram my first thought was, "wonder if this is Xstate..." sure enough, it's under the hood! what a robust carousel! - had to have been a ton of work - I'm guessing this is one of those legendary 20% projects I've heard Googlers get as part of the employment agreement
@nicklasbryntesson1789
@nicklasbryntesson1789 2 года назад
Relly nice! Did some experimenting with a cyclical slider like the t-shirt example recently, but it became really complex with uneven number of items. I would really like to see your take on a cyclical slider aswell!
@StefanBaiatu
@StefanBaiatu 2 года назад
That is very cool ! 😎
@whatthefunction9140
@whatthefunction9140 2 года назад
This is getting spicy pepper 🌶 🌶 🫑 🌶
@juraev0056
@juraev0056 2 года назад
Awesome, I will steal this if you don't mind :)
@metalbroga
@metalbroga 2 года назад
Fantastic
@abe10
@abe10 2 года назад
Yep definitely need a cyclical carousel.
@briankgarland
@briankgarland 2 года назад
BTW, I'm not sure if it's still being developed or supported, but I still use owl-carousel.
@regenjo
@regenjo 2 года назад
It's a real hoot.
@StephanBijzitter
@StephanBijzitter 2 года назад
4:43 regarding autoplay and screen readers, disabling autoplay with prefers reduced motion (rather than autoplaying without animation) would probably be a good compromise.
@FaizanAnwerAli
@FaizanAnwerAli 2 года назад
At 3:55 you mentioned that you didn't implement a carousel with loop functionality. Now that's very important. Just today I have implemented it in five different locations on my frontend design. By the way, I've used a third-party library for carousels aka Splidejs.
@AdamArgyleInk
@AdamArgyleInk 2 года назад
I'll add it later, but I couldnt find a seamless way to do it. i could definitely add it, but each strategy had a quark and it felt uncanny.
@Sinanisler
@Sinanisler 2 года назад
niceee
@atosupriyanto6990
@atosupriyanto6990 Год назад
Need somebody to make this one into a WordPress plugin for make better performance
@victordelacruz8440
@victordelacruz8440 2 года назад
What you mean about hydration? Is that a term in ECMAScript?
@whatthefunction9140
@whatthefunction9140 2 года назад
How did you setup that debugging corner?
@AdamArgyleInk
@AdamArgyleInk 2 года назад
local installs of browsers and emulators all shared across a monitor!
@the-old-channel
@the-old-channel 2 года назад
The demo doesn’t work in Safari 13... :(
@AdamArgyleInk
@AdamArgyleInk 2 года назад
awww poo, sorry about that!
@TheUnknownFactor
@TheUnknownFactor 2 года назад
When I was building a carousel recently, and I looked for accessibility guidance; the not-selected carousel items were aria-hidden instead of inert. Can you explain the pros and cons of the different options. One downside of inert seems to be browser compatibility- could inert be combined with alternatives for better results, or would that just confuse screen readers / accessibility tools?
@brentmcd12
@brentmcd12 2 года назад
haha ! wow ! that is very cool ! 😎🤙💻
@brentmcd12
@brentmcd12 2 года назад
really appreciate the dark Mode !
@brentmcd12
@brentmcd12 2 года назад
what if you were to print the page ? what colors would the final output to the printer be ? dark mode or light ?
@AdamArgyleInk
@AdamArgyleInk 2 года назад
@@brentmcd12 huh, i dunno! hopefully light mode hehe since that's what color paper usually is
@pooya5286
@pooya5286 2 года назад
Thank you for the great content. I wish we could just hide the scrollbar. looks off on windows
@andsheterliak
@andsheterliak 2 года назад
/* Works in Firefox */ .scrolling-element { scrollbar-width: none; } /* Works in Chromium browsers and Safari */ .scrolling-element::-webkit-scrollbar { display: none; }
@Wrokzor
@Wrokzor 2 года назад
for webkit browsers like chrome you could use: .gui-carousel--scroller::-webkit-scrollbar { opacity: 0; } and for firefox you can use: .gui-carousel--scroller{ scrollbar-width: none; }
@andsheterliak
@andsheterliak 2 года назад
@@Wrokzor Safari & Chrome for IOS only support "display: none"
@AdamArgyleInk
@AdamArgyleInk 2 года назад
follow the demo link, you'll see an example without scroll bars, it's just an option you pass via HTML!
@nicolaturco8010
@nicolaturco8010 Год назад
buggy on safari, maybe for the nesting support
@berndeckenfels
@berndeckenfels 2 года назад
For portrait mobile devices the scroll arrows should probably overlap the image and not have a gutter?
@AdamArgyleInk
@AdamArgyleInk 2 года назад
totally an easy thing to modify, the :where() selector makes selecting and styling a 0 battle
@supportic
@supportic 2 года назад
Regarding accessibility is there a reliable source which says in which order the elements should be placed? current: prev / next / content / pagination What I could also imagine is that the user actually reads the content first via screenreader instead of facing the next button right away e.g. example: prev / content / next / navigation
@AdamArgyleInk
@AdamArgyleInk 2 года назад
here's where I studied for the foundation of my carousel, it speaks to some of this www.w3.org/WAI/ARIA/apg/patterns/carousel/
@StridBR
@StridBR 2 года назад
Are you using any tools to automate the lipsyncing on the character ?
@imomar
@imomar 2 года назад
this is awesome. thanks for building it. I had a question regarding the injecting of controls. what if you want to change the position of the controls, say place the arrows next to each other in the right upper corner?
@AdamArgyleInk
@AdamArgyleInk 2 года назад
for now you can easily write your own styles and put the arrows somewhere else! i didnt get time to build preconfigured arrow location alternatives, though I do think that's a great next feature for it
@forceboxed
@forceboxed 2 года назад
What convention are you using for naming your CSS classes? If it's BEM, then shouldn't it be, for example, "gui-carousel__snap" instead of "gui-carousel--snap"
@AdamArgyleInk
@AdamArgyleInk 2 года назад
i didnt do strict bem, just something hopefully helpful to read
@obaone
@obaone 2 года назад
How would you speed up the bottom slide indicator kinda lags behind the slide transition
@AdamArgyleInk
@AdamArgyleInk 2 года назад
yea, this is because scrollend is when everything syncs and not when snap has changed. i have proposals for events that would let the pagination stay synced with the scroll snap area in real time, but currently the best I can do is wait for scroll end to attempt to derive which page is in view. check out the proposals here! github.com/argyleink/ScrollSnapExplainers
@yakirgot
@yakirgot 2 года назад
Do you really need an aria-label if you already have a title attribute on the element?
@AdamArgyleInk
@AdamArgyleInk 2 года назад
Different labels for different users, just tryin to meet them where they are and via the channels their tools are ready to display
@yakirgot
@yakirgot 2 года назад
@@AdamArgyleInk I think I meant specifically for a case where the title and aria-label had the same text, but I understand the gist 😊 Thank you!
@annamuller4730
@annamuller4730 2 года назад
@Adam Agryle There is so much talk on accessibility and usability just to fail it with the way you display your css code. Hiding the assignment = and the quotation marks " to make it as hard to read as you can make it is just... Not everyone is using this kind of display style and if you are not used to this, this makes reading it a nightmare.
@JasvirsinghJasvirsingh-mz3nn
❤🎉
@Stoney_Eagle
@Stoney_Eagle 2 года назад
I can see why you work at Google 😉
@motoCoderOfficial
@motoCoderOfficial 2 года назад
1st
@tomaszkumiega4325
@tomaszkumiega4325 2 года назад
@Adam Agryle What kind of software do you use when showing the carousel scheme?
@AdamArgyleInk
@AdamArgyleInk 2 года назад
DevTools and it's emulation features ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gOkM1L6azEI.html
@Manish-fm5iv
@Manish-fm5iv 2 года назад
Thanks for sharing. Your voice is so happy.
@MrZiyak99
@MrZiyak99 2 года назад
What i would like to see is a cyclical version of this similar to Netfix where the transition from the start to the end is seemless.
Далее
Thinking on ways to solve FABs
14:30
Просмотров 13 тыс.
Thinking on ways to solve TOOLTIPS
20:41
Просмотров 19 тыс.
Can I Create Netflix’s Video Carousel UI?
1:01:10
Просмотров 133 тыс.
DOM ready events considered harmful | HTTP 203
22:09
Просмотров 26 тыс.
Thinking on ways to solve DIALOG
16:07
Просмотров 39 тыс.
Thinking on ways to solve TRANSITIONS
21:22
Просмотров 17 тыс.
Thinking on ways to solve COLOR SCHEMES
12:21
Просмотров 20 тыс.
Are Sliders And Carousels Good Or Bad In Web Design?
7:49
It's viewports all the way down | HTTP 203
43:35
Просмотров 30 тыс.
Create Accessible Tabs with HTML, CSS & JS
52:39
Просмотров 58 тыс.
Incredible scroll-based animations with CSS-only
32:23
Просмотров 439 тыс.