HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs 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 its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<!-- Portfolio page for freeCodeCamp
Must be able to:
1) Access entire page content just by scrolling.
-> using fixed height sections to allow scrolling and implement data-scroll
2) Clickable buttons that take visitors to social media pages (gitHub, linkedin, freecodecamp - don't want a link to facebook so leave that out)
-> They want buttons, so they get buttons. But typically links would be simpler and work just as well.
3) Thumbnail images of different projects (or placeholder images). Currently just have the tribute page and this page.
-> Using iframes to provide realtime previews of the webpages
-> Overlaying div's embedded in links so that iframe is clickable
4) Navigation bar with links that scroll to different parts in the page. Fixed bar on top or side.
-> Bootstrap framework using navbar and data-spy
TODO: Cleanup code; update and add pages; improve things a bit...
-->
<body data-spy="scroll" data-target=".navbar">
<nav class="navbar navbar-default navbar-fixed-top navbar-inverse" role="navigation" style="min-width:400px">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Philip's portfolio</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#projects">Projects</a></li>
</ul>
<div class="navbar-right row" style="position:absolute; top:0px; right:0px">
<div class="col-xs-4">
<button id="btn-github" type="button" class="btn btn-primary btn-block" style="height:50px" title="Click to go to my GitHub profile"><img class="img-responsive center-block" src="https://github.com/philipmey/freeCodeCamp/blob/master/GitHub-Mark-Light-32px.png?raw=true" alt="Link to my GitHub profile"/></button>
</div>
<div class="col-xs-4">
<button id="btn-linkedin" type="button" class="btn btn-primary btn-block" style="height:50px" title="Click to go to my LinkedIn profile"><img class="img-responsive center-block" src="https://github.com/philipmey/freeCodeCamp/blob/master/In-2C-34px-R.png?raw=true" alt="Link to my LinkedIn profile"/></button>
</div>
<div class="col-xs-4">
<button id="btn-freecodecamp" type="button" class="btn btn-primary btn-block" style="height:50px" title="Click to go to my FreeCodeCamp profile"><img class="img-responsive center-block" src="https://github.com/FreeCodeCamp/assets/blob/master/Logos%20and%20Covers/fcc-app-icon.png?raw=true" style="height:32px" alt="Link to my FreeCodeCamp profile" /></button>
</div>
</div>
</nav>
<div id="container">
<div id="home" class="page-section row">
<div class="col-xs-12">
<h1>Home</h1>
<h4 class="text-primary">Hello and welcome...</h4>
</div>
<div class="col-xs-2"></div>
<div class="col-xs-8"><img class="img-responsive" src="https://github.com/philipmey/freeCodeCamp/blob/master/antarctica.jpg?raw=true" alt="A picture of me when I was in Antarctica" width="500px" style="border-radius:5%" /></div>
</div>
<div class="col-xs-2"></div>
</div>
<div id="about" class="page-section row">
<div class="col-xs-2">
</div>
<div class="col-xs-6">
<h1>About</h1>
<h4 class="text-primary">A little bit of information about myself...</h4>
<p>I am an electronic (mostly) engineer sharpening up on my web development skills - hence the CodePen websites and following of FreeCodeCamp.</p>
<p>I am currently working as a project manager, so my time is not always my own and there is likely to be frequent gaps in my web development activity when my "real-world" job needs more attention.</p>
</div>
</div>
<div id="projects" class="page-section">
<div class="row">
<div class="col-xs-12">
<h1>Projects</h1>
<h4 class="text-primary">Here is a list of the projects (webpages) I have done so far. Click on the thumbnails to open a new window/tab to the relevant page.</h4>
</div>
</div>
<div class="row">
<!-- Thumbnail page-->
<div class="col-xs-4 thumbnail-clickable">
<iframe class="thumbnail" src="https://codepen.io/philipM/full/YWOkzw" frameborder="0"></iframe>
<!-- Create a div which is encapsulated in a link. i.e. Place an "invisible" div over the iframe to make the entire iframe clickable. The iframe provides a realtime preview of whatever webpage -->
<a href="https://codepen.io/philipM/full/YWOkzw" target="_blank">
<div class="link-overlay"></div>
</a>
<div class="description-overlay">
<p>Simon says... Features 20 levels with increasing speed and an optional strict mode. Basic sequencing (asynchronous requests) performed. But need to look more into jQuery Deferred.</p>
</div>
</div> <!-- Thumbnail page-->
<!-- Thumbnail page-->
<div class="col-xs-4 thumbnail-clickable">
<iframe class="thumbnail" src="https://codepen.io/philipM/full/jAYOvW" frameborder="0"></iframe>
<!-- Create a div which is encapsulated in a link. i.e. Place an "invisible" div over the iframe to make the entire iframe clickable. The iframe provides a realtime preview of whatever webpage -->
<a href="https://codepen.io/philipM/full/jAYOvW" target="_blank">
<div class="link-overlay"></div>
</a>
<div class="description-overlay">
<p>An unbeatable game of Tic Tac Toe for FreeCodeCamp. Some algorithm scripting.</p>
</div>
</div> <!-- Thumbnail page-->
<!-- Thumbnail page-->
<div class="col-xs-4 thumbnail-clickable">
<iframe class="thumbnail" src="https://codepen.io/philipM/full/yJPgza" frameborder="0"></iframe>
<!-- Create a div which is encapsulated in a link. i.e. Place an "invisible" div over the iframe to make the entire iframe clickable. The iframe provides a realtime preview of whatever webpage -->
<a href="https://codepen.io/philipM/full/yJPgza" target="_blank">
<div class="link-overlay"></div>
</a>
<div class="description-overlay">
<p>A Pomodora clock for FreeCodeCamp exercise.</p>
</div>
</div> <!-- Thumbnail page-->
</div>
<div class="row">
<!-- Thumbnail page-->
<div class="col-xs-4 thumbnail-clickable">
<iframe class="thumbnail" src="https://codepen.io/philipM/full/YWAKvL" frameborder="0"></iframe>
<!-- Create a div which is encapsulated in a link. i.e. Place an "invisible" div over the iframe to make the entire iframe clickable. The iframe provides a realtime preview of whatever webpage -->
<a href="https://codepen.io/philipM/full/YWAKvL" target="_blank">
<div class="link-overlay"></div>
</a>
<div class="description-overlay">
<p>A simple javascript calculator.</p>
</div>
</div> <!-- Thumbnail page-->
<!-- Thumbnail page-->
<div class="col-xs-4 thumbnail-clickable">
<iframe class="thumbnail" src="https://codepen.io/philipM/full/NrpoOd" frameborder="0"></iframe>
<!-- Create a div which is encapsulated in a link. i.e. Place an "invisible" div over the iframe to make the entire iframe clickable. The iframe provides a realtime preview of whatever webpage -->
<a href="https://codepen.io/philipM/full/NrpoOd" target="_blank">
<div class="link-overlay"></div>
</a>
<div class="description-overlay">
<p>Interfacing with the TwitchTV API. I personally do not like the TwitchTV API capabilities and therefore implemented minimum functionality.</p>
</div>
</div> <!-- Thumbnail page-->
<!-- Thumbnail page-->
<div class="col-xs-4 thumbnail-clickable">
<iframe class="thumbnail" src="https://codepen.io/philipM/full/dXNGBr" frameborder="0"></iframe>
<!-- Create a div which is encapsulated in a link. i.e. Place an "invisible" div over the iframe to make the entire iframe clickable. The iframe provides a realtime preview of whatever webpage -->
<a href="https://codepen.io/philipM/full/dXNGBr" target="_blank">
<div class="link-overlay"></div>
</a>
<div class="description-overlay">
<p>A wikipedia article search page. You can search for a word or phrase and get a short description and a link to the full article.</p>
</div>
</div> <!-- Thumbnail page-->
</div> <!-- Row -->
<div class='row'>
<!-- Thumbnail page-->
<div class="col-xs-4 thumbnail-clickable">
<iframe class="thumbnail" src="https://codepen.io/philipM/full/pbNzyL" frameborder="0"></iframe>
<!-- Create a div which is encapsulated in a link. i.e. Place an "invisible" div over the iframe to make the entire iframe clickable. The iframe provides a realtime preview of whatever webpage -->
<a href="https://codepen.io/philipM/full/pbNzyL" target="_blank">
<div class="link-overlay"></div>
</a>
<div class="description-overlay">
<p>My local weather page for freeCodeCamp. Accesses to API's (weather and location) and delivers local weather based on the user's IP. Because of safety features with Google Chrome, the navigator.geolocation does not work with an HTTP page, but HTTPS is not catered for by the API's I used.</p>
</div>
</div> <!-- Thumbnail page-->
<!-- Thumbnail page-->
<div class="col-xs-4 thumbnail-clickable">
<iframe class="thumbnail" src="https://codepen.io/philipM/full/vKKwpm" frameborder="0"></iframe>
<!-- Create a div which is encapsulated in a link. i.e. Place an "invisible" div over the iframe to make the entire iframe clickable. The iframe provides a realtime preview of whatever webpage -->
<a href="https://codepen.io/philipM/full/vKKwpm" target="_blank">
<div class="link-overlay"></div>
</a>
<div class="description-overlay">
<p>My Random Quotes page for freeCodeCamp. Uses some animation (and edited animation) effects, a tweet button as well as JSONP across websites.</p>
</div>
</div> <!-- Thumbnail page-->
<!-- Thumbnail page-->
<div class="col-xs-4 thumbnail-clickable">
<iframe class="thumbnail" src="https://codepen.io/philipM/full/OXMZoz" frameborder="0"></iframe>
<!-- Create a div which is encapsulated in a link. i.e. Place an "invisible" div over the iframe to make the entire iframe clickable. The iframe provides a realtime preview of whatever webpage -->
<a href="https://codepen.io/philipM/full/OXMZoz" target="_blank">
<div class="link-overlay"></div>
</a>
<div class="description-overlay">
<p>This is a thumbnail of the page you are currently viewing. It mostly covers the bootstrap navbar and overlaying clickable divisions on top of iframes.</p>
</div>
</div> <!-- Thumbnail page-->
</div> <!-- Row -->
<div class="row">
<!-- Thumbnail page-->
<div class="col-xs-4 thumbnail-clickable">
<iframe class="thumbnail" src="https://codepen.io/philipM/full/WwaaaM" frameborder="0"></iframe>
<!-- Create a div which is encapsulated in a link. i.e. Place an "invisible" div over the iframe to make the entire iframe clickable. The iframe provides a realtime preview of whatever webpage -->
<a href="https://codepen.io/philipM/full/WwaaaM" target="_blank">
<div class="link-overlay"></div>
</a>
<div class="description-overlay">
<p>My tribute page to Mr Money Mustache. It was the first page I made in FreeCodeCamp and features clickable links.</p>
</div>
</div> <!-- Thumbnail page-->
</div>
</div>
</div>
</body>
.navbar-collapse.collapse{
display: block!important;
}
.navbar-nav>li, .navbar-nav {
float: left !important;
}
.navbar-nav.navbar-right:last-child {
margin-right: -15px !important;
}
.navbar-right {
float: right!important;
}
body {
background-color:silver;
}
h1 {
color:black;
}
#about {
background-color: #F5F5F5;
height:350px;
}
#home {
background-color: orange;
}
#projects {
background-color: silver;
}
#btn-github:hover {
background-color: black;
border-color: black;
}
#btn-linkedin:hover {
background-color: black;
border-color: black;
}
#btn-freecodecamp:hover {
background-color: black;
border-color:black;
}
.link-overlay{
width:100%;
height:100%;
position:absolute;
top:0;
left:0;
display:block;
z-index:5;
}
.description-overlay{
width:320px;
position:absolute;
top:250px;
left:20;
display:block;
z-index:4;
background-color:#DBDBDB;
}
.thumbnail-clickable
{
overflow: hidden;
background-color:silver;
width:340px;
height:400px;
margin:5px;
}
.thumbnail{
-ms-zoom: 0.4;
-moz-transform: scale(0.4);
-moz-transform-origin: 0 0;
-o-transform: scale(0.4);
-o-transform-origin: 0 0;
-webkit-transform: scale(0.4);
-webkit-transform-origin: 0 0;
width:800px;
height:600px;
position:relative;
overflow:hidden;
z-index:1;
}
.page-section {
height: 1000px;
padding-top: 50px;
}
$(document).ready(function(){
// Code to open github profile page
$("#btn-github").click(function(){
window.open('https://github.com/philipmey')
});
// Code to open linkedIn profile page
$("#btn-linkedin").click(function(){
window.open('https://za.linkedin.com/in/philip-mey-825447104')
});
// Code to open freecodecamp profile page
$("#btn-freecodecamp").click(function(){
window.open('https://www.freecodecamp.com/fccf0d44b75')
});
});
Also see: Tab Triggers