Play and Pause in Infinite Slider with CSS Only

Sdílet
Vložit
  • čas přidán 6. 09. 2024
  • In this video, I will create an infinite slider with pause and resume functionality using only CSS, using simple, clean code that is easy to reuse and upgrade.
    not just an infinite slider, through this video, let's analyze standard code together to optimize every line of code, avoiding creating bad lines of code.
    Download Code: www.lundevweb....
    -----
    Hello everyone, I'm creating a lot of new projects every day and sharing them 😍, including things you'll love to know about javascript and web Developer, Designer. Subscribe to the channel so you don't miss it ✅.
    #slider #carousel #css
    -----
    Theme VsCode I'm Using: • Create Your Own VSCode...
    Featured video series
    React Js Tutorial: • React JS
    Design Slider - Carousel web: • Design Slider - Carous...
    E-Commerce Web Coding: • E-Commerce Website Code
    Design Parallax SCrolling Effect: • Reponsive Parallax Scr...
    Web Applycation Code: • Web Application Code
    Javascript Tutorial: • Javascript Tutorial
    CSS Tutorial: • CSS Tutorial
    Many other impressive videos: / @lundeveloper
    Contact With me:
    Instagram: / lundev.web
    Email: hohoang.dev@gmail.com
    Buy me a cup of coffee by clicking the thanks button on any video. Thank you very much for your support 😍.
    Here, I share all my knowledge about Developer and Web Design including languages ​​such as HTML, CSS, SASS, Javascript, Vue, React, Bootstrap, Tailwind along with clean code techniques and UI UX Design.

Komentáře • 195

  • @lundeveloper
    @lundeveloper  Před 3 měsíci +16

    An interesting idea with just CSS, this video will also help everyone know how to code simpler, cleaner and more optimal.
    Please subscribe to watch many interesting videos every day

    • @leoleo-nf3zu
      @leoleo-nf3zu Před 2 měsíci

      I’m new to coding so can anyone tell me why use - - width etc instead of just width?

    • @kad6448
      @kad6448 Před měsícem

      @@leoleo-nf3zu I know its late and you may have probably learned this , but , anything given with a preceding -- is declared as a variable. which means u can give any name , so that "width" , is just a name . For example if you initialise a variable --newvariable = 200px , and you give that value for width= var(--newvariable ) ; height =var(--newvariable ) ; the element will have a width and height of 200px .

  • @theether5993
    @theether5993 Před 2 měsíci +41

    Idk but man this guy teach css way better than anyone. He explains the concept, mathematical understanding of that implementation and basic thing too. Hats off man

    • @lundeveloper
      @lundeveloper  Před 2 měsíci +1

      Thank you very much, looking forward to your support of the channel in the future 😍

  • @tiffari8259
    @tiffari8259 Před 3 měsíci +13

    I'm a beginner and still learning. I find this really useful and it's really good. Keep up the content!

  • @simranpreetkaur3161
    @simranpreetkaur3161 Před měsícem +1

    @lundevloper you are amazing. I was working with CSS last from 3 years but I never saw type of CSS work. Now I learn CSS again with you. I am so glad, I got your videos on YT. a big big big thanks ! Keep it up. Thanku Very Much

  • @hlulaniisaacritshuri5354
    @hlulaniisaacritshuri5354 Před 3 měsíci +15

    Your coding style is always straightforward. I have gained knowledge from your tutorials. Continue the great work bro!!😅❤️‍🔥

  • @bhaveshxrawat
    @bhaveshxrawat Před 3 měsíci +17

    Using offset properties like 'left' is not optimal as it forces the browser to repaint the elements which is a demanding task, low-end devices might make the animation look choppy. Conder using translate property.

    • @Tormentor60
      @Tormentor60 Před 2 měsíci

      And also there is 0 control over the gap between the items. I have version with translate instead of left, and with customizable gap. I can't paste link on here, but if anyone is interested you can find me on codepen, username: EntropyReversed
      Pen name: Infinite CSS Scroll

  • @yut0032387
    @yut0032387 Před 2 měsíci +6

    Your css skill is unmatched. I'm impressed.

  • @ZakariaTEKNIS
    @ZakariaTEKNIS Před 2 měsíci +4

    I FREAKING LOVE THIS CHANNEL! Great solutions, easy to implement and understand and they're reusable to top it off. Also, CSS is amazing! I had no I idea it could do all of this, they should call it JavaCSS with all the logic it handles. LOL!

  • @lundeveloper
    @lundeveloper  Před 3 měsíci +16

    Please give your suggestions for the topic in the next video 😍❤❤

    • @savagemotiv
      @savagemotiv Před 3 měsíci +1

      We need more unique hero section designs

    • @muthukumar604
      @muthukumar604 Před 3 měsíci

      Reddit comment section

    • @calvintai8950
      @calvintai8950 Před 2 měsíci

      can you make a part two for this video where on hover it doesn't only pause the animation, but also allows the user to scroll the list? Then, on unhover, the animation continues. Similar to how Perplexity's mobile app works.

    • @luizarnoldchavezburgos3638
      @luizarnoldchavezburgos3638 Před 2 měsíci

      Is there any possibility to see all the images when you load?

    • @matiasromera330
      @matiasromera330 Před 2 měsíci

      May you explain how to implement scroll drawing in a landing page? it's an interesting effect you can achieve drawing a svg image with the completion percentaje

  • @AJINVR-
    @AJINVR- Před 2 měsíci +3

    Bro's channel is a treasure for developers

    • @lundeveloper
      @lundeveloper  Před 2 měsíci +1

      Thank you very much, I hope my videos are useful

  • @ModderorWot-ci1zj
    @ModderorWot-ci1zj Před 26 dny +1

    bro you got in my recommendation from couple of weeks and I was watching and learning from your random videos mostly of 'CSS Only' stuff and yeah I subed today , I can say that you explain CSS way better then anyone including basics , math behind , and logic and code structure soo well , I would love a proper video by you on topic of explaination of code , like you doo....

  • @Ezekiel889
    @Ezekiel889 Před 2 měsíci +1

    for me, that's one of the best tutorial channels about web dev on youtube...love it... keep doing what you do

  • @Jim49267
    @Jim49267 Před 3 měsíci +4

    I understood the video without translation. Your English is beautiful.

  • @chickennuggies0242
    @chickennuggies0242 Před 3 měsíci +2

    It’s 2am, I should be going to bed but your content is so good. Thank you for sharing your knowledge!

    • @lundeveloper
      @lundeveloper  Před 3 měsíci +1

      Wao. Thank you so much 😍😍😍

  • @HarshDoes
    @HarshDoes Před 3 měsíci +3

    This guy is a gem💎
    Protect him at any cost.

  • @a062693069
    @a062693069 Před 2 měsíci +1

    Using mask-image to fade-in fade-out items is amazing!

  • @darkalpha2107
    @darkalpha2107 Před 2 dny

    Damnnnn man! That was an amazing one. Love the way you explained it ❤ (and u got urself one more subscriber hehe)

  • @DavidGutierrez-dj2kk
    @DavidGutierrez-dj2kk Před 8 dny

    You are an amazing teacher!

  • @PicSta
    @PicSta Před 2 měsíci +1

    Best explained infinite slider on CZcams. I've seen a lot of them, so I can truly say that. If I had to give you a star rating where 5 is max., then you would get only a 4 because you missed out using a speed variable to adjust speed in the style-attribute. This is helpful to adjust speed accordingly to your item count. For instance, 10s for 100 items will look way different from 10 items. Keep up this good and high quality work, you will make your way. chúc may mắn

  • @SEUNGTAEKKIM
    @SEUNGTAEKKIM Před 14 dny

    Your css skill is amazing!!!
    Recommand translate than left

  • @timothyharrison5105
    @timothyharrison5105 Před 2 měsíci

    Wow... I just tried recreating this project.
    It became clear that I really don't know much about CSS. I'm going back to learn. Especially on working calculations within CSS.

  • @RonnieMbugua
    @RonnieMbugua Před měsícem

    You are amazing at this! Never stop, this is true value🙌🏽 The Mr. Beat voice is a nice touch too! It makes everything feel easy to absorb

  • @WillM-k9p
    @WillM-k9p Před měsícem

    You earned a new subscriber! AI voice or not your CSS explanation is 🔥, so glad I found this channel! Thank you!

  • @Way_Of_The_Light
    @Way_Of_The_Light Před 2 měsíci +1

    Sick!! So glad I discovered your channel 🙌

  • @matiasromera330
    @matiasromera330 Před 2 měsíci +1

    O M G!! amazing css master I just found!

  • @stormterminatorx9951
    @stormterminatorx9951 Před měsícem

    Just too good!!! I really hope you make a full stack project series or something like that ....your AI explanations are better than many youtubers or courses....just subscribed!!!!

  • @niazhimselfangels
    @niazhimselfangels Před měsícem

    Mind-blowing stuff! 🎉🎉 Thank you for taking time to create beautiful designs and share your wisdom! ☺️

  • @alexon2010
    @alexon2010 Před měsícem

    The video is sensational, you could make a video of this with React and styled-components, to see how it would look... What would it be like if the person used the cell phone and did the manual interaction at some point?

  • @basharh6763
    @basharh6763 Před 2 měsíci +1

    slider with CSS only is insane, keep up the good work 😍

  • @abrowndude
    @abrowndude Před 2 měsíci

    very useful thank you for making these css only videos please make more!

  • @iBbeenon0piumforthelast10days

    best channel explaining css, exited to see more content from u
    and thanks for posting the codes

  • @szaboistvan369
    @szaboistvan369 Před 2 měsíci

    Awesome approach. A few thoughts:
    - It can be handy to put the speed into an optional variable as well
    - Was wondering if the reverse could be solved with a direction variable with a bit of math without duplicating the animations
    - Would feel more complete if we can get rid of the white space when starting... though I guess this is a bit tricky because of the animation delay

    • @lundeveloper
      @lundeveloper  Před 2 měsíci +1

      Of course, Everything can be solved with mathematics

    • @lulufv
      @lulufv Před 2 měsíci +3

      Regarding the white space, my solution was to subtract the number of items in the animation-delay line, instead of just 1, so mine looks like this:
      animation-delay: calc((10s / var(--quantity)) * (var(--position) - var(--quantity)));
      I don't know if it works on all cases but even if it doesn't, it might help

    • @jeisongarzon6066
      @jeisongarzon6066 Před měsícem

      @@lulufv It worked ty bro !

  • @keitho6974
    @keitho6974 Před 2 měsíci

    Your stuff is awesome. Been sharing it with other dev friends of mine.

  • @bhaveshxrawat
    @bhaveshxrawat Před 3 měsíci +4

    we have got Mr. Beast of Dev world

  • @CosmacCreation
    @CosmacCreation Před 24 dny

    Best video bro , just wanna know some card animation if you can taught us❤

  • @robertwallace5498
    @robertwallace5498 Před 2 měsíci

    You have the most impressive and useful css skills

  • @julianvelandia1668
    @julianvelandia1668 Před 2 měsíci

    I loved this idea

  • @robertodepasamonte3434
    @robertodepasamonte3434 Před 3 měsíci

    Very novel approach to creating an infinite slider or marque effect. Thanks for sharing. A couple of questions: (1) how can one incorporate a variable to easily set the speed of the slider? and (2) how can automatically scale the size of the images (perhaps using the calc() function) to accommodate changing viewport sizes?

    • @lundeveloper
      @lundeveloper  Před 3 měsíci

      1. If you need to change the speed with a variable, you just need to create an additional --time variable like I did with quantity, then in the css, replace 10s with var(--time). 2. This slider, when you change the wifth for each different screen, will shrink itself without you needing to edit anything further.

  • @MrSofazocker
    @MrSofazocker Před 2 měsíci +1

    Ho can I have all items of the slider be visible immediately on page load, instead of them first animating in from the left and then repeating?

  • @user-bu9px8cu4d
    @user-bu9px8cu4d Před 2 měsíci

    Now, Thats a tutorial. GREAT

  • @ajibolagenius
    @ajibolagenius Před 2 měsíci

    blown 🤯🤯🤯 I'd also appreciate if you can share your VS Code extensions with us.

  • @shaleen9434
    @shaleen9434 Před 2 měsíci +1

    Hey i was working on a Marquee which is controlled by scroll event.Now the marquee will move to peft slide if the srcoll deltaY is +ve and vice versa,the only problem is that if the user scroll from +ve to -ve is changing the animation but i don't want the animation to stsrt again from the beginning rather i want the animation to start from where it ended.Please do you have any solution?

  • @frnjtt-pn6wj
    @frnjtt-pn6wj Před 2 měsíci

    Great technique! Thank you for the great content❤What you think about making a video to show the responsiveness side?

  • @user-jk9nm3pf9k
    @user-jk9nm3pf9k Před měsícem +1

    I want a complete course on CSS animations and design as like you do in your videos. Can you please provide it?

  • @exotreus
    @exotreus Před 2 měsíci

    Amazing tutorials so far bro, but I'm really interested in that title changing fill and color depending on the image under it. I'd love at least a short about how you can recreate that

    • @lundeveloper
      @lundeveloper  Před 2 měsíci

      Thank you so much, I will guide about it in the next video

    • @exotreus
      @exotreus Před 2 měsíci

      @@lundeveloper Actually, you could stretch it to your usual vid length by just making a general video on interesting masks like this one. It's a great website feature, and I am sure that not only I will really appreciate it.

  • @andyl9920
    @andyl9920 Před 2 měsíci

    Declaring reverse and adding var sounds like JS to me. But what do i know i aint no expert. Still learning. Learned something new today for CSS

  • @surij8376
    @surij8376 Před 2 měsíci

    Please also share how you get your design resources. Do you design it yourself? If so please do make tutorials on that as well.

  • @learnweb585
    @learnweb585 Před měsícem

    awesome work brother

  • @GiuseppeMinisteriofswing

    Why not just define only the animation-name for the reverse slider?
    I am also wondering if just setting the animation-direction to reverse wouldn't do the job.
    Anyway, great content!

  • @samuelmovies1289
    @samuelmovies1289 Před 3 měsíci +2

    how did you do that ? the text and image in backdround only the face part text is lighten and only showing text border
    text border

    • @lundeveloper
      @lundeveloper  Před 3 měsíci +1

      I created two identical texts, the black text is behind the image, and the border-only text is in front of the image.

    • @samuelmovies1289
      @samuelmovies1289 Před 3 měsíci

      @@lundeveloper do you have any tutorial for that

  • @hdlrpnzr
    @hdlrpnzr Před 3 měsíci

    Gracias por compartir tus conocimientos Lun

  • @jmr1920
    @jmr1920 Před 3 měsíci +2

    can you make a video mastering css grid and flex box?

  • @mdan.___
    @mdan.___ Před 2 měsíci

    very good in explaining your code 🤩

  • @loulou81400
    @loulou81400 Před 2 měsíci

    Hello !! What a tutorial, realy cool !!
    Where do you find all your nice images?

  • @DavidGutierrez-dj2kk
    @DavidGutierrez-dj2kk Před 11 dny

    You kick ass!

  • @WuToriToriwu
    @WuToriToriwu Před 2 měsíci

    Very helpful!

  • @user-hm1ld3bg3g
    @user-hm1ld3bg3g Před 3 měsíci

    Great work and explanation🥰🥰

  • @HowTO-lq7pg
    @HowTO-lq7pg Před 2 měsíci

    Great work

  • @lazy-hero.
    @lazy-hero. Před 2 měsíci

    Superb content

  • @miladganjali1440
    @miladganjali1440 Před 3 měsíci +3

    I really like your contents but please change the AI voice to someone else Mr. Beast's voice is for kids and entertainment most of your viewers are working-class

  • @neverold6781
    @neverold6781 Před 2 měsíci

    Great 👍🏼😃

  • @MdSaad-m7m
    @MdSaad-m7m Před 11 dny

    Bro, you're awesome. But I want to know how do make the animation start from the left:0; I mean when the animation starts there is big blank space. It doesn't look good to me.

  • @farhanstack
    @farhanstack Před 3 měsíci

    Thank You Lun DEV.

  • @blackweb-1403
    @blackweb-1403 Před 2 měsíci

    you are pro player of Css😅😅

  • @user-tq2yq5wr5y
    @user-tq2yq5wr5y Před 2 měsíci

    this was really good

  • @iamsomewhere
    @iamsomewhere Před 24 dny

    The fact that you don't put a space between your selectors/property declarations and your opening curly brace { absolutely kills me. 😵

  • @okon1624
    @okon1624 Před 3 měsíci

    thanks for the lecture, but is difficult to comprehend

  • @spidysense7754
    @spidysense7754 Před 17 dny

    You are 💎

  • @user-vh9rj3kz4t
    @user-vh9rj3kz4t Před 3 měsíci

    Impressive 😊

  • @coderoyalty
    @coderoyalty Před 3 měsíci +1

    quality: 1000%

    • @lundeveloper
      @lundeveloper  Před 3 měsíci +1

      You should not do so, because it will cause the distance of the items to be very far apart.

    • @coderoyalty
      @coderoyalty Před 3 měsíci

      @@lundeveloper ooh,,, was rating your tutorial...

  • @pedroriveralopez8566
    @pedroriveralopez8566 Před 2 měsíci

    Amazing bro!
    How you do that hero with the letters in transparency with the image?
    or its only a complete image?

    • @lundeveloper
      @lundeveloper  Před 2 měsíci +1

      Hello everyone, please watch the latest video I posted recently. I guided everyone to create it

  • @GenZBikram
    @GenZBikram Před měsícem

    From where you have learnt this and how many years you're working with css🙂 plz reply

  • @jaktojestzajeta
    @jaktojestzajeta Před 2 měsíci

    Please. Could you make it so the slider is not empty at the page refresh? I think it would be better if the photos were visible at start

  • @ninjatechstudio
    @ninjatechstudio Před 2 měsíci

    excellent

  • @lakshaychauhan9190
    @lakshaychauhan9190 Před 2 měsíci

    good tutorial ! I have a few question regarding these infinite animations - how much of such can we use in a site and where in js engine or browser are these run ? where do theh get memory allocated etc I want to know details what to look ?

  • @i33o7dot9
    @i33o7dot9 Před 2 měsíci

    thanks Mr. Beast for this tutorial

  • @denisdjota8056
    @denisdjota8056 Před měsícem

    😮😮🤩😍

  • @ntloc1964
    @ntloc1964 Před 3 měsíci

    Ủa cái này là a nói đó hả, xịn thật sự

  • @jagritmondal8144
    @jagritmondal8144 Před měsícem

    can you please teach me how to create a background shifting effect when we hover over a particular image of a slider? when we hover over a particular image , the hero section must change its background , which is the same background as in the slider. I just got this idea while watching this video, and tried but... not working. please help me.

  • @nodeguru7663
    @nodeguru7663 Před 2 měsíci

    Amazing 🫂

  • @trainerdevesh
    @trainerdevesh Před 2 měsíci +32

    Mr Beast 🤔☠️🗿

  • @rahul9704
    @rahul9704 Před 2 měsíci

    What if you wanted to have all items visible on first load, and not moving in from the right the first time?

  • @abhisekgupta1543
    @abhisekgupta1543 Před 3 měsíci +1

    MrBeast?😮

  • @ARLIH2007
    @ARLIH2007 Před 8 dny

    How to control the gap between each items, I want to make the gap smaller

  • @pexeixv
    @pexeixv Před 2 měsíci

    Please publish this to NPM and I will use it

  • @compton8301
    @compton8301 Před 2 měsíci

    Wow

  • @Cell-T
    @Cell-T Před 22 dny

    css god

  • @rashidbazzoun733
    @rashidbazzoun733 Před 2 měsíci

    can you please tell me where do you get your assist, like the model and the logos?

  • @aminkamrani2690
    @aminkamrani2690 Před 2 měsíci +2

    why is mrbeast teaching me CSS?

  • @BeHappy-cb2np
    @BeHappy-cb2np Před 3 měsíci

    Thank you

  • @kaustubhudamale9803
    @kaustubhudamale9803 Před 11 dny

    i cant figure out how to assign the position variables to each of the images in react man please help...

  • @jee0806
    @jee0806 Před 2 měsíci

    hay @lundeveloper man your tutorial is good .but i wanted to add text instead of jpg , i try to do it but sometimes text goes to new line as its length is long i try to ply with other properties but nothing happens, can you tell me what should i change so that i can use text instead of image

  • @justinoneill2837
    @justinoneill2837 Před 2 měsíci

    wonder if you could just make the animation happen on container and not individual items

  • @HaiPham-sm3xc
    @HaiPham-sm3xc Před 3 měsíci

    hay quá anh ơi🥰

  • @ShivamUchiha
    @ShivamUchiha Před 2 měsíci

    wow

  • @hkseditz9720
    @hkseditz9720 Před 2 měsíci

    my div and image tags appear in different line , is there a setting to make it wrap in one line

  • @azulamazigh2789
    @azulamazigh2789 Před 2 měsíci

    why not animation-direction: reverse; ?

  • @blue-sneko4675
    @blue-sneko4675 Před 3 měsíci +1

    ❤❤❤❤❤❤❤❤

  • @wamxmonster3297
    @wamxmonster3297 Před 2 měsíci

    Can you please please use react and do this I tried it but it’s been two days and it’s not working

  • @iamsomewhere
    @iamsomewhere Před 24 dny

    How can you set the sider to be "filled" with child elements from the start of the animation, rather than outside of the parent div? I don't want the slider container to be empty on page-load, but filled with the appropriate content.

    • @lundeveloper
      @lundeveloper  Před 24 dny

      Check out my latest video, I dedicated a video to this topic

    • @iamsomewhere
      @iamsomewhere Před 24 dny

      @@lundeveloper link to video?