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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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

              
                 <body class='themeFive'>

<div class="backgroundImage"></div>
<div class="backgroundOverlay"></div>

  <nav id="navbar">

  	<header>FCC Project Documentation</header>
  <!-- here's some update-->
  	<div>
	  	<a href="#Random_Quote_Machine" class="nav-link">Random Quote Machine</a>
	  	<div class="nav-space"></div>
	  	<a href="#Markdown_Editor" class="nav-link">Markdown Editor</a>
	  	<div class="nav-space"></div>
	  	<a href="#Drum_Machine" class="nav-link">Drum Machine</a>
	  	<div class="nav-space"></div>
	  	<a href="#Pomodoro_Clock" class="nav-link">Pomodoro Clock</a>
	  	<div class="nav-space"></div>
	  	<a href="#Calculator" class="nav-link">Calculator</a>
	</div>
  </nav>


<main class="outerDiv "  id="main-doc">

		<section class="main-section" id="Random_Quote_Machine">
			<header>Random Quote Machine</header>
			<p>This was the first project for the Front End Libraries certification. The work is pretty simple. I only had to find an API that was accessable over CORS. I elected not to use Redux for any state management. </p>
			<p>As first projects go, the experience was good. I had a bit of work figuring out how to use jQuery to do an async api call. I never did get into promises, which is work for future projects. I also began to stratch the surface with Bootstrap though not to any significant degree. </p>
			<p>What follows is the first Mixin I wrote. It's very basic and I find that I don't use it anymore, probably because I've not had any problems with border raidus across browsers yet. </p>
			<pre><code>
@mixin border-radius($x){ 
  -webkit-border-radius: $x;
  -moz-border-radius: $x;
  -ms-border-radius: $x;
  border-radius: $x;
}

</code></pre>
  			<p>The technology list employed in this project includes:</p>
			<ul>
				<li>HTML5</li>
				<li>CSS and SCSS</li>
				<li>ES6</li>
				<li>React</li>
			</ul>
		</section>
		<section class="main-section" id="Markdown_Editor">
			<header>Markdown Editor</header>
			<p>This was my second project along the road to Front End Library certification. My understanding of React was expanded greatly in this project and it's where I built my first reusable component with my Windowing capabilities. </p>
			<p>Initially I just used the React state management for most of the interactivity, but re-engineered the project to use Redux after the Drum Machine project. </p>	
			<p>The most interesting parts of the project actually came during the re-engineering effort. It was during this period that I extracted out the expand/shrink fucntions out of CSS and moved it into the Redux state machine cycle. I had the idea that I could dispatch an event on one window that all windows would observe, then pass a state object that either expands the window or hides the window (when maximizing), or puts all the windows back to the orignial state. </p>
			<pre><code>WindowComponent = connect(
  function mapStateToProps(state, ownProps){

    let fullSize = state.windows[ownProps.id].fullSize;
    let styleClass = "";

    if(!state.windows.fullSize){
      styleClass = "window col-md-" + state.windows[ownProps.id].width
    }else{
      if(fullSize){
        styleClass = "window col-md-12"
      }else{
        styleClass = "window windowHide"
      }
    }

    let toReturn = {
      width: state.windows[ownProps.id].width,
      fullSize: fullSize,
      styleClass: styleClass
    }
    return toReturn
  },
  function mapDispatchToProps(dispatch){
    return{
      resizeWindow: (id, width) => {
        dispatch(createResizeAction(id, width))
      }
    }
  }, null,  {forwardRef: true}
)(WindowComponent)

</code></pre>
		</section>
		<section class="main-section" id="Drum_Machine">
			<header>Drum Machine</header>
			<p>paragraph 1</p>
			<p>paragraph 2</p>
			<code>code section</code>
			<ul><li>list element</li></ul>
		</section>
		<section class="main-section" id="Pomodoro_Clock">
			<header>Pomodoro Clock</header>
			<p>At this point I still hadn't implented any state managment with Redux. I struggled to understand the API and the information within the course work was so bare bones that it really just pointed in a direction and expected me to go and do further research. </p>
			<p>I set about to pick up the pieces I had been ignoring in the previsous projects. It was in this phase when the API finally clicked for me. I think it finally clicked for me when I was reading on Higher Order Compoents (HOC) as it relates to currying and all of a sudden the React.Component.connect method made sense to me. It was the result of this that I was able to use the connect method to create HOCs that I could configure through the state object. Below is an example of one such HOC. </p>
			<pre><code>
const TimingButton = (props)=>{
  let className = "fa-"+props.label+"-circle"
  return(
    &lt;button className="button lengthButton " 
      id={props.name} 
      disabled={props.timing} 
      onClick={props.action}&gt;
      &lt;i className={"fas " + className}&gt;&lt;/i&gt;
    &lt;/button&gt;
  )}; 

const SessionDecrementButton = connect(
  state =>({timing: state.timing, label: "minus"}),
  dispatch => ({action: () =>  { dispatch({type:DEC_SESSION})}})
)(TimingButton)

const SessionIncrementButton = connect(
  state =>({timing: state.timing, label: "plus"}),
  dispatch => ({action: () =>  { dispatch({type:INC_SESSION})}})
)(TimingButton)

</code></pre>
			<p>As you can see the TimingButton is wrapped by the HOC generated by the connect function which ties a specific dispatch to the clicking of the button. </p>
			<p>as well as optimizing the my Component connections to Redux to minimize component updates.  </p>
			
			<ul><li>list element</li></ul>
		</section>
		<section class="main-section" id="Calculator">
			<header>Calculator</header>
			<p>paragraph 1</p>
			<p>paragraph 2</p>
			<code>code section</code>
			<ul><li>list element</li></ul>
		</section>

</main>
</body>
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<script>
	window.onload = () => {
		document.getElementById("main-doc").scrollTo(1,1);
	}
</script>
<link rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
              
            
!

CSS

              
                body,
html {

  margin: 0px;
  height: 100%;
  font-family: "Raleway", sans-serif;
  touch-action: manipulation;
  
  font-family: 'Open Sans', sans-serif;
  overflow: hidden;
}


.backgroundImage {

	height: 100%;
	width: 100%;
	position: fixed;
	top: 0;
	left: 0;
	z-index: -3;

}
.backgroundOverlay {
	height: 100%;
	width: 100%;
	position: fixed;
	top: 0;
	left: 0;

	
	z-index: -2;
}

nav {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	flex-direction: column;


	z-index: 10;


	background-color: white;

	color: var(--shade1);

}

header {
	font-size: 30px;
}
nav >  header {

	padding-left: 45px;
}

nav > div {
	overflow-x: scroll;
	height: 100px;

	border-radius: 10px;
	padding-left: 15px;
	padding-right: 15px;
	margin-right: 2px;
	margin-left: 2px;
	font-size: 18pt;

	box-shadow: inset 0 0 5px rgba(0, 0, 0, .8);
	line-height: 2.1em
}
nav > div > a{
	color: var(--shade1);
	text-decoration: none;
}

nav > div > a:hover {
	color: rgba(255, 255, 255, .3);
}
.nav-space {
	height: 2px;
	width: 100%;
	align-self: center;
	background-color: var(--shade1);
	
}

.outerDiv {
	height: calc(99% - 150px);
	margin: 150px 5px 2px 5px ;
	overflow-x: scroll;
	padding-left: .5em;
	padding-right: .5em;
	background-color: var(--background1);
}

.outerDiv header {
	color: var(--shade2);

}

.outerDiv p {
	font-size: 20px;
}

.outerDiv code {
	background-color: var(--background2);

	display: block;
	padding: 2px 5px 2px 5px;
	border: 1px solid rgba(0, 0, 0, .2);
}

.outerDiv li {

}


.formContainer {
  background:rgba(255,255,255,0.8);
  font-size: 1.5em;
  color: var(--textShade);
}


@media (min-width: 818px){

	.outerDiv {
		height: 100%;
		margin: 2px 5px 2px 300px;
	}

	nav{
		right: auto;
		width: 290px;
		height: 100%;
		padding-left: 5px;
	}
	nav > header {
		padding-left: 5px;
		margin-top: 33px;
	}
	nav > div {
		height: auto;
		font-size: 20px;
		box-shadow: none;
	}



}
.themeOne {
    --shade1: #f4f1af;
    --shade2: #e7e283;
    --shade3: #dbd55b;
    --shade4: #dedede;
    --textShade: #385a6e;
}

.themeFour {
  --shade1: #e6e6e6;
  --shade2: #dedede;
  --shade3: #d1d1d1;
  --shade4: #c7c7c7;
   --grey1: #dedede;
}

.themeFive {
	  --shade1: #466b8c;
  --shade2: #8c5f46;
  --shade3: #8c8346;
  --shade4: #79468c;
   --background1: #dedede;
   --background2: #f4f1af;
}
}

              
            
!

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