Matrix Rain Experiments in JavaScript (tutorial)

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ค. 2024
  • Hi creative coding hackers, do you like retro effects? How about this iconic Unicode rain effect from Matrix movies. It's time to dive deep into the code and have a closer look at object-oriented programming principles in action. Practice makes perfect and every project you create brings you one step closer to becoming Neo of HTML, CSS and JavaScript :D Come and learn new creative coding techniques with me and one day, you will be be the one who bends the rules of code. What's it gonna be, blue pill and play it safe, or red pill to see how deep the rabbit hole of JavaScript goes? :D Have fun! 🐇
    Symbols I used in this tutorial:
    アァカサタナハマヤャラワガザダバパイィキシチニヒミリヰギジヂビピウゥクスツヌフムユュルグズブヅプエェケセテネヘメレヱゲゼデベペオォコソトノホモヨョロヲゴゾドボポヴッン0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
    ♔♕♖♗♘♙CHESS♚♛♜♝♞♟
    ☀☁❆WEATHER❅❄
    ♪MUSIC♫
    ⭐️Tutorial Contents ⭐️
    00:00 Matrix rain effect in JavaScript
    00:28 HTML5 canvas gradients
    01:03 HTML5, CSS3 and HTML canvas setup
    01:40 Procedural vs Object-oriented programming
    02:00 ES6 Classes explained
    02:22 Encapsulation
    03:17 JavaScript class constructors explained
    03:51 Effect class
    04:58 Abstraction
    06:21 Symbol class
    11:00 Animation loop
    14:26 How to control FPS with timestamps and delta time
    19:04 How to make HTML canvas effects responsive
    20:54 createLinearGradient() explained
    22:43 createRadialGradient() explained
    🏆 CHALLENGE: Want to try your own experiments? Try to replace this.characters string with some of these Unicode symbols, mix symbols with letters, give them different colours, different font size...
    unicode-table.com/en/
    Recommended Udemy courses (get solid understanding of the basics and then use it to build projects):
    ☕ Object-oriented Programming in JavaScript (Mosh Hamedani) bit.ly/3f4Otu0
    ☕ JavaScript Basics for Beginners (Mosh Hamedani) bit.ly/32Tn5wq
    ☕ Modern JavaScript From The Beginning (Brad Traversy) bit.ly/3fWJgWk
    ☕ JavaScript: Understanding the Weird Parts bit.ly/2WVe0zn
    ☕ Modern HTML & CSS From The Beginning (Including Sass) bit.ly/2Ec6Cch
    ☕ Advanced CSS and Sass: Flexbox, Grid, Animations and More! bit.ly/3g0uqxT
    ☕ JavaScript: The Advanced Concepts (2021) bit.ly/2Uk6Wyk
    ☕ JavaScript - The Complete Guide 2021 (Beginner + Advanced) bit.ly/37Hlxqq
    ☕ The Complete JavaScript Course 2021: From Zero to Expert! bit.ly/3fXGwaZ
    ☕ 20 Web Projects With Vanilla JavaScript bit.ly/3anlCQR
    ☕ HTML/CSS Bootcamp - Learn HTML, CSS, Flexbox, and CSS Grid bit.ly/3tu9ghD
    ☕ Modern HTML & CSS From The Beginning (Including Sass) bit.ly/2Ec6Cch
    ☕ Advanced CSS and Sass: Flexbox, Grid, Animations and More! bit.ly/3g0uqxT
    Free good quality courses:
    📚 Object-oriented Programming in JavaScript: Made Super Simple | Mosh • Object-oriented Progra...
    📚 JavaScript Tutorial for Beginners: Learn JavaScript in 1 Hour • JavaScript Tutorial fo...
    📚 JavaScript: Understanding the Weird Parts - The First 3.5 Hours • JavaScript: Understand...
    🎵 Music: (TH-cam audio library) Dance of the U-boat - Aakash Gandhi
    The description of this video may contain affiliate links, which means that if you buy one of the products that I recommend, I'll receive a small commission without any additional cost for you. This helps to support the channel and allows me to continue making videos like this. Thank you for the support!
    #frankslaboratory

ความคิดเห็น • 324

  • @quickcodingtuts
    @quickcodingtuts 2 ปีที่แล้ว +43

    I remember creating a matrix effect without canvas, thinking it was something awesome. But this is a whole other level of creativity. Outstanding work man. You make coding so much fun!

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +9

      Hi, I decided to go with canvas because I wanted to play with colours and gradients and wanted to talk about object-oriented programming. Would be interesting to build something similar with just CSS, hmm, I should do that as well. Thank you for taking the time to leave a comment

    • @masternobody1896
      @masternobody1896 2 ปีที่แล้ว +1

      @@Frankslaboratory can you make it look green

    • @masternobody1896
      @masternobody1896 2 ปีที่แล้ว

      @@Frankslaboratory do more videos

    • @troopekyt
      @troopekyt ปีที่แล้ว

      @@masternobody1896 are you mentally retarted?

  • @zbajro
    @zbajro 2 ปีที่แล้ว +4

    What a great explanation of every single detail of code and so smooth and simple implementation. Excellent work man , wish you all the best!

  • @LucasPaiva96
    @LucasPaiva96 ปีที่แล้ว

    This is right there with the best explanations of programming fundamentals, and on top of that, using a really cool example project. Nicely done, mate!

  • @frankw645
    @frankw645 2 ปีที่แล้ว +6

    Just recently found your excellent channel. I love that these tutorials start from the ground up. There is nothing hidden in third-party libraries. I've been a developer for 25+ years and doing these are so much fun. Thanks much!

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +3

      Hi Frank. Nice to hear feedback like this. Its my goal to start from scratch every time and make sure everything is understood. No hidden magic from a library. Glad to see someone notice and appreciate that. I will keep doing tutorials this way. Also nice to see even such an experienced developer like you is interested in my creative coding content ❤

  • @rupturedrhombus2836
    @rupturedrhombus2836 2 ปีที่แล้ว +6

    Frank it amazes me that you still find time to do all these amazing in depth tutorials with your job and other life activities. I appreciate everything you do, thanks for always sharing.

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว

      I missed this comment, thank you for your kind feedback, much appreciated ! :)

  • @KENNY-sm8mp
    @KENNY-sm8mp 4 หลายเดือนก่อน

    I just found your channel like yesterday, you're so good at teaching things, detail by detail. Thank your for your time doing this.

  • @fransiskus138
    @fransiskus138 2 ปีที่แล้ว +3

    i love this. you explain so well even the little things that could get us in trouble, thank you so much!

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +3

      Thank you Fran, I love getting feedback like this :D I'm trying some new teaching techniques to see which ones make it easier for people to learn, thank you for taking the time to give me your feedback

  • @josuealexandericujac7083
    @josuealexandericujac7083 2 ปีที่แล้ว +1

    Wow, I really like how you teach, unlike other programming tutorials where you only watch how a person code, while you are not doing anything. You can teach us how to code a really interesting project and keep it simple for beginner like me to understand it. Thank you so much!

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว

      Hi Josué, nice to meet you, thank you for letting me know you found some value in my course! :)

  • @config2000
    @config2000 ปีที่แล้ว +3

    This sort of training is simply the benchmark of what a good coding tutorial should be.
    Rating 10/10.

    • @Frankslaboratory
      @Frankslaboratory  ปีที่แล้ว

      Thank you, very kind, I appreciate your feedback!

  • @graydhd8688
    @graydhd8688 9 หลายเดือนก่อน

    Okay I've been on a tear learning js/css/html, just a few months ago I'd have totally overwhelmed by this. I hate typing code from a tutorial without actually understanding what every single thing I type means/does. Only 5 minutes in and I feel I'm starting to find a flow state when typing sometimes. Like, I understand what and why the characters I'm typing all are now! And the syntax and all that jazz. This vid so far has been an awesome recap of what I've learned and brought up a few important things I had forgotten about! This feels like my first "real" project, as in something kinda cool that isn't a lame to do list or something lol. Something I'll be proud to show someone "look at this cool thing I made!" I of course will be adapting it into my own thing once I've completed this video. I'll consider that my starting point from a creative standpoint!

  • @axbenitez68
    @axbenitez68 2 ปีที่แล้ว +1

    +1. I got amazed by how cool the radial gradient looks, amazing tutorial

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +1

      Hi Alexander, I don't see radial gradient used very often so this project was an ideal time to show it off! :D

  • @Frankslaboratory
    @Frankslaboratory  2 ปีที่แล้ว +10

    Do you want to experiment? Try the code with different symbols:
    アァカサタナハマヤャラワガザダバパイィキシチニヒミリヰギジヂビピウゥクスツヌフムユュルグズブヅプエェケセテネヘメレヱゲゼデベペオォコソトノホモヨョロヲゴゾドボポヴッン0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
    ♔♕♖♗♘♙CHESS♚♛♜♝♞♟
    ☀☁❆WEATHER❅❄
    ♪MUSIC♫

    • @doloressverko9887
      @doloressverko9887 2 ปีที่แล้ว

      Is there a way to do everything the same as you, except that there is a limited set of characters, say "ABC" and nothing more?

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +1

      @@doloressverko9887 Hi Dolores, yes, you can set this.characters to any number of specific Unicode characters you want, some examples in the pinned comment

  • @sungvin
    @sungvin 2 ปีที่แล้ว

    Production of this video is so juicy, thank you very much for real time showcase of what's happening on the site

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +1

      Really? I need to focus on making my production like this every time then ! :D

  • @elviraelvira5736
    @elviraelvira5736 2 ปีที่แล้ว

    Plus I started following a full js course….but watching what you did here made me realize that I understand and know more than I think I do. Thanks again for putting me back on track. Somehow I always think I dont know enough but I think thats the curse of a programmer.

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว

      Hope you manage to stay motivated Elvira, when you reach a certain point, making projects becomes much easier so it feels less like hard work

  • @CristianAlexandruRadu
    @CristianAlexandruRadu 2 ปีที่แล้ว +2

    this is so awesome ❤️❤️❤️
    I saw that effect (as an image) on the news about hackers

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +1

      Hi Cristian. Yea it's a famous visual. The old Ghost in the Shell movie probably did it first before Matrix but I prefer this version

  • @Tukyo
    @Tukyo 2 หลายเดือนก่อน

    absolutely incredible tutorial
    TIP: If you have a background behind your rain that you want visible, you can add this styling in the CSS to the canvas element: "mix-blend-mode: screen;"

    • @Frankslaboratory
      @Frankslaboratory  2 หลายเดือนก่อน +1

      Great tip, thank you for sharing, I like comments like this

  • @raymondmichael4987
    @raymondmichael4987 ปีที่แล้ว

    Can't leave without hitting a like button and a comment.
    Good work dude, it's amazing

  • @emausdetiquicia6636
    @emausdetiquicia6636 ปีที่แล้ว

    Excellent tutorial. Finally learned to create radial gradients in canvas. Thank you for reading the documentation for us 😊.

  • @caipyear644
    @caipyear644 2 ปีที่แล้ว

    This is one of the greatest coding tutorials I've ever watched...

  • @elviraelvira5736
    @elviraelvira5736 2 ปีที่แล้ว

    +1 for sure. I was shouting(by myself lol) wow and wow. Something I was searching for. Thank you so much for the inspiration and the teaching

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว

      Hi Elvira, glad you found some value, nice to see you here again

  • @christophehkg6056
    @christophehkg6056 ปีที่แล้ว

    I always wanted to create this effect, thank you for making my wish come true! this was fun

    • @Frankslaboratory
      @Frankslaboratory  ปีที่แล้ว

      Hi Chris, glad to hear, I really like this effect

  • @granumuse7847
    @granumuse7847 2 ปีที่แล้ว

    Even not realising it Frank, making Symbol and Effect classes share canvasHeight property was an epic hack by you!!! 😍
    Congratulations 🎊

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +1

      Hi, thank you. It's important not to pull global variables directly into classes, so I'm converting global variable into a class property. I'm trying to use good practices :D

  • @alidemir2434
    @alidemir2434 2 ปีที่แล้ว

    It is a good idea to release this video before new Matrix movie. Very helpful and fun :)

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว

      This is the first time you comment on my video 😄 yea watching trailer for the new Matrix movie gave me idea to do this project

  • @josephcieplak8920
    @josephcieplak8920 2 ปีที่แล้ว +1

    Your skills do not stop to amaze me. I'm building a game on html5 canvas which all the knowledge I've been getting from you. it's a 2d game built on canvas.

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +2

      Hi Joseph, good luck with your game. I'm working on a 2D side scroller tutorial now, been a while since I made a game dev video.

  • @burner918
    @burner918 2 ปีที่แล้ว

    Loving your tutorials. Thanks so much.

  • @mirjalol_shamsiddinov
    @mirjalol_shamsiddinov ปีที่แล้ว

    this channel expensive than gold even, bro thank u

  • @gualdim
    @gualdim ปีที่แล้ว

    Sir you're just awesome, explanation of opp with REAL world code is the way to go. Thank you for sharing your knowledge.

  • @mhbaando
    @mhbaando 2 ปีที่แล้ว +2

    This an extraordinary work 🔥

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +1

      Thank you Mohamud, glad you like my coding experiments😃🙏

  • @e-sportsorganization8082
    @e-sportsorganization8082 2 ปีที่แล้ว

    very nice tutorial, I took Russian Azbukha for symbols and fillstyle red :D, the original version looks amazing and I wanted to experiment with lineargradient and with couple of colour options, this is an amazing tutorial, thank you..

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +1

      Nice, sounds like you found a way to customize the effect, congratulations on completing the project

  • @isaiahobi5837
    @isaiahobi5837 2 ปีที่แล้ว +1

    I know it's going to be an epic video, so I am commenting first before watching.

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +1

      Hi Isaiah, you have a lot of trust in me :D Hope I can deliver :D

  • @perfect.stealth
    @perfect.stealth 2 ปีที่แล้ว

    You're insane. Love your tutorials

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว

      Hi Suleiman, thank you, glad you found some value ! :)

  • @monitosi
    @monitosi ปีที่แล้ว

    amazing work professor

  • @evaristocuesta
    @evaristocuesta 2 ปีที่แล้ว

    Interesting effect!! Good explanation of OOP.

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +1

      Nice, master coder approves. Thank you Evaristo, I learned a lot of these from you 🙏😀

  • @LynxBaretta
    @LynxBaretta ปีที่แล้ว

    This video its awesome! ...thanks a lot for sharing this knowledge!!!

  • @neftaliadrian
    @neftaliadrian ปีที่แล้ว

    Thank you for posting this Frank.

  • @DaveCollison
    @DaveCollison 2 ปีที่แล้ว

    Excellent, as always.

  • @TheCourtoh
    @TheCourtoh 2 ปีที่แล้ว

    +1, thanks Frank!

  • @professorcalculus7885
    @professorcalculus7885 2 ปีที่แล้ว +1

    Wow! It's a really cool tutorial

  • @Radu
    @Radu 2 ปีที่แล้ว

    Really great idea to use the gradients!
    +1 for giving me new ideas :-)

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +1

      Thanks Radu, I was going though canvas docs recently and there are some methods I never use, createRadialGradient was one of them.

    • @Radu
      @Radu 2 ปีที่แล้ว

      @@Frankslaboratory I used it in my torch effect (probably)

  • @jovan781
    @jovan781 6 หลายเดือนก่อน +1

    If the "ghosting" was driving you nuts like it was for me. I solved it by adding a solid square. Code below.
    By the way, Frank thank you so much for this video!
    I've spent a few hours just learning all I can.
    In the draw(context) method add these lines
    context.fillStyle = 'black';
    context.fillRect((this.x * this.fontSize) - this.fontSize / 2, (this.y * this.fontSize) - this.fontSize / 2 - 750, this.fontSize, this.fontSize);
    however, you will need to keep (or add) these two lines
    context.fillStyle = 'white'; // Controls font color
    context.fillText(this.text, this.x * this.fontSize, this.y * this.fontSize);

    • @ManallLockhart
      @ManallLockhart 6 หลายเดือนก่อน +1

      This was extremely helpful, thank you! Do you know how to get the strings to start randomly at the top when, instead of all pouring down at once for the first repetition?

    • @jovan781
      @jovan781 6 หลายเดือนก่อน

      @@ManallLockhart Someone shared it in the comments, but you need to change the y argument in the #initialize function to this.canvasHeight/Math.random()
      #initialize(){
      for(let i=0; i < this.columns; i++){
      this.symbols[i] = new Symbol(i, this.canvasHeight/Math.random(), this.fontSize, this.canvasHeight);
      }
      }

    • @Frankslaboratory
      @Frankslaboratory  6 หลายเดือนก่อน

      Thanks for sharing @jovan781

  • @all-eter-4289
    @all-eter-4289 ปีที่แล้ว

    Amazing and funny I Love it :3

  • @chefbennyj
    @chefbennyj 2 ปีที่แล้ว

    Frank you are a master! Man you are good!

  • @michieladriaansens5977
    @michieladriaansens5977 ปีที่แล้ว

    Awsome! haha i love this :D

  • @fazliddinnasrullayev881
    @fazliddinnasrullayev881 2 ปีที่แล้ว +1

    Very gooooooooood

  • @promethewz3457
    @promethewz3457 2 ปีที่แล้ว

    This is awesome!!
    I followed the video and created a component in react(Typescript). It was really fun.
    Thanks.
    Could you please also make a video adding interactivity to this?

    • @udown9640
      @udown9640 2 ปีที่แล้ว

      can you make tutorial to show how it is done or able to share source code bro ?

  • @federicocallegari7972
    @federicocallegari7972 ปีที่แล้ว

    Thank you so much!!

  • @snoopy8870
    @snoopy8870 2 ปีที่แล้ว

    Best videos . thank you frank!

  • @Diablon236
    @Diablon236 ปีที่แล้ว

    thank you very much you are the best

  • @CallousCoder
    @CallousCoder ปีที่แล้ว +1

    Con-struc-tor con constructure 😅 The columns in the Matrix fall at different speeds.
    They probably had an array per character column. That is at least how I did it in C++ 25 years ago. And I painfully recreated the characters. First and last time I made a TTF on Intel. And the first char was bright (full value).

  • @jorgezozaya5049
    @jorgezozaya5049 ปีที่แล้ว

    In the presence of extraordinary content, consciousness takes the place of imagination.

    • @Frankslaboratory
      @Frankslaboratory  ปีที่แล้ว

      Jorge, I had to read it twice to understand what you are saying :)

  • @helloworld2740
    @helloworld2740 ปีที่แล้ว

    Thank you sir

  • @Antonio-mne-jarko
    @Antonio-mne-jarko 2 ปีที่แล้ว

    Super! это то, что мне нужно было:)

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว

      Hi Anton, glad you find my coding experiments useful :D

  • @unknown-bx8my
    @unknown-bx8my 2 ปีที่แล้ว

    very cool🔥🔥.

  • @Pupu._
    @Pupu._ ปีที่แล้ว

    This is soooo cool

    • @Frankslaboratory
      @Frankslaboratory  ปีที่แล้ว

      I love Martix rain effct, it's one of my favourites and quite simple to make

  • @aymanelmasry8561
    @aymanelmasry8561 2 ปีที่แล้ว

    I asked you this once about a year ago, I think this is for me, really like how you teach,Thank you so much!
    I want to learn from you from the beginning, do you have courses?

  • @turbo6266
    @turbo6266 2 ปีที่แล้ว

    You amaze me.

  • @cscs6587
    @cscs6587 ปีที่แล้ว

    Thank you again for this amazing video. I'm a teacher and I want to build games and eductional web apps for my students. I really appreciate your help.

    • @Frankslaboratory
      @Frankslaboratory  ปีที่แล้ว +1

      Nice, I think making visual projects like this will be more fun for your students, at least for me it was when I was learning to code.

  • @NasGuerrou
    @NasGuerrou ปีที่แล้ว

    Thank you Frank, + 1

  • @goldengold8568
    @goldengold8568 2 ปีที่แล้ว

    I have been trying so hard to make this on blender. Didn't knew that this could be done on JavaScript.

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว

      I wouldn't know where to start in Blender, JavaScript is a programming language, it can do any effect you have ever seen, some just take more code, some take less, this particular effect can be written in only 13 lines of code with modern JavaScript :D

  • @lookupverazhou8599
    @lookupverazhou8599 ปีที่แล้ว

    An amazing channel.

  • @CarlosIommi
    @CarlosIommi 2 ปีที่แล้ว

    you are amazing. thanks

  • @PossumMedic
    @PossumMedic 2 ปีที่แล้ว

    Another great vid thanks! :D
    edit: I'm confused about line 54: this.#initialize();
    should that be: this.#initializer(); or am I missing something?
    edit 2: got this working with the cat head emojis and it made my day! 😹 😻

  • @tigreonice2339
    @tigreonice2339 2 ปีที่แล้ว

    This and pixel manipulation mixed omg. Thank you

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +1

      Hmm, thanks for an idea, haha, I will do it :D

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +1

      I will combine them into one effect :D

    • @tigreonice2339
      @tigreonice2339 2 ปีที่แล้ว

      @@Frankslaboratory I tried to do but I failed. Thanks for this and for share your knowledge

  • @zoranmitrovic2526
    @zoranmitrovic2526 ปีที่แล้ว +1

    for a smooth start, i liked initializing the effect this way:
    #initialize() {
    for (let i = 0; i < this.columns; i++) {
    this.symbols[i] = new Symbol(i, this.canvasHeight / Math.random(), this.fontSize, this.canvasHeight)
    }
    }

  • @chris9117
    @chris9117 ปีที่แล้ว +1

    Hey Frank, really a great tutorial. Really very well explained - great job.
    Unfortunately, resizing didn't work for me. After watching and comparing 10 times I gave up. and rewrote the code as follows.
    I got rid of the resize method, changed the instance of Effect from const to let and created a new instance of Effect in the event method and gave it the new window width and height. Works great.
    let effect = new Effect(canvas.width, canvas.height);
    window.addEventListener('resize', function(){
    canvas.width = window.innerWidth;
    canvas.height = window.innerHeight;
    effect = new Effect(canvas.width, canvas.height);
    });

    • @s1ba_
      @s1ba_ ปีที่แล้ว

      big thanks

  • @Dino90554
    @Dino90554 2 ปีที่แล้ว

    Great!

  • @aravindvv2276
    @aravindvv2276 2 ปีที่แล้ว

    Knock, knock, Neo 🤩❄️

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +1

      The Matrix has you ... 😁😆

    • @aravindvv2276
      @aravindvv2276 2 ปีที่แล้ว

      @@Frankslaboratory 😂😂💥

  • @shaiknoorulhuda5779
    @shaiknoorulhuda5779 2 ปีที่แล้ว

    Nice tutorial bro

  • @aliensoul7600
    @aliensoul7600 ปีที่แล้ว

    hello sir, I saw your chennal a year ago when i was learning JavaScript . I lost my phone and account, Finally i found this same video again now. I won't forget the channel name this time 😉😁💐

  • @LaughingBubba
    @LaughingBubba 2 ปีที่แล้ว

    +1 that was fun!

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว

      Thanks for letting me know, glad you had fun! :)

    • @LaughingBubba
      @LaughingBubba 2 ปีที่แล้ว

      @@Frankslaboratory cheers. There’s one little thing tho. Resizing the window does not recentre the gradient cuz it’s initialised at the top but copying the gradient set up into the event listener fixes it. Looking forward to the next one 👍

  • @berkipekoglu
    @berkipekoglu 2 ปีที่แล้ว +1

    Hi Frank!, your videos are amazing! I would like to give you a topic of inspiration. Can you do futuristic sci-fi hud ui?

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว

      Hi Berk, I like the idea, I think I will start with UI for games, I will add this on my list

  • @suema3628
    @suema3628 2 ปีที่แล้ว

    That's really cool, I'm currently stuck on mine as i'm only a lowly beginner and did it in a way more difficult way. Also can I ask what is that program you're using since I'm writing in notepad++

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +1

      Hi, I'm using VS code editor, because it has the best intelisense and plugins I think.

  • @JimmyJazz5964
    @JimmyJazz5964 5 หลายเดือนก่อน

    +ONE!!

  • @xinye0123
    @xinye0123 2 ปีที่แล้ว

    太棒了,厉害厉害,学习

  • @milovanmilovanov2598
    @milovanmilovanov2598 2 ปีที่แล้ว

    Are there any decent examples with functions of the matrix rain code, where I can actually change stuff, speed, size etc...

  • @VALedu11
    @VALedu11 2 ปีที่แล้ว

    wonderful lucid explanation.. loved it. thank you so much. Is its possible to create CSS cards with this MAtrix rain in the background ?

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว

      Hi Anand, glad you found some value, thank you for letting me know. You can place animated canvas effects on any element, just align canvas over it with CSS, you can have multiple canvas elements on the page at the same time. At some point optimisation will become a challenge probably, depends on what exactly you want to achieve.

  • @dukegard2504
    @dukegard2504 2 ปีที่แล้ว

    Frank great video. I was wondering if I could get your thoughts on a requestAnimationFrame question or maybe it is more about how to best set up an animation loop. In a previous video you called requestAnimationFrame inside of a class and passed a "this.animate.bind(this)" into the function. Is there any benefit to having a class that handles the animation loop and then calls an update(deltatime) and draw(ctx) function of different classes (like: Particle). Or should the animation loop stay outside of a class and kind of work inside a "main" function. Thanks again for putting together these great videos. You keep coding fun and interesting!

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว

      In most cases I think animation loop should stay outside of a class, unless you want to have multiple animation loops running independently, which might be needed to achieve specific effects and generative art patterns. If you want to have just one main animation loop, there is no need to have it inside a class. I was just experimenting in that video, I wouldn't do that normally.

  • @dmaberlin
    @dmaberlin ปีที่แล้ว

    best!

  • @lionellafont7930
    @lionellafont7930 2 ปีที่แล้ว

    Dope!

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +1

      Thanks Lionel

    • @lionellafont7930
      @lionellafont7930 2 ปีที่แล้ว

      @@Frankslaboratory man each of your vids a great. Creations are cool and explanations very clear 👍

  • @MrLinuxFreak
    @MrLinuxFreak 2 ปีที่แล้ว

    can you share a git for matrix green final version before starting to customize the colors and that circle thingy please

  • @cpr9pg8jez
    @cpr9pg8jez 2 ปีที่แล้ว

    Make a graph tutorial please. It is needed. Bar and Line graph specifically. Please make one, you are amazing at canvas, it is hard to do tbh. I already finished mine but rather see your version. Lol.

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว

      Hi Jay, I never tried to build graphs with just JavaScript and canvas, at work we usually use tools like Power BI for data visualisations, but it's definitely an interesting topic and something I want to look into

  • @ramisyousaf7165
    @ramisyousaf7165 9 หลายเดือนก่อน

    quick questions how do you have the code and at you're right the result, second questopn my formater changes ' to ", does this make a different

  • @rdlook004
    @rdlook004 2 ปีที่แล้ว

    Pretty nice really. nice voice nice way of explain it. a course series in your own plataform

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว

      Hi Ruben. Glad you like my course. I'm still learning how to be a better teacher

  • @realgungan5781
    @realgungan5781 ปีที่แล้ว

    how do you get the website to appear at the right of your screen?

  • @timhold2016
    @timhold2016 2 ปีที่แล้ว

    At 20:05 you’ll notice that your resize method is exactly the same as your constructor. To avoid code duplication you can just assign effect to a new instance of Effect in the event listener

    • @timhold2016
      @timhold2016 2 ปีที่แล้ว

      One more thing, you'll notice that the first time the characters fall they are all in sync. This is because you initialize the Y to 0 in line 38. Instead if you change it to Math.random()*-50 then the first pass through will also be jagged.

    • @timhold2016
      @timhold2016 2 ปีที่แล้ว

      Other than that, great work Frank! Love how creative these effects are

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว

      @@timhold2016 Hi Tim, thank you for the tips, you are right that the code is the same. I'm not sure what it would be like performance wise calling the new keyword on every tick of resize event. Will test. Y coordinate can be randomised indeed, it's more up to everyones creative taste, some people might like the initial wave. I should have mentioned this while recording. Thank you for taking the time to let me know your thoughts! Much appreciated

  • @johanhellberg9677
    @johanhellberg9677 2 ปีที่แล้ว

    Really impressed with your JavaScript knowledge. How did you get to where you are now? Great work Frank!

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +1

      Hi Johan, thank you, very kind. I just did a few complete well structured JavaScript courses for beginners to make sure I understand all basic JS concepts and then I started building my own projects, making them more complex as I improved my skills. I'm completely self taught from the internet :D

    • @johanhellberg9677
      @johanhellberg9677 2 ปีที่แล้ว

      @@Frankslaboratory Awesome! What's one or two JavaScript courses you especially liked? What's something you wish you had done sooner?

  • @makememorr9795
    @makememorr9795 ปีที่แล้ว

    Thanks for another cool lesson, I have one small question. Please tell me how to change the size of the characters?

    • @Frankslaboratory
      @Frankslaboratory  ปีที่แล้ว

      The easiest way would be using canvas font property, ctx.font = '50px Helvetica' for example

  • @ManallLockhart
    @ManallLockhart 6 หลายเดือนก่อน

    Fantastic. I have one question - how do I make the start flow randomly at the top instead of them all pouring down in each column at once for the first repetition?

    • @Frankslaboratory
      @Frankslaboratory  6 หลายเดือนก่อน

      You can randomize the vertical position on the first page load, I see someone also answered this for you in another comment

  • @florentdardenne
    @florentdardenne 3 หลายเดือนก่อน

    Hi, How to random the typo like the intro of the video?

  • @myfreedom42
    @myfreedom42 ปีที่แล้ว +1

    someone have the SFX of matrix's rain char to download plz ?

  • @tueday3191
    @tueday3191 2 ปีที่แล้ว

    I don't under stand why drawing semi-transparent rect in each animation frame would result in the fading out effect.
    Say you fillRect with opacity of 0.05 each time, why would the text in the latest frame is clear and it slowly blur out the text in the old frame. I hope my question makes sense. TIA

  • @motmarius1663
    @motmarius1663 ปีที่แล้ว

    Hi>
    The Matrix effect created by you is super cool, but I'm not good at Javascript and I added a navigation bar with links to the index page where I also have the Matrix effect, but the navigation bar with links doesn't appear, can you help me with what I have to do it, if I'm not asking too much. Thank you!

    • @Frankslaboratory
      @Frankslaboratory  ปีที่แล้ว

      Hi, I assume the navigation bar is a separate element and you didn't somehow draw it on canvas. If it's separate element then you just need to position canvas and that navbar in relation to each other with CSS using positioning, z-index etc. It's a CSS problem, not JavaScript, if I understand you correctly.

  • @user-wp2sm9dz5j
    @user-wp2sm9dz5j 8 หลายเดือนก่อน

    How do I use this image as a background?

  • @makedredd299
    @makedredd299 2 ปีที่แล้ว +2

    Woah, you know Kung Fu! 👓

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +2

      Yea, just plugged the code for Kung Fu directly into my brain, it was written in JavaScript of course :D

  • @devegaming6839
    @devegaming6839 2 ปีที่แล้ว

    Hey , I have got this all right ! thanks
    But i gotta ask
    Is there any way you could get the colors from an image ?
    So the matrix characters would be drawing an actual image .
    Please if you got any video explaining this let me know, Thanks !

    • @Frankslaboratory
      @Frankslaboratory  ปีที่แล้ว

      I do that in a couple of videos but not with letters, just with particle shapes. I called the video image particle rain or something like that, it has two parts

  • @sonnyl2915
    @sonnyl2915 ปีที่แล้ว

    Thank you Franks I followed your tutorial and it worked flawlessly. However, I would like to put a short white text statically overlaying the raining effect - wondering how would I achieve that? Thanks.

    • @Frankslaboratory
      @Frankslaboratory  ปีที่แล้ว

      Hi Sonny. Well done on completing the project. There are many ways to do that. The best way is to use CSS and position some or element over canvas. If you want the text to have some kind of interactions with the animation you can also use ctx.fillText method and draw it on canvas.

    • @sonnyl2915
      @sonnyl2915 ปีที่แล้ว

      @Franks laboratory yes i did it with the css method but it wasn't successful at first, text did not show up, changed from class to id and it worked! Also i tried z-index. I'm grateful for your expertise Franks. Can't wait to watch your new video.

  • @user-wp2sm9dz5j
    @user-wp2sm9dz5j 8 หลายเดือนก่อน

    How to use this code as background

  • @prometheusli101
    @prometheusli101 2 ปีที่แล้ว

    could you make other kind of effects like laser light,lightning,explosion?

  • @MrMcFyfey
    @MrMcFyfey 2 ปีที่แล้ว

    The first iteration does not create the column effect, how can that be fixed?

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว

      Hi Stuart, sounds like a typo somewhere in your code, I can't help you without seeing your code.

  • @JM-de2gh
    @JM-de2gh 2 ปีที่แล้ว

    Is Frank the One? Can he just... see code O_O;; Suspicions rising. This one looks like some fun. I'll tackle it tomorrow morning with some coffee! Thanks man!

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว

      I took a red pill :D Hope you have fun during your Saturday morning ritual :D

    • @JM-de2gh
      @JM-de2gh 2 ปีที่แล้ว

      @@Frankslaboratory Morning Ritual: watch your vid. (Sometimes) Nighttime ritual: tribute. th-cam.com/video/-X4HSxnXXN4/w-d-xo.html

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว

      Hahaha. I think this one is your best. You are getting more and more creative. That was funny lol. You should do voice-overs for something 😄😁 glad to see that not only you finished it but also added extra features. It looks like you randomised colour for each column separately. Awesome 😎😎😎

    • @JM-de2gh
      @JM-de2gh 2 ปีที่แล้ว

      @@Frankslaboratory These videos can be pretty fun to make. I've decided I don't want to make a TH-cam channel, but I wouldn't mind the occasional outlet of just making a video for fun. This led me to think about a collaboration idea between you and me. Concerning the topic it covers: Javascript and APIs. The story context around it could be a proper re-introduction of my 'joke' where I'm trying to be cooler than you, and this sparks a competition that I send your way. I'll make it funny. Then I'll have a game where you build a ship via API and then it runs through a level (it'll be simple). Then your viewers can build a ship via API and try to beat your score. It'll be something like a physics based game. If you are interested let me know and I'll hammer out more details. And seriously: absolutely no worries if you aren't interested.

    • @Frankslaboratory
      @Frankslaboratory  2 ปีที่แล้ว +1

      Sure. Let's do it. Sounds like fun. I guess its better to discuss this on Twitter kr somewhere