Customizable typewriter animation with CSS

Поделиться
HTML-код
  • Опубликовано: 8 фев 2025

Комментарии • 352

  • @primalscream40
    @primalscream40 3 года назад +361

    I’m totally new to html/ css. The stuff that you create with css just totally makes me keep pushing myself to learn more. Your an inspiration to me. Keep up the awesome work.

    • @KevinPowell
      @KevinPowell  3 года назад +38

      Thanks so much, and keep at it!

    • @kaustubha7371
      @kaustubha7371 3 года назад +6

      I am down on the same path and its true it helps me keep pushing myself to learn more.

    • @daleryanaldover6545
      @daleryanaldover6545 3 года назад +5

      keep it up guys, the same reason why I started learning css 7 years ago

    • @primalscream40
      @primalscream40 3 года назад +3

      @@daleryanaldover6545 I’ve got a question. When I’m in html/css and have live server open. How can I make my browser scale to adjust without having to release the window to see the changes take effect. Make sense.

    • @daleryanaldover6545
      @daleryanaldover6545 3 года назад +6

      @@primalscream40 if you mean the same as in Kevin's videos where he saves the file and browser automatically updates the saved changes. Then, try searching for the term "Hot reloading or Live reloading". You need to install some dependency depending on what framework you are working on. If you are using VS Code, you can install Live Server extension as it features live reloading out of the box.

  • @MrSupdup
    @MrSupdup 3 года назад +34

    I just wanted to say that after watching your Neon video I instantly subscribed, and now seeing this video I'm a permanent fan. You're showing me really cool CSS tricks that I can actually imagine using in my projects (this one I'll actually be using in my next project, so thank-you for that!), in a way that is extremely digestible. The way you work through your logic out loud is exactly how my brain thinks, you have an excellent educational style and I'm really appreciative of the content and the effort!

    • @KevinPowell
      @KevinPowell  3 года назад +3

      Thanks :)

    • @charusharma7872
      @charusharma7872 2 года назад

      animated Box With CSS
      ruclips.net/video/gBmx3RmThDE/видео.html

  • @emmanuelibuaka4118
    @emmanuelibuaka4118 3 года назад +1

    The first sign of a good tutor is that he's not afraid to refer you to persons or resources that he knows can help in your learning journey. Much ❤️ Kevin

  • @Reloko369
    @Reloko369 3 года назад +1

    Thanks, men. What you do is gold to me. I'm 36 years old and learning from 0 HTML, CSS, and JS. You make me realize the power of CSS in all this. I love the passion you put into it. Also, I have to say, your English is crystalline for me (Argentinian). I reconnect to learn this language with your videos.

  • @captainray7465
    @captainray7465 3 года назад +34

    That steps function is really cool.

  • @soumyajitdey5720
    @soumyajitdey5720 3 года назад +2

    I love Kevin so much. A CSS guru! I used to hate CSS so much because I didn't understand it properly and now after knowing the basics what he is doing in each line absolutely makes sense. I will surely integrate this in one of my projects.

  • @AbdicateDotNet
    @AbdicateDotNet 3 года назад +2

    Wow!! I've been "playing" in HTML/CSS since their inception (revealing my age) and I am so happy for CSS 3! What a difference! Thank you for teaching an old dog new tricks! I am going to WOW folks now! 👍🙌❤😊😷

  • @unnervingibet117
    @unnervingibet117 3 года назад +5

    I’m learning python but watching this on CSS was such a blast, I think I’m just obsessed with code, it’s so fun to watch and learn and to make matters better, you’re very entertaining

    • @charusharma7872
      @charusharma7872 2 года назад

      animated Box With CSS
      ruclips.net/video/gBmx3RmThDE/видео.html

  • @alicianunez7801
    @alicianunez7801 3 года назад +1

    Thank you so much for this! I had trouble with my cursor going past my text but the display: grid and the width: max-content completely fixed it! You're the only person on the internet that was able to solve it!

  • @MrMeszaros
    @MrMeszaros 3 года назад +68

    Hey, to get a better bink cursor:
    change to steps(2, start) - with infinite, this will cycle through the two end-states
    use visibility: hidden instead of background: transparent - this will ensure no transparency blending occurs.

    • @gykonik
      @gykonik 3 года назад +4

      Wow, really improves the look. Thanks! :)

    • @alysonsantos4686
      @alysonsantos4686 2 года назад +1

      Thank you! It got better.

    • @govindptl
      @govindptl Год назад

      well, this kills the practical typing animation.

    • @ujjawalmaru8048
      @ujjawalmaru8048 Год назад

      @@gykonik hvhgbhj

  • @Gloom-Grave
    @Gloom-Grave 3 года назад +49

    The icing on the cake would be if you can make cursor movements from one position to the next fluid. That's what I really enjoy about MS Office :)

    • @mariocamspam72
      @mariocamspam72 3 года назад +2

      exactly! thats called a smooth caret

    • @dawatcherz
      @dawatcherz 3 года назад

      for the speed of the cursor you could use calc( var(--typewriterspeed) / var(--typewriterCharacters)) , i think

    • @RondellKB
      @RondellKB 2 года назад +3

      This is actually easy, a little cumbersome but very straightforward. Instead of using the step function, you can manually enter fixed points in the animation, and for each one, add to the left position, the width of one character.
      Example. Say your word has 10 characters in it, instead of doing step(10), you can add animation points: 10%, 20%, 30%, and so on up to 100%. Since the font is monospaced, each character will have the same width, find the width of one character, and in each animation point, add the width of the character to the current value of left. the result is a smooth transition from one character to the next.

    • @fruitygranulizer540
      @fruitygranulizer540 2 года назад +1

      ive always found that super annoying, the cursor feels like its lagging behind when you type quickly ( i type 120 - 140 wpm )

  • @calin-andreipantis-simut6241
    @calin-andreipantis-simut6241 3 года назад

    Man, your videos are so inspiring, I am following you since the beginning where I didn't know what CSS even is. Now I am a developer and still find your videos to be so amazing. Keep going, you're doing a great job. I really appreciate your work! Congratulations!

  • @mrsHoffmann
    @mrsHoffmann 3 года назад

    Ugh, I needed this so badly two weeks ago, I just wanted to add this animation to my website and didn't find any good tutorials, I am happy now

  • @AshishKumar-rq8gb
    @AshishKumar-rq8gb 3 года назад +2

    Man. Thankyou so much. I have been working as a front end dev for 1 year and I was so afraid of using animations. Rather I should say, I never tried them. And you taught them through this so easily. Thanks a ton. I am going to follow all your tuts now and see how well I can do. :-)

    • @charusharma7872
      @charusharma7872 2 года назад

      animated Box With CSS
      ruclips.net/video/gBmx3RmThDE/видео.html

  • @mimoduocss
    @mimoduocss 3 года назад +40

    Dang clever trick and nice explanation! Clip-path would help remove the dependency on the background color ;)

    • @xXYourShadowDaniXx
      @xXYourShadowDaniXx 3 года назад +5

      Good episode, I made the clip path version here: codepen.io/Event_Horizon/pen/RwpQNyB?editors=1100

    • @_AverageGuy
      @_AverageGuy 2 года назад

      I know it's late but can you explain how to use clip path cuz I have an image as background

  • @deathstarhz3426
    @deathstarhz3426 3 года назад +46

    Pro Tip: If you want to find out how many characters are in any given amount of text, highlight it in vs code, and look at the bottom bar, it should say "Ln ##, Col ## ( [number-of-characters] selected)

    • @b3nj4m1nyt
      @b3nj4m1nyt Год назад

      I already knew it but somehow I forgot it, so I actually opened notepad because I remembered that it has the same feature 😆

  • @zneverending3585
    @zneverending3585 3 года назад +6

    You are the reason of why i still can't start learning JS after Html and Css

  • @johndoggett4657
    @johndoggett4657 3 года назад +5

    Dood Kevin you are a mind reader. I wanted to learn this effect for work and my portfolio.

  • @UniqueBots
    @UniqueBots 3 года назад +2

    Dude this is PURE GENUISNESS! Loved the tricks.

  • @zachjensz
    @zachjensz 3 года назад +3

    OMG I didn't notice the headphones until you said

  • @Victor_Marius
    @Victor_Marius 3 года назад +4

    Yet again I learned something new from you. Didn't knew about steps() for animation

    • @charusharma7872
      @charusharma7872 2 года назад

      animated Box With CSS
      ruclips.net/video/gBmx3RmThDE/видео.html

  • @advanceringnewholder
    @advanceringnewholder 3 года назад

    this is probably the channel i need to finish my project

  • @AdityaDhungana
    @AdityaDhungana 3 года назад

    You're great Kevin.

  • @softvibes1602
    @softvibes1602 3 года назад

    dude, you are a pro in CSS, I'm subbing to you right now!

  • @ibrahimkedir2280
    @ibrahimkedir2280 3 года назад

    You are the best mate, cheers really; sometimes I just hit the like buttons of your videos with out even watching them.

  • @Morrile1
    @Morrile1 3 года назад

    I love tips like this, straightforward and simple.

  • @JaskSkull1991
    @JaskSkull1991 3 года назад

    Bro! Thank you! I am building my website to showcase my blockchain and cybersecurity projects and was looking to add a typewriter effect and nothing worked, but yours solution did! Thank you!

  • @theshowwatcher3414
    @theshowwatcher3414 3 года назад

    In your every video I learn something new.

  • @shaheerkhan_khawjikzai
    @shaheerkhan_khawjikzai Год назад

    I try this on my portfolio ,great work Kevin

  • @0x007A
    @0x007A 2 года назад

    This technique might add a subtle bit of bling to my portfolio website that I am developing.

  • @vin-kry
    @vin-kry 3 года назад +1

    Thanks a lot KP for this Tutorial!!!
    Actually, As a React developer I was using tract Typical for such typewriter effects.
    But wanted to create it with Css but unable to create.
    Now I can create easily...
    Thanks a lot!!!!

    • @charusharma7872
      @charusharma7872 2 года назад

      animated Box With CSS
      ruclips.net/video/gBmx3RmThDE/видео.html

  • @__matthi
    @__matthi 3 года назад +1

    You're brilliant at explaining things. Thank you so much!

  • @codehal
    @codehal 2 года назад +1

    Amazing tutorial sir!

  • @soyaiburrahman3806
    @soyaiburrahman3806 3 года назад

    only one of your videos solves many of my problems.thanks boss

  • @CloudBroadcasts
    @CloudBroadcasts 3 года назад +3

    Thanks for the content - I’ve learned a lot from you. Keep ‘em coming!

  • @teal4069
    @teal4069 3 года назад

    Amazing tutorial... not only the content but also your explanations are so on point

    • @charusharma7872
      @charusharma7872 2 года назад

      animated Box With CSS
      ruclips.net/video/gBmx3RmThDE/видео.html

  • @plejra
    @plejra Год назад

    Wow I thought i will be simple. 20 minutes for so simple effect

  • @raigallino
    @raigallino 3 года назад

    I hated css and you make me love it. Thank you kevin!

  • @gamersdestiny403
    @gamersdestiny403 3 года назад

    😮 I thought it was a old video. This video is just right on time 😯😯😯😯

  • @yauhenisafronau9302
    @yauhenisafronau9302 2 года назад

    Great work. Learning from the greatest masters.

  • @gopalloharnew5948
    @gopalloharnew5948 3 года назад +1

    The video is awesome

  • @hamdibeep4
    @hamdibeep4 3 года назад

    I was thinking about this a few days ago, and it finally popped up :)

  • @cwang9945
    @cwang9945 3 года назад +1

    So amazing. Thank you sir. I really love this typing effect.

  • @rezarahman1782
    @rezarahman1782 3 года назад

    CSS animation is really really strong.🥰

  • @Baljeettest
    @Baljeettest 3 года назад

    Super idea, hats off Kevin..... ✌️

  • @commentmyideas4523
    @commentmyideas4523 3 года назад +1

    Hair cut done 😂😂 styling looks good css

  • @mataca9
    @mataca9 2 года назад

    Cool trick!
    Another way to do this, is if you are using sass, you can split a word in letters and then use a for to create the steps of animation putting the letters as an acumulation on the content property.
    Using flex and before in the main div and inside this div the cursor, as the cursor and the before are children, the cursor will move as the content is incremented. :D

    • @dylancam812
      @dylancam812 2 года назад

      How do you use sass to split up the word. I’m trying to do it this way but I’m having some trouble

    • @charusharma7872
      @charusharma7872 2 года назад

      animated Box With CSS
      ruclips.net/video/gBmx3RmThDE/видео.html

  • @yutaishere
    @yutaishere 3 года назад

    This is very helpful! Thanks so much Kevin!

  • @waseem_498
    @waseem_498 3 года назад

    Are we not going to talk about the Chicago accent at 1:07 “javascript” lol great videos I learn so much

    • @KevinPowell
      @KevinPowell  3 года назад +1

      Haha, first time I get someone saying I have a Chicago accent, but I definitely hear it there, lol. I'm in Montreal, Canada, so not a common accent to sneak in, lol

    • @waseem_498
      @waseem_498 3 года назад

      @@KevinPowell I just got back from Chicago so I heard it immediately 😂

  • @prithwimanmazumdar4706
    @prithwimanmazumdar4706 3 года назад +3

    You know you could actually get the caret without using a pseudo element, just set the left border of the covering div to 2px solid black.
    It would give the same effect without the need of a pseudo element, but great work man, totally loved this.

  • @brunomocellin
    @brunomocellin 2 года назад

    I'm just entering the world of programing but i already understand the logic behind it. Your video is so cool as you add steps to it. I'm willing to make an Alert (StreamElements) with that effect, just need to think how the variables of text, text size and names will fit.

  • @Pierregouchet
    @Pierregouchet 3 года назад +1

    It would be interesting to pause the blinking while it's "typing", as a normal caret acts when you type something, and then blink only when it's idling.
    I guess you could do it by adding a few steps to the keyframes, but that would require a lot of maths to have it right ! :D
    I might try it anyway.

    • @AJman14
      @AJman14 3 года назад +2

      And there shouldn't be a fading animation. Just a blink. On/Off.

    • @Pierregouchet
      @Pierregouchet 3 года назад

      @@AJman14 yup !

  • @AA-oi9ru
    @AA-oi9ru 3 года назад

    dear sir one piece of advice when you are trying to connect over codepen to see this amazing video it is saying refuse to connect
    to fix this you can use TARGET inside the link

  • @lyckagennie6039
    @lyckagennie6039 3 года назад

    Yay! New Learning Thanks Mr.
    From a Grade 12 student😊

  • @i_am_pasindu
    @i_am_pasindu 3 года назад

    For a moment I checked the video playback speed. it felt like I was watching at 1.25 or 1.5 🙄 BTW nice tutorial

  • @dcm-code
    @dcm-code 3 года назад

    Thank you, Dr. CSS

  • @MrStefanica
    @MrStefanica 3 года назад

    Very nice ! Thank you Kevin !

  • @ankurc
    @ankurc 3 года назад

    Very fun might have to try in my portfolio page

  • @skalexshanghai
    @skalexshanghai 2 года назад

    Awesome!!! Thanks for the class!!

  • @SothearithKONGMrMuyKhmer
    @SothearithKONGMrMuyKhmer 3 года назад

    Thanks Kevin; that’s awesome! 👍😍

  • @sanmeetsingh4
    @sanmeetsingh4 3 года назад +1

    Another super cool video 😎

  • @habibthekhan
    @habibthekhan 3 года назад

    wow this was cool I didn't know about this steps animation thank you soo much

  • @bahar_hussain
    @bahar_hussain 3 года назад

    very amazing idea i am so excited from this.

  • @mmaismma
    @mmaismma 3 года назад +5

    What would have been more clever would be adding a border-left to :before instead of going with :after.

  • @dave6012
    @dave6012 3 года назад

    Steps! i had no idea. Thank you.

  • @jpzro3158
    @jpzro3158 3 года назад

    This is pretty cool!

  • @bobrobertsNotUrBob
    @bobrobertsNotUrBob 3 года назад

    Very smart, if I knew about "steps" then I guess I could have figured it out...the more you know

  • @sanjibchanda21
    @sanjibchanda21 3 года назад

    What a tricky animation 😅 awesome 👌

  • @arunsp767
    @arunsp767 2 года назад +1

    Thanks for the lovely tutorial. I have observed that while we are typing something, the blinking isn't there. The blinking kicks in once the typing is done. So maybe we should've had the blinking effect only before and after the typing animation. Also, the fade-blink is looking weird. Can make it abrupt using steps I guess.

  • @whoman0385
    @whoman0385 3 года назад

    Thanks so much i can finally make my own website!

  • @CarlosHernandez-tg3vj
    @CarlosHernandez-tg3vj 3 года назад

    Alright alright, I'll subscribe that's pretty cool

  • @bunnydevx
    @bunnydevx 3 года назад +1

    awesome vid keep it up man i also use typing animation on my website and it looks nice

  • @binitdemta3793
    @binitdemta3793 3 года назад

    Really great. Thanks for the wonderful videos.

  • @anjor3206
    @anjor3206 3 года назад

    CSS guru 🙌

  • @devc_
    @devc_ 3 года назад

    Great explanation, love your videos

  • @dancehalllyrics1303
    @dancehalllyrics1303 3 года назад

    Quick tip:
    Instead of having to add the font to all elements individually, you can simply add it to the universal selector.

    • @KevinPowell
      @KevinPowell  3 года назад +1

      fonts are inherited, so if you put it on the body or html, everything will get it, no need for a universal selector :) - I had two different fonts here, so I applied a different one to each element specifically.

    • @dancehalllyrics1303
      @dancehalllyrics1303 3 года назад

      @@KevinPowell
      Alrighty! I’ve just experienced that elements’ text that isn’t directly on the body (e.g. some text on a button, because the button itself is between the body and the text), doesn’t get the font family, if I just go ahead and add it on the body without I then also go ahead an add it to the element itself (if all of that makes sense)?
      That’s why I always add my font to the universal selector amongst my other reset/default stylings.

  • @Tiger1AuasfE
    @Tiger1AuasfE 2 года назад

    Nice, thnx for uploading.

  • @alirajabli
    @alirajabli 3 года назад

    Excellent , Thank you man!

    • @charusharma7872
      @charusharma7872 2 года назад

      animated Box With CSS
      ruclips.net/video/gBmx3RmThDE/видео.html

  • @GeorgeNorberg
    @GeorgeNorberg 3 года назад

    Love your videos!

  • @BrunoMussoi
    @BrunoMussoi 3 года назад

    I guess it can also work by shrinking the h1 to 0, and animate it back to its normal size. This way you would not need to cover the letters with the background color.

    • @Victor_Marius
      @Victor_Marius 3 года назад

      And use the right border for the caret. But if you have anything to the right of the element it would be moved around, but maybe this side effect is the target result.

    • @KevinPowell
      @KevinPowell  3 года назад

      The issue here is you can't animate to `max-content` (same with auto). If you had a fixed final size it would work, but I wanted to make it easy to update :) - You could use JS to figure that out too, if you really wanted to use that approach, but it seems like more work than using an extra pseudo-element :)

    • @Victor_Marius
      @Victor_Marius 3 года назад

      @@KevinPowell what if you set width to 24ch or same number as the custom property used for the animation steps?

  • @SuatBarlak
    @SuatBarlak 3 года назад

    With the @Keyframes blink like this, you get a shorter transformation from transparent to black and back, which in my opinion looks a bit better
    @keyframes blink {
    20% { background: black;
    }
    25% { background: transparent;
    }
    75% { background: transparent;
    }
    80% { background: black;
    }
    }

  • @himalmevada7989
    @himalmevada7989 3 года назад

    I Just dive in animation and it's really Fun. the video is awesome nicely explained

  • @aaeonCodes
    @aaeonCodes 3 года назад

    Thank you very much for such a great content

  • @raykutan
    @raykutan 3 года назад

    You should put the blink animation to _infinite alternate_ so that it doesn't jump from transparent to black.
    Also I don't understand why you put the timing function to _step_ since the blinking has nothing to do with the text length, _linear_ would make more sense and _ease-in-out_ looks also nice

    • @charusharma7872
      @charusharma7872 2 года назад

      animated Box With CSS
      ruclips.net/video/gBmx3RmThDE/видео.html

  • @angelocina5914
    @angelocina5914 3 года назад

    Thka mate!! you are a master!!!

  • @jameshansen801
    @jameshansen801 3 года назад +3

    This is so cool, thanks for doing a video on this! I'm currently working on a project where I'd like to incorporate a dynamic version of this that could be applied to whole paragraphs instead of single lines. So far, my biggest issue is that every line in the paragraph animates at the same time with the caret animation being the same height as the paragraph. Any help would be greatly appreciated Kevin. Thanks again!

    • @MrSupdup
      @MrSupdup 3 года назад +1

      Did you ever have any success with this? Trying to do this on a current project and I'm fearful its not possible using only CSS. It's simple enough to make the height of the pseudo's the height of one line (making the caret and the background block out just one line), but it doesn't seem possible to animate multiple lines staggered one after the other if they are all in the same element.

    • @jameshansen801
      @jameshansen801 3 года назад

      @@MrSupdup Currently, the only answer I have now is to chop up the paragraph and create a timed loop that animates each individual line. Obviously, this isn't a dynamic solution. However, it's still on my todo list!

    • @charusharma7872
      @charusharma7872 2 года назад

      animated Box With CSS
      ruclips.net/video/gBmx3RmThDE/видео.html

  • @howabadworld
    @howabadworld 3 года назад

    Nice video, Good Job!

  • @CK-qh5te
    @CK-qh5te 3 года назад

    Perfect, tutorial. Thank you!

    • @charusharma7872
      @charusharma7872 2 года назад

      animated Box With CSS
      ruclips.net/video/gBmx3RmThDE/видео.html

  • @andystevenson6336
    @andystevenson6336 3 года назад +1

    A lot of fun to follow this.

    • @KevinPowell
      @KevinPowell  3 года назад +1

      Awesome, glad you enjoyed it Andy!

  • @toluwaniagbojo3441
    @toluwaniagbojo3441 3 года назад +1

    Thank you very much for this but I have a question, what if I have 2 sentences, and I want the second one to come after the first, what should I do.

    • @KevinPowell
      @KevinPowell  3 года назад +1

      I think you'd need to manually break it over two lines, with. The same animation on both, but delay the second one until the first one is done.
      Be careful though, people won't stick around to see what's typing out if it's too long

  • @TungNguyen-dr3ue
    @TungNguyen-dr3ue 3 года назад +1

    Great content. You're my inspiration for learning more and more.
    Thank you very much!!!
    Hope you have a beautiful day.
    P/s: I think it will look really amazed if there is an intro for your video

  • @navidmafi
    @navidmafi 3 года назад

    Thank you, very useful

  • @ktytar
    @ktytar 3 года назад

    Thanks, you rock !

  • @mdazizulislam2498
    @mdazizulislam2498 3 года назад

    wow nice explanation. thank you so much

  • @ziaahmad8738
    @ziaahmad8738 3 года назад

    Wao this is incredible

  • @witheredgroup
    @witheredgroup 3 года назад +2

    Is there any way to do it *without* a monospace font?

  • @susityy2030
    @susityy2030 2 года назад

    Thank you!

  • @marketinginhouse
    @marketinginhouse 2 года назад

    What good videos, greetings from Peru

  • @RebrandSoon0000
    @RebrandSoon0000 4 месяца назад

    Pretty sweet ! Can I use this in personal projects non-profit?

  • @Dexter101x
    @Dexter101x 3 года назад

    Hilariously ingenious