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.
html
body
// NAVBAR
.navbar-wrapper
.container
nav.navbar.navbar-default.navbar-fixed-top
.container
.navbar-header
button.navbar-toggle.collapsed(type='button', data-toggle='collapse', data-target='#navbar', aria-expanded='false', aria-controls='navbar')
span.sr-only Toggle navigation
span.icon-bar
span.icon-bar
span.icon-bar
// a.navbar-brand.skewed(href='#') Portfolio
#navbar.navbar-collapse.collapse
ul.nav.navbar-nav.navbar-right
li.skewed
a(href='#landing') Home
li.skewed
a(href='#about') About
li.skewed
a(href='#works') Works
li.skewed
a(href='#contact') Contact
// SECTION: LANDING
section.component.parallax.image-dark-red-a(id="landing")
.container-fluid
.row
.col-md-8.col-md-offset-4.col-lg-6.col-lg-offset-5
h2.p-t-175.text-right The Portfolio of Matt D.
p.text-right The greatest successes, most brilliant failures.
// SECTION: ABOUT
section.component.bg-darkest-gray(id='about')
.container
.row
.col-md-8.col-md-offset-2.text-center
h2 About Me
h5 I'm currently harnessing my non-existent super powers to transform myself into a developer extradonaire.
i.fa.fa-power-off.fa-3x
h3 Super Powers
p As noted above, those skills are currently in progress so I won't bore you with the details or embarass myself. However if you check back at a later date, you might, just might stumble across something new!
// SECTION: WORKS
section.component.parallax.image-dark-red-b(id='works')
.container
.row
.col-md-12
h2.text-center The Works
.row
.col-md-4
.card-header Resident Evil 642
.card
img(class="img-responsive" src="http://www.twinfinite.net/wp-content/uploads/2015/03/312122.jpg" alt="Image of two characters from Resident Evil game, with some other people in the background.")
.col-md-4
.card-header Pokemon: A Horror Story
.card
img(class="img-responsive" src="http://i.ytimg.com/vi/CRI3RnrisVA/maxresdefault.jpg" alt="Image of an evil, undead looking Pokemon character")
.col-md-4
.card-header Final Fantasy 249
.card
img(class="img-responsive" src="http://199.101.98.242/media/images/157749-Dissidia_-_Final_Fantasy_(USA)-3.jpg" alt="Image of Cloud from Final Fantasy, holding his sword, with feathers falling around him and a city in the background")
.row.p-t-40
.col-md-4
.card-header Leia vs. Lara Croft
.card
img(class="img-responsive" src="http://www.androidcentral.com/sites/androidcentral.com/files/styles/larger/public/article_images/2015/04/lara-croft-relic-run.jpg?itok=Tv90jXyA" alt="Image of Lara Croft in a jungle, diving over a log with gun in hand, with a dinosaur after her.")
.col-md-4
.card-header Cthulhu: Man's Best Friend
.card
img(class="img-responsive" src="http://images.alphacoders.com/509/509983.jpg" alt="Image of Cthulu emerging from a massive structure the he somewhat blends into.")
.col-md-4
.card-header He-Man vs. Han Solo
.card
img(class="img-responsive" src="https://cdn.3news.co.nz/3news/AM/2013/10/22/318193/he-man1.jpg" alt="Image of He-Man holding his sword up, his companions surrounding him.")
// SECTION: CONTACT
section.component.bg-darkest-gray(id='contact')
.container
.row
.col-md-8.col-md-offset-2.text-center
h2 Contact Me
h5 I would love to put all of my personal information on the Internet but something tells me that is a bad idea.
i.fa.fa-phone.fa-3x
h3 By Phone
p Did you really believe the fancy phone icon above would open up your dialer? There might be a hidden div in the page that exposes this information, go on, look for it! I'll be expecting a call.
// SECTION: EXTRAS
section.component.parallax.landing.image-dark-red-c(id="extras")
.container
.row
.col-md-12
h2.text-center Extras
p.text-center This area is under construction, check back later!
// SECTION: FOOTER
section.component.bg-darkest-gray(id='footer')
.container
.row
.col-md-4
h2 Credits Due
p I take no credit for the images on this page. All images may be subject to copyright.
p Material design images done by DaKoder.
span
a(href="http://dakoder.deviantart.com/" target="_blank") http://dakoder.deviantart.com/
.col-md-3.col-md-offset-1
h2 This Page
p This page was created for educational use only.
p All works are purely fictional.
.col-md-2.col-md-offset-1
h2 Social
a.fa-stack.fa-lg(href="#")
i.fa.fa-square-o.fa-stack-2x
i.fa.fa-linkedin.fa-stack-1x
a.fa-stack.fa-lg(href="#")
i.fa.fa-square-o.fa-stack-2x
i.fa.fa-google.fa-stack-1x
a.fa-stack.fa-lg(href="#")
i.fa.fa-square-o.fa-stack-2x
i.fa.fa-facebook.fa-stack-1x
a.fa-stack.fa-lg(href="#")
i.fa.fa-square-o.fa-stack-2x
i.fa.fa-twitter.fa-stack-1x
p.copyright © 2015 Dephora
/*---------------------------------------------------
[Table of Contents]
1. Global UI
1a. Variables: Colors
1b. Styles: Colors
1c. Box-Sizing
1d. Components
i. Cards
1e. Navbar
2. Section Styles
2a. Global Section Styles
2b. Section: Landing
2c. Section: About
2d. Section: Works
2e. Section: Contact
2f. Section: Extras
2g. Footer
3. Backgrounds
4. Responsive
5. Notes
---------------------------------------------------*/
/****************************************************/
/* GLOBAL UI*/
/****************************************************/
@import url(https://fonts.googleapis.com/css?family=Raleway:100,200,300,400,500,600,700,800,900);
@import url(https://fonts.googleapis.com/css?family=Dosis:100,200,300,400,500,600,700,800,900);
html {
}
body {
font-family: 'Raleway', serif;
font-size: 1.4em;
}
/************** VARIABLES: COLORS **************/
$theme-gray: #bebebe;
$matching-blue: rgb(60, 213, 233);
$mostly-white: rgba(255, 255, 255, .95);
$darkest-gray: rgb(47,47, 47);
$primary-red: #E9503C;
$yellow: #F1F059;
$primary-blue: #2196f3;
$dark-blue: #1976d2;
$light-blue: #bbdefb;
$lime: #E4E948;
$semi-white: rgba(255, 255, 255, .7);
$red: rgba(255, 56, 56, .8);
$mint: #CBF0E9;
$skyblue: #04B9D3;
$brightblue: #80FDF9;
$greenblue: #04A0B9;
$greenblue-text: rgba(0, 104, 116, .9);
$mat-dark-primary: rgba(0, 0, 0, .87);
$mat-dark-primary-light: rgba(0, 0, 0, .7);
$mat-dark-secondary: rgba(0, 0, 0, .54);
$darkgray: #333;
$darkcyan: #111617;
$darkgray-on-red: #2a2a2a;
/************** STYLES: COLORS **************/
.bg-darkest-gray {
background-color: $darkest-gray;
}
.bg-darkcyan {
background-color: $darkcyan;
}
.bg-mint {
background-color: $mint;
}
.bg-greenblue {
background-color: $greenblue;
}
.bg-skyblue {
background-color: $skyblue;
}
.bg-brightblue {
background-color: $brightblue;
}
/************** BOX-SIZING **************/
.p-t-40 {
padding-top: 40px;
}
.p-t-100 {
padding-top: 100px;
}
.p-t-175 {
padding-top: 175px;
}
.p-t-200 {
padding-top: 200px;
}
.p-t-225 {
padding-top: 2250px;
}
.p-b-40 {
padding-bottom: 40px;
}
.p-b-50 {
padding-bottom: 50px;
}
.p-b-75 {
padding-bottom: 750px;
}
.p-b-100 {
padding-bottom: 100px;
}
.p-b-115 {
padding-bottom: 115px;
}
.p-l-65 {
padding-left: 65px;
}
.p-l-115 {
padding-left: 115px;
}
.p-r-50 {
padding-right: 50px;
}
.p-r-80 {
padding-right: 80px;
}
.p-r-100 {
padding-right: 100px;
}
/************** COMPONENTS **************/
/***** CARDS ****/
.card {
background: rgba(0, 0, 0, .7);
position: relative;
border-radius: 2px;
height: 540px;
width: 100%;
box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
}
.card-header {
background-color: $primary-red;
color: $darkgray-on-red;
border-radius: 2px;
height: 50px;
position: relative;
width: 100%;
margin-bottom: 5px;
text-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
padding: 8px 0;
font-size: 1.5em;
font-weight: 400;
text-align: center;
box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
}
.card img {
height: 100%;
}
/************** NAVBAR **************/
/* Special class on .container surrounding .navbar, used for positioning it into place. */
.navbar-wrapper {
position: absolute;
top: 0;
/* right: 0; */
/* left: 0; */
z-index: 20;
}
/* Flip around the padding for proper display in narrow viewports */
.navbar-wrapper > .container {
padding-right: 0;
padding-left: 0;
}
.navbar-wrapper .navbar {
padding-right: 45px;
padding-left: 15px;
}
.navbar-wrapper .navbar .container {
width: auto;
/* margin-right: 30px; */
/* margin-left: 30px; */
}
nav.navbar {
font-size: 1.1em;
}
.navbar.navbar-default {
background-color: transparent;
border-color: transparent;
}
.navbar.navbar-default a.navbar-brand.skewed {
margin-right: 5px;
margin-left: 5px;
height: 50px;
transform: skew(318deg);
background: #E7ED49;
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
}
.navbar-nav>li.skewed {
margin-right: 5px;
margin-left: 5px;
height: 50px;
transform: skew(318deg);
background: $primary-red;
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
}
.navbar-default .navbar-nav>li>a {
color : $darkgray-on-red;
font-weight: 300;
padding: 15px 25px;
transform: skew(42deg);
/* text-shadow: 2px 2px rgba(0,0,0, 0.1); */
text-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}
/****************************************************/
/* SECTION STYLES */
/****************************************************/
/************** GLOBAL SECTION STYLES **************/
section.component i.fa {
color: $primary-red;
text-shadow: 0 3px 3px rgba(0,0,0,0.16), 0 3px 3px rgba(0,0,0,0.23);
padding-top: 30px;
}
section.component {
color: $mostly-white;
padding-top: 70px;
font-family: 'Dosis', serif;
padding-bottom: 120px;
}
section.component h2 {
color: $matching-blue;
margin-bottom: 30px;
font-size: 2.8em;
font-weight: 400;
text-shadow: 0 3px 3px rgba(0,0,0,0.16), 0 3px 3px rgba(0,0,0,0.23);
text-transform: uppercase;
}
section.component h3 {
margin-bottom: 20px;
font-size: 2.2em;
font-weight: 400;
text-shadow: 0 3px 3px rgba(0,0,0,0.16), 0 3px 3px rgba(0,0,0,0.23);
color: $matching-blue;
}
section.component h5 {
margin-bottom: 40px;
font-size: 2em;
font-weight: 300;
text-shadow: 0 3px 3px rgba(0,0,0,0.16), 0 3px 3px rgba(0,0,0,0.23);
}
section.component p {
margin-bottom: 20px;
font-size: 1.6em;
font-weight: 400;
text-shadow: 0 3px 3px rgba(0,0,0,0.16), 0 3px 3px rgba(0,0,0,0.23);
}
section.component.content {
padding: 30px;
}
section.component.parallax {
min-height: 1000px;
background-position: 50% 50%;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
/************** SECTION: LANDING **************/
#landing h2,
#landing p {
padding-right: 50px;
}
#landing p {
color: $theme-gray;
}
/************** SECTION: ABOUT **************/
/************** SECTION: WORKS **************/
#works div[class*="col-"] {
margin-bottom: 60px;
}
/************** SECTION: EXTRAS **************/
#extras p {
color: #fff;
}
/************** SECTION: FOOTER **************/
#footer {
padding-top: 30px;
padding-bottom: 30px;
text-align: center;
}
#footer i.fa {
padding-top: 0;
color: $primary-red;
}
#footer i.fa.fa-stack-1x {
padding-top: 0;
color: $mostly-white;
}
#footer h2 {
font-size: 1.7em;
margin-bottom: 20px;
}
#footer p {
font-size: 1.3em;
}
#footer a {
font-size: 1.15em;
text-decoration: none;
color: $matching-blue;
text-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}
#footer div[class*="col-"] {
margin-bottom: 50px;
}
#footer p.copyright {
font-size: 1.15em;
margin-top: 50px;
color: $semi-white;
}
/****************************************************/
/* BACKGROUNDS */
/****************************************************/
section.component.image-2 {
background-image: url(http://lh3.googleusercontent.com/-alKGdDNrZpk/VF5nZFBacnI/AAAAAAAAZfM/u6LmXTEmysk/w958-h724-no/14%2B-%2B18);
}
section.component.image-3 {
background-image: url(http://www.topofandroid.com/wp-content/uploads/2015/05/Android-L-Material-Design-Wallpapers-12.jpg);
}
section.component.image-4 {
background-image: url(https://lh3.googleusercontent.com/-alKGdDNrZpk/VF5nZFBacnI/AAAAAAAAZfM/u6LmXTEmysk/w958-h724-no/14%2B-%2B18);
}
section.component.image-5 {
background-image: url(http://substantial.com/assets/images/blog/2015/05/materialdesign_blog.png);
}
section.component.image-5b {
background-image: url(https://cdn-images.xda-developers.com/direct/3/3/9/3/1/1/8/Design.jpg);
}
section.component.image-6 {
background-image: url(http://lh5.googleusercontent.com/-7fiskJ9M42I/VF5nZGXuOKI/AAAAAAAAZlU/kEXZl1E_QQc/w958-h539-no/14%2B-%2B110);
}
section.component.image-7 {
background-image: url(http://lh3.googleusercontent.com/-b_fSb0VJPYk/VF5nZCpXx3I/AAAAAAAAavs/tVSt6--l1Yk/s765-no/14%2B-%2B14);
}
section.component.image-8 {
background-image: url(http://www.topofandroid.com/wp-content/uploads/2015/05/Android-L-Material-Design-Wallpapers-12.jpg);
}
section.component.image-9 {
background-image: url(http://wallpaperspal.com/wp-content/uploads/Material-Design-Blue-Scheme-Wallpaper.jpg);
}
section.component.image-10 {
background-image: url(https://4.bp.blogspot.com/-LM_oSHCnkLo/VJmEHDx_BQI/AAAAAAAAGGM/6a6PDdHyIJE/s0/2.png);
}
section.component.image-12 {
background-image: url(http://likefon.com/uploads/p1g/android-l-material-design-3707.jpg);
}
section.component.image-dark-red-a {
background-image: url(http://orig11.deviantart.net/20eb/f/2015/030/6/f/_minflat__dark_material_design_wallpaper__4k__by_dakoder-d8fjqzu.jpg);
}
section.component.image-dark-red-b {
background-image: url(http://4kwallpapers.co/wp-content/uploads/2015/07/Dark-Material-Design-4K-Wallpaper.jpg);
}
section.component.image-dark-red-c{
background-image: url(https://4.bp.blogspot.com/-flxbcly7cB8/VYUiSrhkj3I/AAAAAAABofw/kwrMmHvsyWY/s0/Dark_Material_Design3_wallpaper.jpg);
}
/****************************************************/
/* RESPONSIVE */
/****************************************************/
@media (min-width: 992px) {
// SECTION: LANDING
#landing p {
font-size: 1.8em;
padding-right: 100px;
}
// SECTION: WORKS
.card {
height: 385px
}
// SECTION: FOOTER
#footer {
text-align: left;
}
#footer p.copyright {
margin-top: 41px;
}
}
@media (min-width: 1200px) {
// SECTION: LANDING
#landing h2 {
padding-right: 10px;
}
#landing p {
padding-right: 70px;
}
}
/****************************************************/
/* Notes */
/****************************************************/
/*---------------------------------------------------
Images in the Works section - not properly scaled
prior to using them as they are just random
placeholders (no credits)
Backgrounds - pulled from Deviantart, credited
in footer. http://dakoder.deviantart.com/
Social Links - not connected
Responsive - minor responsive work to make
sure things worked properly at most viewports
- have not done font resizing, etc. Also - the navbar
dropdown when collapsed doesn't seem to be working
at small viewports. Likely the styling that is
breaking it.
Design - design originated from the fact that I knew
I wanted a parallelogram based navbar. From there,
I was going to go with something more in line
with a graffiti theme but I wanted to use
material design images which didn't match up with that.
I started with a "lighter" version of the site but
abandoned it upon finding a set of matching high
quality material design backgrounds.
The shape / color of the backgrounds gives off a sci-fi
feel and I think the blue accent for the headers
fits that perfectly.
This is far more than anyone will ever want to read, and no,
I typically wouldn't put this in a CSS file.
- Dephora
---------------------------------------------------*/
$(document).ready(function() {
// Navbar hover
$('.navbar-nav>li.skewed').hover(function() {
$(this).animate({ 'height': '90px',
'margin-right': '25px',
'margin-left': '-15px',
'background-color': 'rgb(20, 213, 233)'
});
}, function() {
$(this).animate({ 'height': '50px',
'margin-right': '5px',
'margin-left': '5px',
'background-color': '#E9503C'
});
});
// Navbar Scroll To Section
$('a[href^="#"]').on('click',function (e) {
e.preventDefault();
var target = this.hash;
var $target = $(target);
$('html, body').stop().animate({
'scrollTop': $target.offset().top
}, 1200, 'swing', function () {
window.location.hash = target;
});
});
});
Also see: Tab Triggers