Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>


<!-- 

Hello Camper!

For now, the test suite only works in Chrome! Please read the README below in the JS Editor before beginning. Feel free to delete this message once you have read it. Good luck and Happy Coding! 

- The freeCodeCamp Team 

-->
<div class="flex-wrapper">
<nav id="navbar">
  <header>Topics</header>
    <a href="#Deploy_Static_Site" class="nav-link">Deploy Static Site</a>
  <a href="#Query_String_Parameters" class="nav-link">Query String Parameters</a>
  <a href="#Restarting_Node_Server" class="nav-link">Restarting Node Server</a>
  <a href="#SSH_Keys_In_Github" class="nav-link">SSH Keys In Github</a>
  <a href="#Split_JavaScript_Array" class="nav-link">Split JavaScript Array</a>
</nav>
<main id="main-doc">
  <section id="Deploy_Static_Site" class="main-section">
    <header>Deploy Static Site</header>
    <p>You finally figured out how to code your own static site from scratch, or hell maybe you swiped some free template from the Internet and customized it yourself. You want to use a custom domain you purchased already from NameCheap.com, now you just need to figure out how to deploy your new site for all to see on the Internet.</p>
    <p>The cheapest and easiest way that I've found is by using Netlify.com.</p>
    <p>They have a free option that allows the use of a custom domain. You also get SSL for your website by default via LetsEncrypt. Also, they have a really cool feature called "Continuous Deployment".</p>
    <p>This means that all you have to do is sync with your website's Github Repo and every time you update your site and make a git commit to your Github Repo via your terminal, it'll automatically update your website with the changes.</p>
    <code>$ git push origin master</code>
    <li>Once you learn Git, you'll wonder how you got by without it. It's truly a lifesaver.</li>
  </section>
  <hr>
  <section id="Query_String_Parameters" class="main-section">
    <header>Query String Parameters</header>
    <p>I recently was tasked at work to automatically grab some query string parameters on page load insert as hidden field data into a form to be submitted along with other info when the user submits the form.</p>
    <p>The query string parameter data is sent along with the user info to the CRM for offline sales conversion tracking.</p>
    <p>I ran across this code written by Travis Horn and so graciously gifted via this Github repo. It helps you to turn the query string parameter data into a JavaScript object, which makes it rather easy to work with and I only had to write these 3 lines of code to implement after importing the files from the Github repo:</p>
    <code>const qstring = qs.get();
const gclid = qstring.gclid;
document.getElementById("gclidInput").value = gclid;</code>
    <li>After my programming buddy looked at what I did though, considering I only needed the 'gclid' query string parameter, I could've accomplished the same with less code by just using the Location Search Property of the Location Object.</li>
  </section>
  <hr>
  <section id="Restarting_Node_Server" class="main-section">
    <header>Restarting Node Server</header>
    <p>I'm no seasoned Node.js veteran and there's a lot of things I don't know still but one of the first problems or annoyance I had when first playing around with Node.js is having to restart the server everytime I made code changes to a file in order to see the changes live in the browser.</p>
    <p>Fortunately there's an easy fix for this if you haven't already discovered it via Google search; Nodemon! Which is easily installed using npm:</p>
    <code># npm instal -g nodemon</code>
    <li>Now go forth and start being more productive!</li>
  </section>
  <hr>
  <section id="SSH_Keys_In_Github" class="main-section">
    <header>SSH Keys In Github</header>
    <p>I remember this driving me nuts. I added my SSH keys to Github like I'm instructed to do, yet when I try to push a commit to my Github repository it asks me for my password; Arggghh!</p>
    <p>For some reason this happens periodically, I can't tell you the exact reason why at this time, but I can tell you command you need to type into your terminal to fix the issue.</p>
    <code>$ ssh-add</code>
    <li>Type the above bash command in your Terminal (for MacOSX)</li>
  </section>
  <hr>
  <section id="Split_JavaScript_Array" class="main-section">
    <header>Split JavaScript Array</header>
    <p>I was struggling with this FreeCodeCamp lesson/exercise and I ended up finding the solution here on StackOverFlow:</p>
    
    <code>function chunkArrayInGroups(arr, size) {
	var result = [];
    while (arr.length > size) {
        result.push(arr.splice(0, size));
    }
    if (arr.length)
        result.push(arr);
   
  return result;
}

chunkArrayInGroups(["a", "b", "c", "d"], 2);
</code>
    <p>Alright that's it! This fake technical doc is for a FCC project!</p>
    <li>I hope you liked it!</li>
  </section>
</main>
</div>
              
            
!

CSS

              
                
html {
  font-family: 'Montserrat', sans-serif;

}

#navbar {
  position: fixed;
  min-width: 150px;
  padding: 50px 0 0 40px;
  top: 0px;
  left: 0px;
  width: 250px;
  height: 100%;
  border-right: solid;
  border-color: rgba(0,18,15,0.8)
}

#navbar a {
  display: block;
  margin: 7px 0 0 2px;
  text-decoration: none;
}

.flex-wrapper {
  display: flex;
  flex-direction: row;
}

main {
  padding: 40px 80px 40px 350px;
  width: 800px;
}

/* Shared */
#navbar header {
  padding: 10px;
  font-size: 25px;
}

#navbar a {
  padding: 8px 0 0 12px;
}

.main-section  {
  padding: 10px 0 20px 0
}

.main-section header {
  font-size: 25px;
}

section p {
  text-align: justify;
}

a, p, li, code {
  padding: 10px 0 0 0;
}

@media (max-width: 1000px) { 
  
  #navbar {
  position: relative;
  border: none;
}

main {
  padding: 50px 50px 30px 0;
  margin-left: 50px;
  margin-right: 50px;
  width: 80vw;
}
  .flex-wrapper {
  display: flex;
  flex-direction: column;
}
}
              
            
!

JS

              
                // !! IMPORTANT README:

// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place. 

/***********
INSTRUCTIONS:
  - Select the project you would 
    like to complete from the dropdown 
    menu.
  - Click the "RUN TESTS" button to
    run the tests against the blank 
    pen.
  - Click the "TESTS" button to see 
    the individual test cases. 
    (should all be failing at first)
  - Start coding! As you fulfill each
    test case, you will see them go   
    from red to green.
  - As you start to build out your 
    project, when tests are failing, 
    you should get helpful errors 
    along the way!
    ************/

// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!

// Once you have read the above messages, you can delete all comments. 

              
            
!
999px

Console