RUVIDEO
Поделитесь видео 🙏

Build a React Carousel from Scratch - Tutorial Without External Libraries смотреть онлайн

In this tutorial, we will build a React carousel from scratch without using any external library. We will therefore have to devise ways to process touch swipes and mouse drags in addition to dealing with clicks and keyboard input.

After setting up our environment, we will lay out our component, style it, handle input and state, and animate it. We first handle clicks, then add transitions before handling keyboard input. Afterward, we will add indicators to know where in the carousel we are. Later, we’ll move to handle touch swipes and mouse drags. The handling here will be responsive and finger following! In the end, we will add a timer so that slides would advance on their own. To achieve a clean timer, we will make use of the component’s lifecycle with useEffect. That’s not all, we will conclude this tutorial by handling an edge chase where we have one child in the carousel. We will be using the core front-end technologies: JavaScript and CSS.

I tried to keep the code as simple and understandable as possible. I will make another video where I will show the code in a refactored way soon.

0:00 Introduction and project/component setup
6:51 Carousel layout and styling
18:56 Displaying and styling children of the component
29:07 Navigating with buttons
41:33 Bouncing back from the end (infinite prop)
44:00 Keyboard navigation
54:46 Removing scrollbar from Firefox
55:05 Adding clickable slide indicators
1:05:35 Enabling touch swiping
1:23:31 Making the swipe transition responsive
1:31:45 Enabling mouse dragging
1:43:54 Advancing on a timer
1:51:45 Stopping the timer after manual input
1:55:31 Ironing the timer – preventing advancing in the mid-swipe
1:59:05 Handling the edge case of having one child

You can find the code on
https://github.com/judabne/carousel-tutorial/

If you are not familiar with Git and you prefer to download specific stages of the code, use the links below, click on “code”, and then click on “Download ZIP”:

Project setup and carousel layout: https://github.com/judabne/carousel-tutorial
Displaying children: https://github.com/judabne/carousel-tutorial/tree/02_displaying_children
Button navigation: https://github.com/judabne/carousel-tutorial/tree/03_navigating_with_buttons
Infinite prop: https://github.com/judabne/carousel-tutorial/tree/04_infinite_option
Keyboard controls: https://github.com/judabne/carousel-tutorial/tree/05_keyboard_controls
Slide indicators: https://github.com/judabne/carousel-tutorial/tree/06_adding_indicators
Touch swipes: https://github.com/judabne/carousel-tutorial/tree/07_enabling_touch_swiping
Mouse swipes: https://github.com/judabne/carousel-tutorial/tree/08_enabling_mouse_swipes

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Build a React Carousel from Scratch - Tutorial Without External Libraries» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.