<?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>Forem: Thomas Fitzgerald</title>
    <description>The latest articles on Forem by Thomas Fitzgerald (@fitzcodes).</description>
    <link>https://forem.com/fitzcodes</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%2F127282%2F0dc4453a-1739-4d9f-a038-107ba5a20edd.jpg</url>
      <title>Forem: Thomas Fitzgerald</title>
      <link>https://forem.com/fitzcodes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/fitzcodes"/>
    <language>en</language>
    <item>
      <title>Get recognized: add some pizzazz to your portfolio</title>
      <dc:creator>Thomas Fitzgerald</dc:creator>
      <pubDate>Thu, 17 Dec 2020 00:44:48 +0000</pubDate>
      <link>https://forem.com/fitzcodes/get-recognized-add-some-pizzazz-to-your-portfolio-156d</link>
      <guid>https://forem.com/fitzcodes/get-recognized-add-some-pizzazz-to-your-portfolio-156d</guid>
      <description>&lt;h2&gt;
  
  
  What?
&lt;/h2&gt;

&lt;p&gt;When conceptualizing my personal profile site, the number one thing I had in mind was that I needed something to reflect my personality, to 'pop'. I had been searching for ideas for a while when I came across a CodePen that immediately caught my attention. I had seen moving gradient backgrounds before, but not like this; sliding diagonal backgrounds that are set under the content. I loved it. &lt;/p&gt;

&lt;p&gt;We are going to recreate that together. What will this look like? Check out the live demo here:&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Let's get started
&lt;/h2&gt;

&lt;p&gt;Let's get some HTML written. We are going to create three divs (&lt;code&gt;&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;/code&gt;) all with the class of background &lt;code&gt;class="background&lt;/code&gt;. So, what we have now is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"background"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"background"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"background"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We still need to do two things to the HTML. In the second and third &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;'s we need to add a second &lt;code&gt;class=""&lt;/code&gt;. Add 'background2' to the second div and add 'background3' to the third div. You’ll see the reason in the following paragraphs and now the result should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"background"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"background background2"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"background background3"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Add CSS
&lt;/h2&gt;

&lt;p&gt;Now it's time to add some style! To start, let’s go ahead and create our three background classes. So now we have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.background&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.background2&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.background3&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;Now in the &lt;code&gt;.background{}&lt;/code&gt; class we are going to set up our movement with the &lt;code&gt;animation:&lt;/code&gt; property. We’ll add the code and then I’ll explain what it does. Add this code to the background:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.background&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;slide&lt;/span&gt; &lt;span class="m"&gt;3s&lt;/span&gt; &lt;span class="n"&gt;ease-in-out&lt;/span&gt; &lt;span class="n"&gt;infinite&lt;/span&gt; &lt;span class="n"&gt;alternate&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;What are we doing here? It’s a lot jammed into that statement. First, we are naming the animation 'slide' and then telling it to take 3 seconds to complete. Next, we are telling the timing function to 'ease-in-out', which means to start slow and end slow and to iterate infinitely. Lastly, alternate tells the animation to 'play forward and then in reverse'.&lt;/p&gt;

&lt;p&gt;Now let's add the rest of the properties to the &lt;code&gt;.background{}&lt;/code&gt; starting directly below the animation line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.background&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;slide&lt;/span&gt; &lt;span class="m"&gt;3s&lt;/span&gt; &lt;span class="n"&gt;ease-in-out&lt;/span&gt; &lt;span class="n"&gt;infinite&lt;/span&gt; &lt;span class="n"&gt;alternate&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;background-image&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;linear-gradient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-50deg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;#ff0004&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;#0065d7&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nl"&gt;bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;-50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;.5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;fixed&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;-50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;z-index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;-1&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;Oh my! What's going on with the &lt;code&gt;background-image:&lt;/code&gt; property? We set it up to be a linear-gradient. By default linear-gradient is from top to bottom. So, the first part where we set it to &lt;code&gt;-50deg&lt;/code&gt;, sets a specific angle. Next, linear-gradient needs at least two colors, so we are going to use a shade of red and a shade of blue &lt;code&gt;#ff0004&lt;/code&gt; and &lt;code&gt;#0065d7&lt;/code&gt; respectively. The &lt;code&gt;50%&lt;/code&gt; after each color is an optional stop position you can add to the property. In our case, we only want each color to cover 50% of the gradient. &lt;/p&gt;

&lt;p&gt;The remaining properties in the &lt;code&gt;.background{}&lt;/code&gt; make sure it's positioned where we want it, that it will be behind the content, and that it’s slightly opaque. Let's finish up with the &lt;code&gt;.background2{}&lt;/code&gt; and &lt;code&gt;.background3{}&lt;/code&gt; classes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.background2&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;animation-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;alternate-reverse&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;animation-duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.background3&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;animation-duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5s&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;For these two classes we just want to adjust a few specific qualities of the animation. In &lt;code&gt;.background2{}&lt;/code&gt; we want it to play in the alternate direction of the &lt;code&gt;.background{}&lt;/code&gt; class. We also want it to take a full one second longer to play (any faster reduces the UX). For &lt;code&gt;.background3{}&lt;/code&gt;, we just want it to take a full two seconds longer than the &lt;code&gt;.background{}&lt;/code&gt; class. &lt;/p&gt;

&lt;p&gt;Why don't &lt;code&gt;.background2{}&lt;/code&gt; and &lt;code&gt;.background3{}&lt;/code&gt; have all the same properties as &lt;code&gt;.background{}&lt;/code&gt;? Well, recall the &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;'s we created in the HTML? All three contain the &lt;code&gt;.background{}&lt;/code&gt; class which handles all the color. The other two background classes will apply a white overlay effect in their respective &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;'s creating different shades, and with the slight animation property adjustments, give us the different shades of red and blue moving diagonally! BOOM!&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's make it move
&lt;/h2&gt;

&lt;p&gt;Time to add that last bit of CSS, the &lt;code&gt;@keyframes&lt;/code&gt;! A keyframe is a CSS rule that controls the intermediate steps in an animation sequence by declaring waypoints (keyframes) along the animation sequence. Put this at the bottom of the CSS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@keyframes&lt;/span&gt; &lt;span class="n"&gt;slide&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;translateX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-25%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="err"&gt;100&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;translateX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;25%&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;Let’s break it down. We have 'slide', which is what we initially named the animation in the top-level &lt;code&gt;.background{}&lt;/code&gt; class. Next, we’ll declare two waypoints. Essentially we’re directing the movement from top to bottom in a 'here' to 'there' way. So at the start of the animation (0%) we set it to an offset of &lt;code&gt;-25%&lt;/code&gt; and then at the end of the animation (100%) it moves to an offset of &lt;code&gt;25%&lt;/code&gt;. Our full CSS should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.background&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;slide&lt;/span&gt; &lt;span class="m"&gt;3s&lt;/span&gt; &lt;span class="n"&gt;ease-in-out&lt;/span&gt; &lt;span class="n"&gt;infinite&lt;/span&gt; &lt;span class="n"&gt;alternate&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;background-image&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;linear-gradient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-50deg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;#ff0004&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;#0065d7&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nl"&gt;bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;-50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;.5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;fixed&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;-50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;z-index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;-1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.background2&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;animation-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;alternate-reverse&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;animation-duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.background3&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;animation-duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;@keyframes&lt;/span&gt; &lt;span class="n"&gt;slide&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;translateX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-25%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="err"&gt;100&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;translateX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;25%&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;To see this live, check out my profile site at &lt;a href="https://fitzweb.dev"&gt;fitzweb.dev&lt;/a&gt;!&lt;br&gt;
See the code at this GitHub Repo &lt;a href="https://github.com/fitzwebdev/fitzwebdev.github.io"&gt;fitzwebdev&lt;/a&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  Call to action
&lt;/h2&gt;

&lt;p&gt;Now that you have a fun little sliding diagonal background, make it your own! You can add a fourth or fifth background, using the same slide animation, but with the linear-gradient line set to be up and down. Then you'd have diagonal movement along with right to left vertical movement. There is a lot you can do with this to experiment with to understand the basics of what we've learned today. Go build and make it your own!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>css</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Random Joke Generator for the beginner (and that's no joke!)</title>
      <dc:creator>Thomas Fitzgerald</dc:creator>
      <pubDate>Fri, 02 Oct 2020 00:47:43 +0000</pubDate>
      <link>https://forem.com/fitzcodes/random-joke-generator-for-the-beginner-and-that-s-no-joke-49ca</link>
      <guid>https://forem.com/fitzcodes/random-joke-generator-for-the-beginner-and-that-s-no-joke-49ca</guid>
      <description>&lt;p&gt;When I first started dabbling with JavaScript one of the first things I learned was the classic "Random Quote Generator". I remember thinking how cool it was to get something like that to work. I didn't care how simple it was or how many people had made one mine was so &lt;em&gt;cool&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;It was my first time combining HTML, CSS and JavaScript together and seeing something happen in the browser. To me, &lt;strong&gt;IT WAS AWESOME!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So if you are a complete beginner this guide is going to be a great way to get your feet wet. Even if you aren't a beginner maybe you haven't done one in a while and would like a little refresher. &lt;/p&gt;

&lt;p&gt;Today we are going to build a Random Joke Generator. It's the same concept if you would rather use random quotes - this is yours to customize! &lt;/p&gt;

&lt;p&gt;In order to encourage you to customize the generator to your own style and imagination, this guide is going to be fairly plain when it comes to the CSS, doing the bare minimum for styling. &lt;/p&gt;

&lt;p&gt;Our final product is going to look like this:&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/fitzwebdev/embed/qBZzpOe?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;First things first, lets get out project in order. In your project folder create three files - an index.html, style.css, and scripts.js. &lt;/p&gt;

&lt;p&gt;Let's get our HTML structure set up next. &lt;/p&gt;

&lt;p&gt;Start with the basic HTML skeleton:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Go ahead and fill in your &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt; with "Random Jokes". This will display in your browser tab. Additionally let's add &lt;code&gt;&amp;lt;h1&amp;gt;Random Joke Generator&amp;lt;/h1&amp;gt;&lt;/code&gt; inside the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;, followed by a &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; with &lt;code&gt;class="display"&lt;/code&gt; that will contain a &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;. Add an &lt;code&gt;id="displayJoke"&lt;/code&gt; to your &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;. This is where our jokes are going to be displayed when we add the JavaScript.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;Random Jokes&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
   &amp;lt;h1&amp;gt;Random Joke Generator&amp;lt;/h1&amp;gt;
   &amp;lt;div class="display"&amp;gt;
   &amp;lt;p id="displayJoke"&amp;gt;
     &amp;lt;!-- this is where jokes will display --&amp;gt;
   &amp;lt;/p&amp;gt;
   &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add another &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; with a &lt;code&gt;class="button-container"&lt;/code&gt; and put a &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; in it with a &lt;code&gt;class="button"&lt;/code&gt;. Give it text like this &lt;code&gt;&amp;lt;button class="button"&amp;gt;Get Joke&amp;lt;button&amp;gt;&lt;/code&gt; Before we forget, lets also link the CSS stylesheet in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; and link the JavaScript sheet by placing &lt;code&gt;&amp;lt;script src="scripts.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt; directly before the closing &lt;code&gt;&amp;lt;/body&amp;gt;&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;link rel="sylesheet" href="style.css"&amp;gt;
&amp;lt;title&amp;gt;Random Jokes&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
   &amp;lt;h1&amp;gt;Random Joke Generator&amp;lt;/h1&amp;gt;
   &amp;lt;div class="display"&amp;gt;
   &amp;lt;p id="displayJoke"&amp;gt;
     &amp;lt;!-- this is where jokes will display --&amp;gt;
   &amp;lt;/p&amp;gt;
   &amp;lt;/div&amp;gt;

   &amp;lt;div class="button-container"&amp;gt;
     &amp;lt;button class="button&amp;gt;Get Joke&amp;lt;/button&amp;gt;
   &amp;lt;/div&amp;gt;

   &amp;lt;script src="scripts.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When all put together in your editor it looks like this:&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%2Fi%2F8zlx0svb6e05zgaklvsy.png" 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%2Fi%2F8zlx0svb6e05zgaklvsy.png" title="HTML Structure" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Moving forward, we are going to jump straight into the JavaScript. This is because I want you to style the end product to make it your own! Don't fret, I'll still cover CSS at the end of the guide if you want to use it to build yours from. Without further ado, open up the scripts.js file. &lt;/p&gt;

&lt;p&gt;Lets grab the button using &lt;code&gt;querySelector()&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const onClick = document.querySelector("button");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we need to make the actual array that contains all the jokes! Feel free to use the one's provided in this guide or completely make it your own and snag jokes you'd prefer to use instead! Write the array as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const jokes = [
    "What rock group has four men that don't sing? Mount Rushmore.",
    "When I was a kid, my mother told me I could be anyone I wanted to be. Turns out, identity theft is a crime.",
    "What do sprinters eat before a race? Nothing, they fast!",
    "What concert costs just 45 cents? 50 Cent featuring Nickelback!",
    "What do you call a mac 'n' cheese that gets all up in your face? Too close for comfort food!",
    "Why couldn't the bicycle stand up by itself? It was two tired!",
    "Did you hear about the restaurant on the moon? Great food, no atmosphere!",
    "How many apples grow on a tree? All of them!",
    "Did you hear the rumor about butter? Well, I'm not going to spread it!",
    "I like telling Dad jokes. Sometimes he laughs!",
    "To whoever stole my copy of Microsoft Office, I will find you. You have my Word!"
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When making the array, be sure to use square brackets &lt;code&gt;[ ]&lt;/code&gt;to place the jokes in and separate each joke with a comma. &lt;/p&gt;

&lt;p&gt;Finally, it's time for the function that makes this whole things work!&lt;/p&gt;

&lt;p&gt;Let's make our custom function and call it getJoke.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function getJoke() {

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

&lt;/div&gt;



&lt;p&gt;We are going to use some math in the function to randomly select a joke from our array of jokes - well JavaScrpt will use the math - we're just gonna type some math. Each joke in our array is an index starting at zero. The number of indexes we have is determined by the length of our array (&lt;strong&gt;READ&lt;/strong&gt;: this is the number of jokes we have in the jokes array). &lt;/p&gt;

&lt;p&gt;We need to generate a random number between zero and the length of our jokes array. We are going to start with &lt;code&gt;Math.floor()&lt;/code&gt;. This will take a parameter and round it down to the nearest integer. An example is &lt;code&gt;Math.floor(7.9)&lt;/code&gt; will give you 7. So, if we give it &lt;code&gt;Math.random()&lt;/code&gt; (which generates random decimal between zero and one), we will have the first part of our math to generate a random number between zero and the length of our array complete. So let's write it out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let randomNumber = Math.floor(math.random();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is only half of the equation. This will always return zero because &lt;code&gt;Math.random()&lt;/code&gt; will always return a decimal between zero and one. With &lt;code&gt;Math.floor()&lt;/code&gt; it will always be rounded down to zero.&lt;/p&gt;

&lt;p&gt;Remember, we need random whole numbers in order to grab jokes from our array. We will achieve this by taking our &lt;code&gt;Math.random()&lt;/code&gt; number and multiplying it by a whole number. &lt;/p&gt;

&lt;p&gt;As an example, if we multiply &lt;code&gt;Math.floor(Math.random() * 10)&lt;/code&gt; for example it will always give us a number between 0 and 9. So how are we going to get it to always be a random number between zero and the number of jokes in our array? We are going to multiply &lt;code&gt;Math.random()&lt;/code&gt; by our array length using &lt;code&gt;jokes.length&lt;/code&gt;. So now we will have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let randomNumber = Math.floor(Math.random() * (jokes.length));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The math is done! We will now generate a random whole number between zero and the length of our jokes array. &lt;/p&gt;

&lt;p&gt;Next we're going to take that random number and pull a random joke from our array and put it in our index.html file so we can display it for the users to see. We are going to accomplish this using the &lt;code&gt;id="displayJoke"&lt;/code&gt; that we assigned to our &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So let's grab that &lt;code&gt;id&lt;/code&gt; to pass our joke string into.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;document.getElementById('displayJoke')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now use &lt;code&gt;.innerHTML&lt;/code&gt; to take a retrieved joke and add it to the HTML element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;document.getElementById('displayJoke').innerHTML = jokes[randcomNumber];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So now we have a full function that looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function getJoke() {
     let randomNumber = Math.floor(Math.random() * (jokes.length));
     document.getElementById('displayJoke').innerHTML = jokes[randomNumber];
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Almost done! Now we need to use &lt;code&gt;.addEventListener()&lt;/code&gt; to call our function when the user clicks on the Get Joke button.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;onClick.addEventListener("click", getJoke);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;ACTION&lt;/strong&gt;: Please check your file - right now your scripts.js file should look like this:&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%2Fi%2Famtn4tv4832c4tc5qfb9.png" 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%2Fi%2Famtn4tv4832c4tc5qfb9.png" title="JavaScript Setup" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As of right now we haven't touched our style.css sheet. This is where I encourage you to make this project your own. Style it to your heart's desire and link it in the comments below. You can now &lt;strong&gt;WOW&lt;/strong&gt; your friends and family with awesome jokes. &lt;/p&gt;

&lt;p&gt;If you need a base to start with, check out the quick styling below:&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%2Fi%2Fh71l8idbibr036j7sc0j.png" 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%2Fi%2Fh71l8idbibr036j7sc0j.png" title="CSS Setup" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we are simply resetting the browser margin and paddings and establishing border-box. We center up the &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; and style the text a bit. We'll take our &lt;code&gt;display&lt;/code&gt; class and keep it from allowing the &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; to push all the way to the edges of the screen. We will center our button using the &lt;code&gt;button-container&lt;/code&gt; class and then make the button look pretty with &lt;code&gt;button&lt;/code&gt; and &lt;code&gt;button:hover&lt;/code&gt; classes. &lt;/p&gt;

&lt;p&gt;Please, I encourage you to make this your own and see just how far you can push this joke generator. Again, feel free to link the results in the comments! &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>html</category>
      <category>css</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Modal Made Easy</title>
      <dc:creator>Thomas Fitzgerald</dc:creator>
      <pubDate>Thu, 01 Oct 2020 19:21:39 +0000</pubDate>
      <link>https://forem.com/fitzcodes/modal-made-easy-2i62</link>
      <guid>https://forem.com/fitzcodes/modal-made-easy-2i62</guid>
      <description>&lt;p&gt;I'm back again and sharing showing another feature I learned while working on my profile site; Modals! This is what the finished product will look like: &lt;/p&gt;

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

&lt;p&gt;Let's get started with the HTML structure.&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%2Fi%2Fq7spm6gober9mrbbe2hf.png" 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%2Fi%2Fq7spm6gober9mrbbe2hf.png" title="HTML Setup" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we have a simple &lt;code&gt;button&lt;/code&gt; that is used to activate the modal. We also have the modal container which becomes the actual modal and last, but not least, we have the content that goes inside the modal. &lt;/p&gt;

&lt;p&gt;Now it's given CSS to make it look good.&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%2Fi%2Fmsnnt72pk1gkyu07s930.png" 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%2Fi%2Fmsnnt72pk1gkyu07s930.png" title="CSS Setup" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can add as much style as you'd like and I encourage you to do so. I've left it clean and simple for the sake of this tutorial, but please showcase your skills and reply with a link.&lt;/p&gt;

&lt;p&gt;So, what have we actually done?&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;.modal&lt;/code&gt; class creates the overlay looking background color when it's activated. It needs to be the full width and height of the screen. Next, we are hiding it so it doesn't appear until we want it to. &lt;/p&gt;

&lt;p&gt;For &lt;code&gt;.the-content&lt;/code&gt; class we simply want to give the actual modal some visual cues and set it to the middle of the screen. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;.close-button&lt;/code&gt; and &lt;code&gt;.close-button:hover&lt;/code&gt; gives the user a clear way to close the modal when actions are complete. &lt;/p&gt;

&lt;p&gt;Lastly we need to add the &lt;code&gt;.active&lt;/code&gt; class. This functionality will be handled by a bit of JavaScript which will be added next. &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%2Fi%2Fwfxf5s6jkgyxnk5aw601.png" 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%2Fi%2Fwfxf5s6jkgyxnk5aw601.png" title="JavaScript Setup" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This bit of JavaScript is what makes the modal actually work. &lt;/p&gt;

&lt;p&gt;First we grab the modal, the button and close button and create a custom function that will toggle the &lt;code&gt;.active&lt;/code&gt; class. &lt;br&gt;
This allows us to activate the modal when the user clicks the button and hides the modal when the close button is clicked. We can also hide the modal by clicking on the dark background. &lt;/p&gt;

&lt;p&gt;That's it! Now you have a clean and simple modal with a smooth animation while opening and closing. Please comment with a link of your finished product. Thank you for bearing with me as I continue to teach what I've learned so far on my coding journey!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>html</category>
      <category>css</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Responsive Nav Menu</title>
      <dc:creator>Thomas Fitzgerald</dc:creator>
      <pubDate>Thu, 01 Oct 2020 02:13:12 +0000</pubDate>
      <link>https://forem.com/fitzcodes/responsive-nav-menu-4kc6</link>
      <guid>https://forem.com/fitzcodes/responsive-nav-menu-4kc6</guid>
      <description>&lt;p&gt;What's up! As I started building my personal profile site I wanted to have a simple responsive navigation menu. Not only had I never attempted this, but I was just barely starting to scratch the surface of basic JavaScript.&lt;/p&gt;

&lt;p&gt;Today I'm going to share what I learned during this process by re-creating a simple Flexbox Navigation Menu that is also responsive. The end result is a mobile first menu that will show the logo and a hamburger toggle; desktop view shows all the navigation menu items minus the hamburger toggle.&lt;/p&gt;

&lt;p&gt;To preview the end result, check out the final product over at my CodePen: &lt;a href="https://codepen.io/fitzwebdev/pen/OJNYKRj" rel="noopener noreferrer"&gt;Responsive Hamburger Menu&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;First, let's set up the basic html for the menu.&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%2Fres.cloudinary.com%2Fdefubnfko%2Fimage%2Fupload%2Fv1601503750%2FBlog%2520Posts%2FHTML_Setup_acx4zt.png" 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%2Fres.cloudinary.com%2Fdefubnfko%2Fimage%2Fupload%2Fv1601503750%2FBlog%2520Posts%2FHTML_Setup_acx4zt.png" title="Basic HTML Setup" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A few notes about the html set up. The "Services" navigation menu item has a &lt;code&gt;tabindex="0"&lt;/code&gt; attached to the &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; element. Do this because &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; tags that don't contain an &lt;code&gt;href&lt;/code&gt; attribute are omitted from the default tab order. The toggle uses a Font Awesome Icon, so you'll want to make sure to add &lt;code&gt;&amp;lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css"&amp;gt;&lt;/code&gt; to the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; section of your HTML document.&lt;/p&gt;

&lt;p&gt;Let's style this thing! Here's a quick basic styling in CSS to get us going. Feel free to use whatever you'd like.&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%2Fres.cloudinary.com%2Fdefubnfko%2Fimage%2Fupload%2Fv1601503628%2FBlog%2520Posts%2FBasic_CSS_Setup_ktgtyz.png" 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%2Fres.cloudinary.com%2Fdefubnfko%2Fimage%2Fupload%2Fv1601503628%2FBlog%2520Posts%2FBasic_CSS_Setup_ktgtyz.png" title="Basic CSS Setup" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since we are going for a mobile first menu, we are going to use Flexbox. With the menu closed, we want the logo and our menu toggle to sit next to each other at the top of the screen. One way we can do this is to ensure that the menu items span across the entire container. This way, Flexbox should display them stacked on each other. This will leave the logo and toggle at the top of the navigation menu side by side. Adding a bit more CSS to line thins up:&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%2Fres.cloudinary.com%2Fdefubnfko%2Fimage%2Fupload%2Fv1601503627%2FBlog%2520Posts%2FBasic_add_flexbox_zba2w2.png" 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%2Fres.cloudinary.com%2Fdefubnfko%2Fimage%2Fupload%2Fv1601503627%2FBlog%2520Posts%2FBasic_add_flexbox_zba2w2.png" title="Mobile Flexbox CSS Setup " alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What did we do? We hid the &lt;code&gt;.item&lt;/code&gt; elements and aligned the flex items vertically and the horizontally by using &lt;code&gt;justify-content&lt;/code&gt; and &lt;code&gt;align-items&lt;/code&gt;. We are going to have the hidden items only show when the user toggles the hamburger via the &lt;code&gt;.active&lt;/code&gt; class. We will use this by dynamically adding it with JavaScript. Next, we will also need to set up the drop down menu, which we will style with mobile in mind. &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%2Fres.cloudinary.com%2Fdefubnfko%2Fimage%2Fupload%2Fv1601503627%2FBlog%2520Posts%2FDrop_Down_Setup_ilwuve.png" 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%2Fres.cloudinary.com%2Fdefubnfko%2Fimage%2Fupload%2Fv1601503627%2FBlog%2520Posts%2FDrop_Down_Setup_ilwuve.png" title="Drop Down Menu CSS" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since we only want the drop down menu to be seen when the toggle menu is used we hide it with &lt;code&gt;display:none;&lt;/code&gt;. To let the user know there is a drop down menu, we used Font Awesome here in the CSS. Next lets add some functionality with JavaScript. Don't forget to add &lt;code&gt;&amp;lt;script src="scripts.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt; to the bottom of your html just before the &lt;code&gt;&amp;lt;/body&amp;gt;&lt;/code&gt; tag. &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%2Fres.cloudinary.com%2Fdefubnfko%2Fimage%2Fupload%2Fv1601503628%2FBlog%2520Posts%2FHamburger_Toggle_ki62f2.png" 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%2Fres.cloudinary.com%2Fdefubnfko%2Fimage%2Fupload%2Fv1601503628%2FBlog%2520Posts%2FHamburger_Toggle_ki62f2.png" title="Hamburger Toggle JavaScript" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using &lt;code&gt;querySelector()&lt;/code&gt;, we'll grab the menu and hamburger toggle and add a custom function which is called when the hamburger is clicked. Next up, we add the event listener to capture the click. Next let'ss get the drop down menu to work.&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%2Fres.cloudinary.com%2Fdefubnfko%2Fimage%2Fupload%2Fv1601503627%2FBlog%2520Posts%2FDrop_Down_Functionality_f4moac.png" 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%2Fres.cloudinary.com%2Fdefubnfko%2Fimage%2Fupload%2Fv1601503627%2FBlog%2520Posts%2FDrop_Down_Functionality_f4moac.png" title="Drop down JavaScript" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Grab all the menu items with &lt;code&gt;querySelectorAll()&lt;/code&gt;, then using a custom function we'll add and remove &lt;code&gt;.drop-down-menu-active&lt;/code&gt; to and from the clicked element. We finish it off with adding two event listeners for the drop down menu items. One for the click, and one for the keypress. Next we are going to make it easier for the user to exit the drop down menu when at the desktop view. &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%2Fres.cloudinary.com%2Fdefubnfko%2Fimage%2Fupload%2Fv1601503627%2FBlog%2520Posts%2FClose_Drop_Down_Any_Click_gorleh.png" 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%2Fres.cloudinary.com%2Fdefubnfko%2Fimage%2Fupload%2Fv1601503627%2FBlog%2520Posts%2FClose_Drop_Down_Any_Click_gorleh.png" title="Click Anywhere JavaScript" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we have that done, lets create the desktop menu.&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%2Fres.cloudinary.com%2Fdefubnfko%2Fimage%2Fupload%2Fv1601503627%2FBlog%2520Posts%2FDesktop_menu_rxwyzg.png" 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%2Fres.cloudinary.com%2Fdefubnfko%2Fimage%2Fupload%2Fv1601503627%2FBlog%2520Posts%2FDesktop_menu_rxwyzg.png" title="Desktop CSS" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we are at desktop size, it hides the toggle and repositions the drop down menu. &lt;/p&gt;

&lt;p&gt;And there you have it, you've now created a clean and simple responsive navigation menu for your website!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>html</category>
      <category>css</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Things to do EVERYDAY</title>
      <dc:creator>Thomas Fitzgerald</dc:creator>
      <pubDate>Wed, 26 Aug 2020 04:20:20 +0000</pubDate>
      <link>https://forem.com/fitzcodes/things-to-do-everyday-325c</link>
      <guid>https://forem.com/fitzcodes/things-to-do-everyday-325c</guid>
      <description>&lt;p&gt;As a relatively new developer taking advantage of a blessed opportunity (part of the current  #VetsWhoCode cohort), I’ve been soaking up every bit of wisdom I can. Of course I’m learning the technical side of coding as well, but that’s not what this post is about. The mentors of #VetsWhoCode are all very experienced and vastly knowledgeable developers. Even the alum are rockstars. Any new developer in the program would be whack to dismiss the advice given daily. &lt;/p&gt;

&lt;p&gt;Which brings me to the point of this post. The man who started it all, &lt;a class="mentioned-user" href="https://dev.to/jeromehardaway"&gt;@jeromehardaway&lt;/a&gt;
, has brought up one particular piece of advice several times already in the cohort. He simply calls it &lt;br&gt;
"Things to do everyday", and then shoots off a list of 10 items. Sometimes he’ll paste it in the slack chat. The second time he brought it up, I made sure to get it typed up. I decided that I was going to use every bit of advice I could to get my career on the right path and moving forward.&lt;/p&gt;

&lt;p&gt;The best thing about this advice is it applies to any developer, no matter what stage of their career. It is as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Make a schedule. - Easy enough. Before, I’d never get to anything because it was all in my head and I couldn’t decide what to get started on first. Now, I make tangible progress daily on what I need to do and accomplish. I simply follow my schedule. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make sure you schedule family time in it. - You are going to be busy. You are going to have your schedule to fit it all in. But what’s the point if you neglect your family and have no one to share it with. This is a mental thing as well. Must have balance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Focus on your core skill. - Focusing on being a JavaScript developer? Focusing on a different language? Focusing on being a marketing expert? Don’t chase after every new shiny thing, focus on your skill. Become that expert. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Expand how you market AND sell your core skill. - What are you doing to brand yourself? What are you doing to stand out against the next developer? Always look for opportunities to put yourself out there and be seen. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Build a community around your core skill. - Find others that share your skill and can learn from, as well as those who are learning your skill. Expand your circle and be seen as someone to look up to. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Read / Listen / Learn at least 45 minutes a day. - This is a must to build into your schedule. Since implementing this the stack of personal development books on my nightstand has started to shrink. Result? I’m doubling down on my learning and growth. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Execute on your goal at least 45 minutes a day. - This might appear to be redundant, but I can assure you it isn’t. Are you trying to start a business? Are you starting a non-profit? Have a personal project? This is where you make sure you are able to take measurable action on it daily. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Workout at least every other day. - Even if you don’t like exercise, this is a must. I don’t have enough room to go into all the benefits of just getting out there and moving your body. Yes, it will suck at first. Yes, your overall health (mental and physical) will thank you later. You’ll also be surprised at how much more productive you become. I’ve only recently made sure to implement it and the results are real. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Drink water. - You are made of it. You need it. It will help with your working out. You’ll feel a lot better drinking water throughout the day rather than soda or sports drinks. Again, feel better and increase productivity and overall well being. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stay positive, people who look up to you are watching. - Staying positive will open doors, it’s just a matter of time. You never know who you will inspire or what the results will be. Making sure I do this has turned what I previously viewed as roadblocks into insignificant parts of my day. In turn I’ve been able to get so much more done. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This may seem like a common sense list. But how many out there actually do or stick to it? What I can tell you is that a guy who is out there making real things happen in this community swears by it. You know where I want to be? I want to be out there making real things happen as well. &lt;/p&gt;

&lt;p&gt;I’ve only recently applied this to my life, but it sure is making an impact. Beginner status or Legendary, everyone can apply this list. The key? Do it EVERYDAY. &lt;/p&gt;

</description>
      <category>vetswhocode</category>
      <category>beginners</category>
      <category>productivity</category>
      <category>motivation</category>
    </item>
  </channel>
</rss>
