<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: James Bubb</title>
    <description>The latest articles on DEV Community by James Bubb (@codebubb).</description>
    <link>https://dev.to/codebubb</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F38442%2Fc3e66828-8bf5-4f50-9275-88064f1ef52d.png</url>
      <title>DEV Community: James Bubb</title>
      <link>https://dev.to/codebubb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codebubb"/>
    <language>en</language>
    <item>
      <title>JavaScript Snow</title>
      <dc:creator>James Bubb</dc:creator>
      <pubDate>Thu, 14 Dec 2023 11:14:45 +0000</pubDate>
      <link>https://dev.to/codebubb/javascript-snow-52im</link>
      <guid>https://dev.to/codebubb/javascript-snow-52im</guid>
      <description>&lt;p&gt;Here's how you can add a snow animation with JavaScript to your site just for the festive season :)&lt;/p&gt;

&lt;p&gt;See a demo by &lt;a href="https://www.youtube.com/watch?v=JG7B4W9HeOw" rel="noopener noreferrer"&gt;watching the tutorial here&lt;/a&gt; and for my thoughts on why it's a bad idea!&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/codebubb/embed/LYqovoV?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Setup Constants
&lt;/h2&gt;

&lt;p&gt;Let's setup some variables to hold some info on the appearance of our snow animation.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;NUMBER_OF_SNOWFLAKES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MAX_SNOWFLAKE_SIZE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MAX_SNOWFLAKE_SPEED&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;SNOWFLAKE_COLOUR&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#ddd&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;snowflakes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We'll also create an empty array called &lt;code&gt;snowflakes&lt;/code&gt; which is going to keep track of all the individual snowflakes on the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Create a canvas
&lt;/h2&gt;

&lt;p&gt;All our snowflakes are going to be drawn onto a canvas element so let's create that and drop it onto the current document.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;canvas&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;position&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;absolute&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pointerEvents&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;none&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;top&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;0px&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerWidth&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2d&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We're sizing the canvas to fit the entire window and setting the &lt;code&gt;pointer-event&lt;/code&gt; CSS property to &lt;code&gt;none&lt;/code&gt; so it makes the canvas invisible and the user can still click things behind it.&lt;/p&gt;

&lt;p&gt;Finally, we'll get the 2d canvas context, which we can use to draw our snowflakes on. &lt;/p&gt;

&lt;p&gt;But first, we need a function to generate a snowflake.&lt;/p&gt;

&lt;h2&gt;
  
  
   3. Create a snowflake
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;createSnowflake&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;MAX_SNOWFLAKE_SIZE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;SNOWFLAKE_COLOUR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;speed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;MAX_SNOWFLAKE_SPEED&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;sway&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This function will create and return a snowflake object which is at some random position on the page.  We'll also create a random size (radius) for it, set its colour to the constant we defined and also give it a random speed with a minimum value.&lt;/p&gt;

&lt;p&gt;In the second part of the tutorial, we introduce a &lt;code&gt;sway&lt;/code&gt; property in order to move the snowflake either left or right as it falls down the page.&lt;/p&gt;

&lt;p&gt;Now we need a way to draw the snowflake onto the canvas.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Draw a snowflake
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;drawSnowflake&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;snowflake&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;beginPath&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;arc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;snowflake&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;snowflake&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;snowflake&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;radius&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PI&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fillStyle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;snowflake&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;closePath&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We're just going to draw a circle with a radius as specified by the property on the snowflake object that's passed in.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Update a snowflake
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;updateSnowflake&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;snowflake&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;snowflake&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;snowflake&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;speed&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;snowflake&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;snowflake&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sway&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;snowflake&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assign&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;snowflake&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;createSnowflake&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here, we'll take one of our snowflake objects and update its x and y positions on the page.  If it gets to the bottom of the page, we'll re-assign the reference of the snowflake to a new snowflake object.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Animating snowflakes
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;animate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clearRect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nx"&gt;snowflakes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;snowflake&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;updateSnowflake&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;snowflake&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nf"&gt;drawSnowflake&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;snowflake&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="nf"&gt;requestAnimationFrame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;animate&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;animate&lt;/code&gt; function clears the current canvas and then loops through our array of snowflakes and updates their position, then draws them onto the canvas.&lt;/p&gt;

&lt;p&gt;We can make a really smooth animation by simply calling this function repeatedly by passing it to &lt;code&gt;requestAnimationFrame&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Of course, we haven't put any snowflake objects into our &lt;code&gt;snowflakes&lt;/code&gt; array yet so let's populate those now and kick off the animation by calling the &lt;code&gt;animate&lt;/code&gt; function.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;NUMBER_OF_SNOWFLAKES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;snowflakes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;createSnowflake&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;animate&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We should have a fully working snowfall animation on our page now!&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Adding Event Listeners
&lt;/h2&gt;

&lt;p&gt;If you try and resize your browser window at this point or scroll down to more content (if it exists on your page) then you'll notice that the snowfall effect is fixed to the top of the page and doesn't resize to fit the browser window.&lt;/p&gt;

&lt;p&gt;Let's finish off our beautiful snowfall animation with a couple of event listeners to handle this.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;resize&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerWidth&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;scroll&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;top&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;scrollY&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;px`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Because we've written everything in JavaScript with no extra HTML/CSS required, we can just copy the code and drop it into any site.  For example, here's how it looks on Amazon's site:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fts70upghn6t98pkxxi4z.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fts70upghn6t98pkxxi4z.gif" alt="JavaScript snow on Amazon"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;As mentioned in the video, this is just a bit of fun and not something you should probably add to your site unless your company is insistent on sending your site back to the 1990s :)&lt;/p&gt;

&lt;p&gt;Thanks for reading and be sure to check out the full tutorial here if you want more details:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/JG7B4W9HeOw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
    </item>
    <item>
      <title>DevTips Daily Update 08/04/22</title>
      <dc:creator>James Bubb</dc:creator>
      <pubDate>Fri, 08 Apr 2022 09:15:38 +0000</pubDate>
      <link>https://dev.to/codebubb/devtips-daily-update-080422-3aoa</link>
      <guid>https://dev.to/codebubb/devtips-daily-update-080422-3aoa</guid>
      <description>&lt;p&gt;So this week we finished off the Rick and Roll full end-to-end project! 🎉&lt;/p&gt;

&lt;p&gt;It’s taken a while and we’ve covered everything from design to devops to developing the app, hopefully you’ve leant a few things about creating and deploying an app.&lt;/p&gt;

&lt;p&gt;Also, we returned to business as usual delivering juicy little bite-size dev tips about touch support, emojis as favicons and spellchecking (check out the new thumbnail style below 👇):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/u0Kiz0IHobA"&gt;DevTips Daily - Rick and Roll Project - Creating a responsive view&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/u0Kiz0IHobA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/jfjcZcAl6Dg"&gt;DevTips Daily - Rick and Roll Project - Creating an offscreen navigation for mobile views&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/jfjcZcAl6Dg"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/vclovxgyrYk"&gt;DevTips Daily - Rick and Roll Project - Toggling an offscreen navigation menu&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/vclovxgyrYk"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/PI3TZVOhGeo"&gt;DevTips Daily - Rick and Roll Project - Finale!&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/PI3TZVOhGeo"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/-3XdJxVm4C4"&gt;DevTips - Detecting touch support in JavaScript&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/-3XdJxVm4C4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/V35_ybFs5t8"&gt;How to use emojis for favicons&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/V35_ybFs5t8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/OI85pDxwIf8"&gt;Spellcheck user input with just HTML!&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/OI85pDxwIf8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;More next week!&lt;/p&gt;

&lt;p&gt;Thanks for watching 👍&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>DevTips Daily Update 01/04/22</title>
      <dc:creator>James Bubb</dc:creator>
      <pubDate>Fri, 01 Apr 2022 08:14:34 +0000</pubDate>
      <link>https://dev.to/codebubb/devtips-daily-update-010422-133h</link>
      <guid>https://dev.to/codebubb/devtips-daily-update-010422-133h</guid>
      <description>&lt;p&gt;So we're getting towards the end of our end-to-end project where we're creating a 'Rick Rolling' app.&lt;/p&gt;

&lt;p&gt;We did some cool stuff though this week, including some date formatting with DayJS, buying a new 'short' domain to use in our app and also a bit of nginx configuration to point our new domain to our existing app!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/GR5uzt41HoQ"&gt;DevTips Daily - Rick and Roll Project - Adding a short domain name&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/GR5uzt41HoQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/jJqgXsO3IBI"&gt;DevTips Daily - Rick and Roll Project - Configuring the short domain for production&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/jJqgXsO3IBI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/A7kRfmIULeY"&gt;DevTips Daily - Rick and Roll Project - Adding a redirect route in Express&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/A7kRfmIULeY"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/h4MKnWl0-oc"&gt;DevTips Daily - Rick and Roll Project - Creating a short URL input&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/h4MKnWl0-oc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/VzTDdC8v8lE"&gt;DevTips Daily - Rick and Roll Project - Redirecting users in the browser&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/VzTDdC8v8lE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/CyRQvYl-in4"&gt;DevTips Daily - Rick and Roll Project - Adding instructions and documentation to the app&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/CyRQvYl-in4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/8Ql86_3WP40"&gt;DevTips Daily - Rick and Roll Project - Creating and adding a favicon&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/8Ql86_3WP40"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Next week, we’re going to be finishing off our app completely! There’s just a bit of work to do on tidying up styling and adding some mobile responsiveness!&lt;/p&gt;

&lt;p&gt;Thanks for watching 👍&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>DevTips Daily Update - 25/03/22</title>
      <dc:creator>James Bubb</dc:creator>
      <pubDate>Fri, 25 Mar 2022 10:00:59 +0000</pubDate>
      <link>https://dev.to/codebubb/devtips-daily-update-250322-2pg7</link>
      <guid>https://dev.to/codebubb/devtips-daily-update-250322-2pg7</guid>
      <description>&lt;p&gt;So in this week’s tutorials we finished off the stats feature of our application and did some cool stuff like sharing stylesheets across apps in our Monorepo and saw some different ways to dynamically create HTML content with JavaScript/Typescript.&lt;/p&gt;

&lt;p&gt;Here’s a link to each video this week:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/9S-RenxtXlU"&gt;DevTips Daily - Rick and Roll Project - Creating a GET endpoint to provide stats information&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/9S-RenxtXlU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/Tzt20m3Gr6M"&gt;DevTips Daily - Rick and Roll Project - Changing the default port of an app in an NX MonoRepo&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Tzt20m3Gr6M"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/d-QkcGmm_EU"&gt;DevTips Daily - Rick and Roll Project - Parsing path or query params from a URL&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/d-QkcGmm_EU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/0aIBqaeptb4"&gt;DevTips Daily - Rick and Roll Project - Using Fetch to GET API data for our stats&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/0aIBqaeptb4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/nAKtSjbR-tg"&gt;DevTips Daily - Rick and Roll Project - Sharing Stylesheets across Apps (within an NX MonoRepo)&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/nAKtSjbR-tg"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/zTcr8GDkDyE"&gt;DevTips Daily - Rick and Roll Project - Creating a dynamic heading for the stats App&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/zTcr8GDkDyE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/o7ngDsQ7n9U"&gt;DevTips Daily - Rick and Roll Project - Creating a dynamic table&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/o7ngDsQ7n9U"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/AVKR3L3jeQA"&gt;DevTips Daily - Rick and Roll Project - Adding table styles&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/AVKR3L3jeQA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/kAQRLXIOPR4"&gt;DevTips Daily - Rick and Roll Project - Formatting dates with DayJS&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/kAQRLXIOPR4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/j8Kz6iILQUE"&gt;DevTips Daily - Rick and Roll Project - Enabling Dynamic paths in Nginx Configuration&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/j8Kz6iILQUE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Next week, we’ll be getting a new domain setup for doing redirects (an actual short domain URL!) and doing and starting to tidy up our app ready for completion!&lt;/p&gt;

&lt;p&gt;Thanks for watching&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/codebubb"&gt;@codebubb&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>DevTips Daily Update 18/03/22</title>
      <dc:creator>James Bubb</dc:creator>
      <pubDate>Fri, 18 Mar 2022 10:02:37 +0000</pubDate>
      <link>https://dev.to/codebubb/devtips-daily-update-180322-34f2</link>
      <guid>https://dev.to/codebubb/devtips-daily-update-180322-34f2</guid>
      <description>&lt;p&gt;So in this week's update we did some cool stuff with Geolocation and used a free API to write the user's location into the database (for someone who has accessed a short url).  This is to setup our stats data so we can start working on the newly created stats app!&lt;/p&gt;

&lt;p&gt;Here's a link to each individual tutorial:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/tTSOA28LpFY"&gt;Viewing MongoDB records&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/tTSOA28LpFY"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/TdFSeFDnm78"&gt;Geolocating users by IP&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/TdFSeFDnm78"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/62fz_VqbKyE"&gt;Checking Geolocation details&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/62fz_VqbKyE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/-ZMuqwIeZtE"&gt;Preventing unnessary Geolocation requests&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/-ZMuqwIeZtE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/9S-RenxtXlU"&gt;Creating a GET endpoint to serve stats&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/9S-RenxtXlU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/Tzt20m3Gr6M"&gt;Changing the default port of an NX App&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Tzt20m3Gr6M"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/d-QkcGmm_EU"&gt;Parsing Path / Query Params&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/d-QkcGmm_EU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Next week we're going to be carrying on with the project again, we're going to be working on the stats app and displaying stats to the user and starting to wrap up the rest of the Rick and Roll end to end project!&lt;/p&gt;

&lt;p&gt;Thanks for watching 👍&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>DevTips Daily Update 11/03/22</title>
      <dc:creator>James Bubb</dc:creator>
      <pubDate>Fri, 11 Mar 2022 11:17:58 +0000</pubDate>
      <link>https://dev.to/codebubb/devtips-daily-update-110322-1pod</link>
      <guid>https://dev.to/codebubb/devtips-daily-update-110322-1pod</guid>
      <description>&lt;p&gt;So this week's DevTips daily tutorials are continuing on with our full end to end project and we're starting to see things come together now!&lt;/p&gt;

&lt;p&gt;We've been doing some cool things with NX like creating a shared library, building a new web app and adding it to our deployment pipeline and also POSTing user choices to the backend and creating personalised shorturls based on those selections.&lt;/p&gt;

&lt;p&gt;Here's a link to each individual tutorial:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/q2reFtYs_Q0"&gt;Creating a shared library&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/q2reFtYs_Q0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/hJy_ONTMjW8"&gt;Generating Option Elements for the Front-end&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/hJy_ONTMjW8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/fI-Fmkb3-bg"&gt;POSTing JSON data to the backend with Fetch&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/fI-Fmkb3-bg"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/NwkJhc2FIc0"&gt;Handling the JSON data on the backend Express App&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/NwkJhc2FIc0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/5I5OYw1IjUA"&gt;Redirecting users in Express&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/5I5OYw1IjUA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/Ldl_4_TYZuY"&gt;Creating a new web app and deploying it&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Ldl_4_TYZuY"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/cKyto1aUspI"&gt;Updating or replacing data in MongoDB&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/cKyto1aUspI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Next week we're going to be carrying on with the project again, we're going to be adding some geolocation to our stats and displaying that info to the user!&lt;/p&gt;

&lt;p&gt;Thanks for watching 👍&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>DevTips Daily Update 21/01/22</title>
      <dc:creator>James Bubb</dc:creator>
      <pubDate>Fri, 21 Jan 2022 10:47:43 +0000</pubDate>
      <link>https://dev.to/codebubb/devtips-daily-update-210122-8hk</link>
      <guid>https://dev.to/codebubb/devtips-daily-update-210122-8hk</guid>
      <description>&lt;p&gt;So this week's DevTips daily tutorials have been a bit truncated - I was ill at the start of the year with COVID so i'm just catching up with things and starting to feel better!&lt;/p&gt;

&lt;p&gt;I did publish a few videos however carrying on with our end to end project, looking at PM2 logs, securing the ports of our Digital Ocean droplet and creating specific Express routing files and finally doing a review of our progress on the project by looking at our User Stories!&lt;/p&gt;

&lt;p&gt;Here's a link to each individual tutorial:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/N6u3moFt6vk"&gt;Viewing PM2 Logs&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/N6u3moFt6vk"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/xdOKFJB0ZQ4"&gt;Securing a MongoDB database with Digital Ocean&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/xdOKFJB0ZQ4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/uBwACkIzE6w"&gt;Creating Express Routing Files&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/uBwACkIzE6w"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/q1zg-a0FluI"&gt;User Story Review&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/q1zg-a0FluI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Next week we're going to be carrying on with the project again, starting to make progress on the front end side of things, giving the user something to generate the short URLs.&lt;/p&gt;

&lt;p&gt;Thanks for watching 👍&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>DevTips Daily Update 10/12/21</title>
      <dc:creator>James Bubb</dc:creator>
      <pubDate>Fri, 10 Dec 2021 14:42:50 +0000</pubDate>
      <link>https://dev.to/codebubb/devtips-daily-update-101221-3am1</link>
      <guid>https://dev.to/codebubb/devtips-daily-update-101221-3am1</guid>
      <description>&lt;p&gt;So in this week's videos on DevTips Daily, we've still being carrying on with our end-to-end project and there's been lots of configuration and setup of our server to get it ready to deploy our code. For example, we setup a web server, pointed our domain to it and enable HTTPS with an SSL certificate!&lt;/p&gt;

&lt;p&gt;Here's a link to each individual tutorial:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/3K-pCTW6oR4"&gt;Installing nginx&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/3K-pCTW6oR4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/A0pb8Aa9L7M"&gt;nginx Configuration&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/A0pb8Aa9L7M"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/HVfo_bacbo8"&gt;Pointing the domain to the server&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/HVfo_bacbo8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/8i3OjPqPHmc"&gt;SSL with LetsEncrypt&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/8i3OjPqPHmc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/jE8pv_ULHKA"&gt;Directories for Node App&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/jE8pv_ULHKA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/DJHdeqxTL-w"&gt;Setup Node.js on the server&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/DJHdeqxTL-w"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/JUfhhrGZ8eQ"&gt;Setup Docker on Ubuntu Server&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/JUfhhrGZ8eQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Next week we're going to be carrying on with the project again, we've got a touch more configuration to do and then we'll be revisiting our GitHub action to finally push our code to our server!&lt;/p&gt;

&lt;p&gt;Thanks for watching 👍&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>devtipsdaily</category>
      <category>javascript</category>
    </item>
    <item>
      <title>DevTips Daily Update 03/12/21</title>
      <dc:creator>James Bubb</dc:creator>
      <pubDate>Fri, 03 Dec 2021 13:25:27 +0000</pubDate>
      <link>https://dev.to/codebubb/devtips-daily-update-191121-434m</link>
      <guid>https://dev.to/codebubb/devtips-daily-update-191121-434m</guid>
      <description>&lt;p&gt;So in this week's videos on DevTips Daily, we were carrying on with our full end to end project and we did a bit more work on the API in terms of setting up the redirect endpoint in Express. We then moved on to setting up a deployment pipeline with a GitHub action and finished up by starting to configure our Digital Ocean droplet to accept out code.&lt;/p&gt;

&lt;p&gt;Here's a link to each individual tutorial:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/RrRXdNAVFpk"&gt;Sending POST requests with Postman&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/RrRXdNAVFpk"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/1y_RbcJ0eKk"&gt;Redirect Endpoint in Express&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/1y_RbcJ0eKk"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/bW_JV7jeJxE"&gt;CI/CD Pipeline Overview&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/bW_JV7jeJxE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/2AD8-uYlTQA"&gt;Creating a GitHub action&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/2AD8-uYlTQA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/mWw7XrBy-Aw"&gt;Installing and Building in the GitHub action&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/mWw7XrBy-Aw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/DOocQ-yrT5g"&gt;Adding a new User on the server&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/DOocQ-yrT5g"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/h7HY6cwMY0M"&gt;Setting / Resetting a user's password&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/h7HY6cwMY0M"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Next week we're going to be carrying on with the project again, we're going to be finishing off setting up the server and getting our pipeline to push our code to the server!&lt;/p&gt;

&lt;p&gt;Thanks for watching 👍&lt;/p&gt;

</description>
      <category>devtipsdaily</category>
      <category>beginners</category>
      <category>javascript</category>
    </item>
    <item>
      <title>DevTips Daily Update 26/11/21</title>
      <dc:creator>James Bubb</dc:creator>
      <pubDate>Fri, 26 Nov 2021 15:28:08 +0000</pubDate>
      <link>https://dev.to/codebubb/devtips-daily-update-261121-24ab</link>
      <guid>https://dev.to/codebubb/devtips-daily-update-261121-24ab</guid>
      <description>&lt;p&gt;So in this week's videos on DevTips Daily, we were carrying on with our full end to end project and we got setup with our server on Digital ocean, starting creating some endpoints in the Express app for generating short urls and also got setup with a MongoDB database inside a Docker container.&lt;/p&gt;

&lt;p&gt;Here's a link to each individual tutorial:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/TqniZz0ZyWE"&gt;Setup hosting server&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/TqniZz0ZyWE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/zZpiGCXQcZg"&gt;Connecting to server via SSH&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/zZpiGCXQcZg"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/Xldt2wT-v90"&gt;Creating short URLs&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Xldt2wT-v90"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/nag8DMmG0D0"&gt;Setup MongoDB with Docker&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/nag8DMmG0D0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;[Testing MongoDB connection](&lt;a href="https://youtu.be/Pm2PWfKG1y0"&gt;https://youtu.be/Pm2PWfKG1y0&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Pm2PWfKG1y0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/g9l3JSmsxdQ"&gt;Connecting to MongoDB in the API&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/g9l3JSmsxdQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/https://youtu.be/NWQJatD432E"&gt;Adding URLs to database&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/NWQJatD432E"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Next week we're going to be carrying on with the project again, we'll be setting up our redirect endpoint and starting to build our delivery pipeline with GitHub Actions!&lt;/p&gt;

&lt;p&gt;Thanks for watching 👍&lt;/p&gt;

</description>
      <category>devtipsdaily</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>DevTips Daily Update 19/11/21</title>
      <dc:creator>James Bubb</dc:creator>
      <pubDate>Fri, 19 Nov 2021 10:03:19 +0000</pubDate>
      <link>https://dev.to/codebubb/devtips-daily-update-191121-51o1</link>
      <guid>https://dev.to/codebubb/devtips-daily-update-191121-51o1</guid>
      <description>&lt;p&gt;So in this week's videos on DevTips Daily, we made a start on our full end to end project mini-series.  We got cracking with the project idea, took a look at writing Agile User Stories and got some boilerplate code setup using the NX CLI.&lt;/p&gt;

&lt;p&gt;Here's a link to each individual tutorial:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/O7qf1nmswF4"&gt;Project Management Tools&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/O7qf1nmswF4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/6N7PuJ4CO-4"&gt;Writing Agile User Stories&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/6N7PuJ4CO-4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/E6p6_ST-Xg8"&gt;Project Name and Domain&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/E6p6_ST-Xg8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/LFYVpxXg64I"&gt;Code Setup With NX&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/LFYVpxXg64I"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/Eg4mYYBdhxU"&gt;Serving the API with NX&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Eg4mYYBdhxU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/hgPRaPd2XcA"&gt;Creating the GitHub Repository&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/hgPRaPd2XcA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/EkQPw2zfP3Y"&gt;Generate SSH Key Pair&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/EkQPw2zfP3Y"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Next week we're going to be carrying on with the project, setting up a server to host the project files, building a CI pipeline and more!&lt;/p&gt;

&lt;p&gt;Thanks for watching 👍&lt;/p&gt;

</description>
      <category>devtipsdaily</category>
      <category>beginners</category>
      <category>javascript</category>
    </item>
    <item>
      <title>React Project: Newsletter Signup form (using Formik, Netlify Functions &amp; MailChimp)</title>
      <dc:creator>James Bubb</dc:creator>
      <pubDate>Tue, 15 Jun 2021 11:53:34 +0000</pubDate>
      <link>https://dev.to/codebubb/react-project-newsletter-signup-form-using-formik-netlify-functions-mailchimp-1e38</link>
      <guid>https://dev.to/codebubb/react-project-newsletter-signup-form-using-formik-netlify-functions-mailchimp-1e38</guid>
      <description>&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=mAfR27lUKNQ"&gt;Watch the full tutorial here --&amp;gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So in this React tutorial we'll be taking a look at the Formik forms library for React and seeing how you can use it to create and manage forms quickly and easily within your React projects.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/mAfR27lUKNQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;We'll start off by getting the Formik library setup and then creating some simple inputs that the user can enter data into and we'll see how Formik handles all of the state management and form submission for us automatically.&lt;/p&gt;

&lt;p&gt;Once we've got a basic form setup with Formik, we'll add a custom React label component and then wire up some validation to the form.  We'll do this using the Yup library with our React form and you'll see it's really simple to create a Yup schema and then apply this to the Formik form. In fact, Yup and Formik work really well together.&lt;/p&gt;

&lt;p&gt;With our validation in place we'll finish up the tutorial by creating a Netlify function to handle our form submission which will essentially pass this data to the email service provider MailChimp.  We'll use the MailChimp API with React to submit the user's details they enter into the form to the MailChimp service.  I'll take you through how to find your own MailChimp list ID and also MailChimp API token and successfully add contacts.&lt;/p&gt;

&lt;p&gt;So I hope you enjoy this React Project tutorial from Junior Developer Central!&lt;/p&gt;

</description>
      <category>react</category>
      <category>netlify</category>
      <category>mailchimp</category>
    </item>
  </channel>
</rss>
