❄️ Let's make some SNOW!

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

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

  • @bakedbird3111
    @bakedbird3111 5 лет назад +10

    That was a lovely video! Enjoyed it from start to finish 😁

  • @GifCoDigital
    @GifCoDigital 5 лет назад +8

    Not that I didnt have faith in ya but I was also quite surprised when it worked first load!!! Hahaha thanks for another great vid Paul.

  • @FlaviaBastosI
    @FlaviaBastosI 5 лет назад

    I added a bit of color to that snow and made a confetti version. There! Year-round flakes on the screen! 🎊

  • @AleksandrUlatov
    @AleksandrUlatov 5 лет назад +6

    So close... So close... 😁 👍

  • @Y390R
    @Y390R 5 лет назад +4

    Making snow with JS.. Like in good ol'days [sighs nostalgically]

  • @payskin
    @payskin 5 лет назад +4

    So I was like "this.canvas, this.canvas, thiiiis.canvaaaaaaaaaasssss!", then "innerHeight, innerHeight, innerHeeeeeeight"... but it's way easier for me to be smart on the flip side, eh? :D Enjoyed every minute of it. Thanks, Paul.

    • @aerotwist
      @aerotwist  5 лет назад +7

      Pair programming where the pair is in the comments and after the video is edited.

  • @KevinSheppard
    @KevinSheppard 5 лет назад +1

    Damn, Paul! When you hit F5 and that snow started falling I felt the whole world go silent 🤣🤣 Too bad about the minor bug though. This would have been some kind of record.

  • @superchillh3o
    @superchillh3o 5 лет назад

    I hope you shed at least 1 tear after it worked first time. Those are wonderful moments.

  • @NanobyteOnline
    @NanobyteOnline 5 лет назад +4

    22:29 window.innerHeight
    22:30 Paul changes selection from window.innerHeight to window.innerWidth

  • @chungkim2316
    @chungkim2316 5 лет назад

    these videos are so refreshing to my soul

  • @peterwang4961
    @peterwang4961 5 лет назад +2

    Haha, this is so funnnnnn to watch! Great video!

  • @ThadHumphries
    @ThadHumphries 5 лет назад

    Lots of fun. Thank you, and merry Christmas.

  • @juliannicholls
    @juliannicholls 5 лет назад +4

    I laughed like an idiot when the orange connected with your noggin at the beginning.

  • @vojtechsebo4119
    @vojtechsebo4119 5 лет назад

    Born to teach 👏🏼

  • @philschmidt852
    @philschmidt852 5 лет назад

    Heyy. I expected to see snowflakes all the way at 24:46 ... ❄️❄️❄️!
    Nevermind. As always, great video!

  • @mattrick8847
    @mattrick8847 5 лет назад +2

    Not sure if this is bad practice, but when I make a resize handler for my canvas, I do this.canvas.width = this.canvas.clientWidth (same goes with height), which ends up using the width and height set in the CSS! Which means that you could wrap it in a parent element that's not the size of the window and it will fit itself just fine! Super cool!

    • @aerotwist
      @aerotwist  5 лет назад +1

      Yeah that works. I went for direct today but yeah

  • @michongoma7598
    @michongoma7598 5 лет назад

    You are awesome Paul! thanks for the video

  • @Insidethetok
    @Insidethetok 5 лет назад

    Great video!!! Thank you for creating great content I wish there was more like this online.

  • @SplitterAlex1990
    @SplitterAlex1990 5 лет назад

    Love it! Thank you :)

  • @Rihsto
    @Rihsto 5 лет назад +1

    That was awesome 🚀. I love how natural you're before camera!

    • @Rihsto
      @Rihsto 5 лет назад

      btw sick sweater 😆

  • @iqalzr
    @iqalzr 5 лет назад

    Awesome Paul! Happy snowy days :)

  • @brunoB182
    @brunoB182 5 лет назад

    Awesome :D

  • @AlisherMakhmudov
    @AlisherMakhmudov 5 лет назад

    awesome, but seems it uses CPU or GPU a lot?

  • @_oskareriksson
    @_oskareriksson 5 лет назад

    Here's my little gift for you; you can highlight multiple lines in VS Code and Ctrl + arrow move 'em, just like you did the individual lines there in the beginning. Happy holidays!

  • @draganoiugeorge6010
    @draganoiugeorge6010 5 лет назад

    I'm trying to add a blur to the snowflakes and that turns out to be very computationally expensive, even if i apply it to the canvas. any suggestions?

    • @aerotwist
      @aerotwist  5 лет назад

      Precalculate it. What you'd do is pre-draw the blurry snowflakes based on vx and vy to a hidden canvas, then you'd just blit across that chunk of the canvas for the snowflake.

  • @AndrewBone
    @AndrewBone 5 лет назад

    No bugs, it's a Christmas mirac... Oh

  • @romandatsyuk6114
    @romandatsyuk6114 5 лет назад

    Happy winter holidays! And nice sweater btw :)

  • @MichaelSchillingNL
    @MichaelSchillingNL 5 лет назад

    So I was like: hmmm, why does it have to be innerWidth .. 🤔 But great video again!

    • @aerotwist
      @aerotwist  5 лет назад

      Haha

    • @smanfly
      @smanfly 5 лет назад

      @@aerotwist vscode did that, I get that all the time, one second I look away and it suggested another variable :) Great video!

  • @MrGarfi
    @MrGarfi 5 лет назад +1

    Haha, that intro - im only 10 seconds in, but that deserves a like :D

  • @iocaio
    @iocaio 5 лет назад

  • @mauroreisvieira
    @mauroreisvieira 5 лет назад

    Another great video! your expressions kill me. 😆

    • @aerotwist
      @aerotwist  5 лет назад

      I'm stuck with my face. A life long thing, apparently

  • @MrJerczu
    @MrJerczu 5 лет назад

    Loving the fact you made a mistake... You are a human after all.

  • @wasabibasti
    @wasabibasti 5 лет назад

    Will you publish it on github?

  • @giftedfingers2580
    @giftedfingers2580 5 лет назад

    I hope one day I can become as talented as you in javascript...

  • @nicolasparada
    @nicolasparada 5 лет назад

    Cool ❄️

  • @_oliverjam
    @_oliverjam 5 лет назад +1

    You could avoid the for loop to create snowflakes with my favourite trick: Array.from takes a length and a map function. `Array.from( { length: flakes }, () => new Snowflake())`

    • @aerotwist
      @aerotwist  5 лет назад +1

      In 6 months I'm not going to understand what I did and why 😂

    • @_oliverjam
      @_oliverjam 5 лет назад

      @@aerotwist ha fair enough. Definitely an important consideration

    • @GuskiS
      @GuskiS 5 лет назад

      Wanted to suggest the same thing.

  • @durchschnittlich
    @durchschnittlich 5 лет назад

    I wish my bugs would be as tiny as mistaking the innerWidth for the innerHeight

    • @aerotwist
      @aerotwist  5 лет назад +1

      What's so frustrating is that I even said the right thing, I just chose incorrectly from the autocomplete!

  • @AndrewSmithDev
    @AndrewSmithDev 5 лет назад +1

    You didn't show the canvas after u fixed the bug 😞

    • @aerotwist
      @aerotwist  5 лет назад

      Hah did I not? Well it was fixed.

  • @toroduque
    @toroduque 5 лет назад

    :O awesome!

  • @ohmyshell
    @ohmyshell 5 лет назад

    Whats the background music? p.s: you're a legend. Edit: how do you make the canvas transparent and over the whole page while maintaining the interaction with the dom? (for example: snowflakes over the whole page and sill be able to click a button under the canvas)

    • @aerotwist
      @aerotwist  5 лет назад

      Yeah I showed both ways, the resize handler is done with an arrow. The downside is that it is more fiddly to remove it unless you keep a ref.
      Music is Epidemic Sound :)

    • @ohmyshell
      @ohmyshell 5 лет назад

      @@aerotwist quick edit i commented mid video...my mistake. i changed my comment and asked another question. Thank you!!! pls upload more.

    • @aerotwist
      @aerotwist  5 лет назад

      canvas { pointer-events: none; }

  • @robinrpr
    @robinrpr 5 лет назад

    Maybe also change the background colour depending on your local time ;)

  • @okoiful
    @okoiful 5 лет назад

    why not used a factory function ?

    • @aerotwist
      @aerotwist  5 лет назад

      Why not, indeed! If you prefer it, use it. I suggest developers embrace a variety of approaches so that they build a toolkit of skills from which they can choose the most appropriate course of action. Here I just felt like making a class.

  • @OlleHellman
    @OlleHellman 5 лет назад +1

    See a Paul Lewis movie, update it. =)

  • @OlleHellman
    @OlleHellman 5 лет назад

    We expected buggs! 22:44

  • @mmahgoub
    @mmahgoub 5 лет назад

    That shouldn't count as a bug because you actually said "innerHeight" verbally but typed innerWidth! Now go tell Jake! lol

    • @aerotwist
      @aerotwist  5 лет назад

      Well yeah, I feel like VSCode stitched me up there ;)

  • @billubaziger
    @billubaziger 5 лет назад

    Dammit Paul, make a gist already!!!

    • @aerotwist
      @aerotwist  5 лет назад

      It's less about the code and more about the way of thinking. The gist loses all that wonderful Paulness that only a video can provide.

    • @billubaziger
      @billubaziger 5 лет назад

      @@aerotwisttrue , but we need the code at the end to compare with our code 😋