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 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.
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 Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
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.
<!-- Jumbotron Feature -->
<div class="jumbotron">
<div class="container">
<img src="http://jimkulakowski.com/web-design/img/parallax-backgrounds/space.jpg" alt="Image of mac laptop on a desk" class="parallax-img">
<img src="http://jimkulakowski.com/web-design/img/jim-at-piano.png" alt="jim at piano" class="profile-img">
<h1>Jim Kulakowski</h1>
<hr class="style-seven" />
<h4>Web Designer - Graphic Artist - User Interface Designer - Interactive Media Designer</h4>
<p>
<a class="btn btn-lg btn-clear-light soft-transition" href="https://twitter.com/j_kula" role="button" target="_blank"><i class="fa fa-twitter"> Twitter</i></a>
<a class="btn btn-lg btn-clear-light soft-transition" href="https://github.com/jmkulakowski" role="button" target="_blank"><i class="fa fa-github-square"> Github</i></a>
<a class="btn btn-lg btn-clear-light soft-transition" href="https://www.linkedin.com/in/jkulakowski
" role="button" target="_blank"><i class="fa fa-linkedin-square"> LinkedIn</i></a>
</p>
</div>
</div>
<!------------------------------------
-- Begin Main Page Content --
------------------------------------->
<div class="container-fluid">
<!-- Fixed Navbar -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="container">
<!-- Mobile menu button -->
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Site Branding -->
<div class="navbar-header">
<a class="navbar-brand" href="#">
<img src="http://jimkulakowski.com/web-design/img/jk-logo-space.png" alt="Jim Kulakowski Space Logo" class="site-logo">
<p>Jim Kulakowski</p>
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="#portfolio">Portfolio</a></li>
<li><a href="#about">About</a></li>
<li><a href="#skills">Skills</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div>
<!-- END .navbar-collapse -->
</div>
<!-- END .container -->
</div>
<!-- END .container-fluid -->
</nav>
<!---------------------------
-- Portfolio Image Links --
---------------------------->
<section id="portfolio">
<div class="container">
<h1>Portfolio</h1>
<hr class="style-seven" />
<!-- Row #1 -->
<div class="row">
<div class="col-md-4 soft-transition">
<!-- loadModal(title, thumb, body, launchLink)
-- from custom-modal-functions.js -->
<a href="#" data-toggle="modal" data-target="#modal" onclick="loadModal('Cube Art', 'cube-art-screen-shot.png', 'Cube Art is a simple to use drawing program written in html, css, and vanilla javascript. It was coded in an object-oriented style and features the html canvas element.<br /><br /> The program enables the user to draw with varying pencil sizes and colors. It also bears a unique feature that allows it to randomly draw up to 1000 squares of varying sizes instantly.', 'http://jimkulakowski.com/programs/games-apps/cube-art/')">
<div class="project-overlay teall-bg"></div>
<img src="http://jimkulakowski.com/web-design/img/portfolio-thumbs/cube-art-thumb.png" alt="cube art thumbnail" class="project-thumb">
<h3>Cube Art</h3>
</a>
</div>
<div class="col-md-4">
<a href="#" data-toggle="modal" data-target="#modal" onclick="loadModal('JS Audio Player', 'js-audio-player-screenshot.png', 'JS Audio Player is a custom HTML5 audio player that automatically converts links containing audio files to play buttons through vanilla javascript functions.<br /><br />When installed, the player will convert any standard audio link to a play button with a title. Once the play button is clicked, the player loads the appropriate audio file into the JS player and displays custom controls that are fixed to the bottom of the screen, allowing the user to scroll the page while always maintaining view of the controls.<br /><br />The player features a play/pause button, progress bar with scrubbing, dedicated quick scrubbing buttons, volume control, and loop button all wrapped in a responsive design.', 'http://jimkulakowski.com/programs/games-apps/js-audio-player/')">
<div class="project-overlay teall-bg"></div>
<img src="http://jimkulakowski.com/web-design/img/portfolio-thumbs/js-audio-player-thumb.png" alt="js audio player thumbnail" class="project-thumb">
<h3>JS Audio Player</h3>
</a>
</div>
<div class="col-md-4">
<a href="#" data-toggle="modal" data-target="#modal" onclick="loadModal('Midi.js Piano', 'midi-piano-screenshot.png', 'Midi.js Piano is a HTML5, interactive keyboard application incorporating the MIDI.js framework. The application was written in html, css, and vanilla javascript.<br /><br />The application allows the user to select from an extensive list of instruments and sfx. The sound is loaded and can be played in two mid-range octaves using the onscreen keys.', 'http://jimkulakowski.com/programs/games-apps/piano-keys/')">
<div class="project-overlay teall-bg"></div>
<img src="http://jimkulakowski.com/web-design/img/portfolio-thumbs/piano-thumb.png" alt="piano app thumbnail" class="project-thumb">
<h3>Midi.js Piano</h3>
</a>
</div>
</div>
<br />
<!-- Row #2 -->
<div class="row">
<div class="col-md-4 soft-transition">
<a href="#" data-toggle="modal" data-target="#modal" onclick="loadModal('Rock, Paper, Scissors', 'rock-paper-scissors-screenshot.png', 'Rock, Paper, Scissors is a custom, HTML5 build of the classic game, featuring a clean, modern design and some catchy music. The user plays against a programmed opponent. One point is awarded for each round and the first to reach a total score of seven wins the game!', 'http://jimkulakowski.com/programs/games-apps/rock-paper-scissors/')">
<div class="project-overlay teall-bg"></div>
<img src="http://jimkulakowski.com/web-design/img/portfolio-thumbs/rock-scissors-paper-thumb.png" alt="rock, paper, scissors thumbnail" class="project-thumb">
<h3>Rock, Paper, Scissors</h3>
</a>
</div>
<div class="col-md-4">
<a href="#" data-toggle="modal" data-target="#modal" onclick="loadModal('Gravity Square', 'gravity-square-screenshot.png', 'Gravity Square is an interactive HTML5 application written in html, css, and vanilla javascript. The user may use the arrow keys and space bar to rotate, scale, and manipulate the square in a number of ways.<br /><br />Under the hood, the design features object-oriented programming and relies upon the html canvas element to display the square.', 'http://jimkulakowski.com/programs/games-apps/gravity-square/')">
<div class="project-overlay teall-bg"></div>
<img src="http://jimkulakowski.com/web-design/img/portfolio-thumbs/gravity-square-thumb.png" alt="gravity square thumbnail" class="project-thumb">
<h3>Gravity Square</h3>
</a>
</div>
<div class="col-md-4">
<a href="#" data-toggle="modal" data-target="#modal" onclick="loadModal('Tim Burton Tribute', 'burton-screenshot.png', 'Tim Burton Tribute is a dedication fan page designed with Twitter Bootstrap. The page features a short passage about the film director and a list of his most notable films. Each film includes links to watch the film on Amazon, get detailed information from the Internet Movie Database (IMDB), or from Wikipedia.', 'http://jimkulakowski.com/programs/websites/tim-burton/')">
<div class="project-overlay teall-bg"></div>
<img src="http://jimkulakowski.com/web-design/img/portfolio-thumbs/burton-thumb.png" alt="tim burton site thumbnail" class="project-thumb">
<h3>Tim Burton Tribute</h3>
</a>
</div>
<!-- END row -->
<!--------------------------
-- Modal --
--------------------------->
<!-- Cube Art -->
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h2 class="modal-title" id="myModalLabel"></h2>
</div>
<div class="modal-thumb">
<img src="" alt="">
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<a href="#" type="button" class="btn btn-default btn-clear-dark" target="_blank">Launch</a>
</div>
</div>
</div>
</div>
</div>
<!-- END .container -->
</div>
</section>
<!--------------------------
-- About Section --
--------------------------->
<section id="about" class="teall-bg">
<div class="container">
<h1>About</h1>
<hr class="style-seven" />
<p>
A true creative who enjoys the process of building, new challenges, new ideas, and elegant solutions. I have trained for years in a number of creative diciplines including music composition, graphic design, illustration, and computer programming. I have
a keen eye and strong sense of connection to the user's needs.
</p>
</div>
</section>
<!--------------------------
-- Skills Section --
--------------------------->
<section id="skills">
<div class="container">
<h1>Skills</h1>
<hr class="style=seven" />
<ul class="list-inline">
<li><img src="http://jimkulakowski.com/web-design/img/skills-logos/html5-logo.png" alt="html5"></li>
<li><img src="http://jimkulakowski.com/web-design/img/skills-logos/css-logo.png" alt="css"></li>
<li><img src="http://jimkulakowski.com/web-design/img/skills-logos/javascript-logo.png" alt="javascript"></li>
<li><img src="http://jimkulakowski.com/web-design/img/skills-logos/php-elephant-logo.png" alt="php"></li>
<li><img src="http://jimkulakowski.com/web-design/img/skills-logos/jquery-logo.png" alt="jquery"></li>
<li><img src="http://jimkulakowski.com/web-design/img/skills-logos/bootstrap-logo.png" alt="html5"></li>
<li><img src="http://jimkulakowski.com/web-design/img/skills-logos/wordpress-logo.png" alt="wordpress"></li>
<li><img src="http://jimkulakowski.com/web-design/img/skills-logos/oop-logo.png" alt="object oriented programming"></li>
</ul>
</div>
</section>
<!--------------------------
-- Contact Form --
--------------------------->
<section id="contact" class="teall-bg">
<div class="container">
<h1>Contact</h1>
<hr class="style-seven" />
<!-- Form HTML -->
<form action="#contact" method="post">
<fieldset class="form-group">
<input type="name" class="form-control" id="input_name" placeholder="Enter your Name" name="name">
</fieldset>
<fieldset class="form-group">
<input type="email" class="form-control" id="input_email" placeholder="Enter your E-mail Address" name="email">
<!--
<small class="">I'll never share your email with anyone else.</small>
-->
</fieldset>
<fieldset class="form-group">
<textarea class="form-control" id="input_project_info" rows="3" placeholder="Tell me about your project!" name="message"></textarea>
</fieldset>
</div>
<input type="submit" id="submit" class="btn btn-clear-light soft-transition" name="submit" value="Send">
</form>
</div>
</section>
</div>
<!-- END Main page content -->
<!--------------------------
-- Footer --
--------------------------->
<footer>
<div class="container-fluid text-center affix-bottom">
Copyright © 2014 - 2016 Jim Kulakowski. All rights reserved.
</DIV>
</footer>
body {
font-family: 'Raleway', sans-serif;
font-size: 16px;
color: #333;
}
section {
display: block;
text-align: center;
padding: 0 0 20px;
}
section hr {
width: 50%;
}
a, a:visited {
text-decoration: none;
color: #555;
outline: none;
}
a:hover {
text-decoration: none;
color: #888;
}
a:active, a:focus {
text-decoration: none;
color: #aaa;
outline: none;
}
/* Flaired edges, by Tomas Theunissen */
hr.style-seven {
height: 30px;
border-style: solid;
border-color: #eee;
border-width: 1px 0 0 0;
border-radius: 20px;
}
hr.style-seven:before { /* Not really supposed to work, but does */
display: block;
content: "";
height: 30px;
margin-top: -31px;
border-style: solid;
border-color: #eee;
border-width: 0 0 1px 0;
border-radius: 20px;
}
.teall-bg {
color: #eee;
background-color: #333;
}
/*-- Custom Buttons --*/
.btn:focus,.btn:active { /* Prevent clue outline around boostrap buttons */
outline: none !important;
}
.btn-clear-light, .btn-clear-light:visited {
color: #fff;
background: none;
border: 1px solid #fff;
border-radius: 0;
}
.btn-clear-light:hover {
color: #333;
background: #eee;
}
.btn-clear-light:active, .btn-clear-light:focus {
color: #333;
background-color: #ddd;
}
.btn-clear-dark, .btn-clear-dark:visited {
color: #111;
background: none;
border: 1px solid #333;
border-radius: 0;
}
.btn-clear-dark:hover {
color: #eee;
background: #111;
}
.btn-clear-dark:active, .btn-clear-dark:focus {
color: #eee;
background-color: #333;
}
.btn-clear-med, .btn-clear-dark:visited {
color: #aaa;
background: none;
border: 1px solid #aaa;
border-radius: 0;
}
.btn-clear-med:hover {
color: #333;
border-color: #333;
}
.btn-clear-med:active, .btn-clear-med:focus {
color: #aaa;
border-color: #aaa;
}
.btn-fill-dark, .btn-fill-dark:visited {
color: #fff;
background-color: #222;
border: 1px solid #000;
border-radius: 0;
}
.btn-fill-dark:hover {
color: #eee;
background-color: #101010;
}
.btn-fill-dark:active, .btn-fill-dark:focus {
color: #fff;
background-color: #333;
}
.btn-fill-red, .btn-fill-red:visited {
color: #fff !important;
background: none; /* Clear boostrap background */
background-color: #d33;
border: 1px solid #a33;
border-radius: 0;
}
.btn-fill-red:hover {
background-color: #b33;
}
.btn-fill-red:active, .btn-fill-red:focus {
background-color: #f33;
}
/*-- END Custom Buttons --*/
.soft-transition {
transition: all 0.25s ease-out;
-webkit-transition: all 0.25s ease-out;
-moz-transition: all 0.25s ease-out;
}
.container {
max-width: 1024px;
}
.container-fluid {
margin: 0;
padding: 0;
}
/*-- Navbar settings --*/
.navbar {
transition: all 0.5s ease-out;
}
.navbar {
background: none;
border: none;
}
.navbar-brand {
padding: 10px; /* Allows more space for brand logo to expand */
}
.navbar-brand > img {
max-height: 100%;
display: inline-block;
margin-right: 2px;
background-color: #ccc;
box-shadow: 0 0 3px #ccc;
}
.navbar-brand p {
display: inline-block;
color: #ccc;
}
.navbar-brand p:hover {
color: #eee;
}
.navbar-default .navbar-nav>li>a {
color: #ccc;
}
.navbar-default .navbar-nav>li>a:hover {
color: #eee;
}
.navbar-default .navbar-collapse, .navbar-default .navbar-form {
border-color: #444;
}
/*-- Mobile nav --*/
.navbar-default .navbar-toggle, .navbar-default .navbar-toggle:focus, .navbar-default .navbar-toggle:hover {
background: none;
border: none;
}
/*-- Jumbotron settings --*/
.jumbotron {
position: relative;
margin: 0;
text-align: center;
color: #fff;
background-color: #333;
overflow: hidden;
}
.jumbotron .container .profile-img, .jumbotron .container h1, .jumbotron .container h4, .jumbotron .container hr, .jumbotron .container a {
position: relative;
}
.jumbotron .parallax-img {
width: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 0;
}
.jumbotron .profile-img {
width: 25%;
margin: 20px 0;
border-radius: 100%;
border: 8px solid #eee;
-moz-box-shadow: 0px 0px 20px #ccc;
-webkit-box-shadow: 0px 0px 20px #ccc;
box-shadow: 0px 0px 20px #ccc;
filter: hue-rotate(30deg);
-webkit-filter: hue-rotate(30deg);
-moz-filter: hue-rotate(30deg);
-o-filter: hue-rotate(30deg);
/*
filter: saturate(0);
-webkit-filter: saturate(0);
-moz-filter: saturate(0);
-o-filter: saturate(0);
*/
}
.jumbotron hr {
width: 50%;
}
.jumbotron h4 {
max-width: 50%;
margin: 0 auto 20px;
}
.project-thumb {
width: 100%;
max-width: 280px;
border: 1px solid #ccc;
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
filter: grayscale(100%);
}
.project-thumb:hover {
-webkit-filter: grayscale(0%);
-moz-filter: grayscale(0%);
filter: grayscale(0%);
}
.project-overlay {
}
/*-- Custom Modal Settings --*/
.modal-content {
border-radius: 0;
}
.modal-dialog {
/* width: 80%; */
margin: 0 auto; /* Eliminate top margin on bootstrap modal */
}
.modal-thumb img {
width: 66%;
padding-top: 20px;
}
.modal-body {
padding: 20px 0;
text-align: left;
width: 66%;
margin: 0 auto;
}
.close {
font-size: 40px;
font-weight: 200;
}
/* END custom modal settings --*/
#about p {
width: 50%;
margin: 0 auto 10px;
}
#skills img {
max-width: 100px;
max-height: 100px;
margin-right: 20px;
margin-bottom: 20px;
}
#contact form {
width: 50%;
margin: 20px auto;
}
.alert, .alert-success {
width: 33%;
margin: 20px auto 0;
background: none;
color: #fff;
border-color: #eee;
border-radius: 0;
}
footer {
width: 100%;
margin: 0;
padding: 20px;
background-color: #ddd;
}
/*-----------------
* Mobile Settings *
-----------------*/
/* Make sure parallax image fills jumbotron */
@media(max-width: 1200px) {
.jumbotron .parallax-img {
width: auto;
height: 100%;
}
}
/*-- iPhone 6+ --*/
@media(max-width: 736px) {
/* Expand feature image size */
.jumbotron .profile-img {
width: 66%;
}
/* Give overlapping buttons vertical space */
.jumbotron .container a {
margin-bottom: 10px;
}
/* Expand various element widths */
#about p, #contact form, .modal-body, .modal-thumb img {
width: 90%;
}
}
// Add some space at the top to accomodate fixed menu
accountForFixedMenu(0.5);
// Enable smooth scroll when navigating to various sections
sectionSmoothScroll();
// Change nav from transparent to white on scroll
navDynamicStyles(100);
// Add fade effect on page scroll to feature image and highlight main text
fadeFeatureImgOnScroll(250, 0.4);
// Soft transition effect to all portfolio thumbs
jQuery('.project-thumb').addClass("soft-transition");
// Create cross browser requestAnimationFrame method:
window.requestAnimationFrame = window.requestAnimationFrame
|| window.mozRequestAnimationFrame
|| window.webkitRequestAnimationFrame
|| window.msRequestAnimationFrame
|| function(f){setTimeout(f, 1000/60)}
/*-- Parallax Effect --*/
// Target the background element to which effect will be applied
var jumbotron = document.querySelector('.jumbotron');
var container = jumbotron.children[0];
var parallaxBg = container.children[0];
function parallax(){
var scrolltop = window.pageYOffset; // get number of pixels document has scrolled vertically
parallaxBg.style.top = scrolltop * 0.2 + 'px'; // move parallaxBg at 20% of scroll rate
}
// Attach the effect to the window scroll
window.addEventListener('scroll', function(){ // on page scroll
requestAnimationFrame(parallax); // call parallax() on next available screen paint
}, false)
/** -----------------------------------------------------------------
* Function Definitions
-------------------------------------------------------------------*/
// Add an event listener to any element
/*
* When calling this function, make sure to enclose the element and listner
* tags in quotes - i.e. addListener(myElement, "onload", doThisFunction)
*/
function addListener(elementTag, listener, func) {
var element = document.querySelectorAll(elementTag);
for (i = 0; i < element.length; i++) {
element[i].addEventListener(listener, func, false);
}
}
function accountForFixedMenu(factor) { // factor from 0 - 1 (% to offset)
var jumbotron = document.querySelector(".jumbotron");
var navbar = document.querySelector(".navbar");
// Add navbar height + percentage of jumbotron' bottom padding
var targetTopPadding = Number(navbar.offsetHeight) +
Number($(jumbotron).css("padding-bottom").replace("px", "") * factor);
// Set top padding of jumbotron
jumbotron.style.paddingTop = targetTopPadding + "px";
}
function navDynamicStyles(buffer) {
$(window).scroll(function(i) {
var scrollDistance = $(window).scrollTop(); // How far window id from top
// Reference the navbar elements
var navbar = jQuery('.navbar');
var brandImage = jQuery('.navbar-brand > img');
var siteTitle = jQuery('.navbar-brand p');
var navLinks = jQuery('.navbar-default .navbar-nav>li>a');
var navDropMenu = jQuery('.navbar-default .navbar-collapse, .navbar-default .navbar-form');
/* -----------------------------
-- Scrolled Nav Settings --
------------------------------*/
// If the window is scrolled beyond the buffer
if (scrollDistance > buffer) {
navbar.css({
backgroundColor: "#fff",
background: "linear-gradient(#fff, #f8f8f8)",
background: "-webkit-linear-gradient(#fff, #f8f8f8)",
background: "-o-linear-gradient(#fff, #f8f8f8)",
background: "-moz-linear-gradient(#fff, #f8f8f8)"
});
brandImage.css({
background: "none",
boxShadow: "none"
});
siteTitle.css({
color: "#777"
});
siteTitle.hover(
function() {
jQuery(this).css("color", "#aaa");
},
function() {
jQuery(this).css("color", "#777");
});
navLinks.css({
color: "#777"
});
navLinks.hover(
function() {
jQuery(this).css("color", "#aaa");
},
function() {
jQuery(this).css("color", "#777");
});
navDropMenu.css({
borderColor: "#e7e7e7"
});
} // END if
/* -----------------------------
-- Transparent Nav Settings --
------------------------------*/
// If the window is scrolled to the top of the page
else if (scrollDistance < buffer) {
navbar.css({
background: "none"
});
brandImage.css({
backgroundColor: "#ccc",
boxShadow: "0 0 3px #ccc"
});
siteTitle.css({
color: "#ccc"
});
siteTitle.hover(
function() {
jQuery(this).css("color", "#eee");
},
function() {
jQuery(this).css("color", "#ccc");
});
navLinks.css({
color: "#ccc"
});
navLinks.hover(
function() {
jQuery(this).css("color", "#eee");
},
function() {
jQuery(this).css("color", "#ccc");
});
navDropMenu.css({
borderColor: "#444"
});
} // END else if
});
}
function fadeFeatureImgOnScroll(scrollDistance, parallaxFactor) {
$(window).scroll(function(i) {
// Scroll distance from window top
var scrollVar = $(window).scrollTop();
// The featured image
var profileImage = $('.jumbotron .container').children('.profile-img');
// The heading Text
var headText = $('.jumbotron .container h1');
var subHeadText = $('.jumbotron .container h4');
profileImage.css({
'top': parallaxFactor * scrollVar,
'opacity': (scrollDistance - scrollVar) / 100
});
// Add soft transition to head text
headText.addClass('soft-transition');
// If the window is scrolled beyond the scrollDistance
// and featured image is invisible
if (scrollVar > scrollDistance) {
// Add a text hightlight to the head text
headText.css({
textShadow: "0 0 20px #ccc"
});
subHeadText.css({
textShadow: "0 0 20px #ccc"
});
} else {
// Otherwise, remove the effect
headText.css({
textShadow: "none"
});
subHeadText.css({
textShadow: "none"
});
}
});
}
function sectionSmoothScroll() {
jQuery(".navbar a").click(function() {
var screenWidth = $(window).width();
// If mobile menu is visible
if (screenWidth < 768) {
// Toggle drop down menu
$('.btn-navbar').click(); //bootstrap 2.x
$('.navbar-toggle').click() //bootstrap 3.x
}
// Store the link's href attribute
var href = jQuery(this).attr("href");
// Store the added padding to account for fixed nav
var jumbotron = document.querySelector(".jumbotron");
var extraPadding = Number($(jumbotron).css("padding-bottom").replace("px", ""));
//console.log(extraPadding);
// Animate the window to the top of the referenced element minus extra padding
$('html, body').animate({
scrollTop: (jQuery(href).offset().top) - extraPadding
}, 500);
return false;
});
}
function loadModal(title, thumb, body, launchLink) {
// Reference modal elements
var modalTitle = document.querySelector(".modal-title");
var modalThumb = document.querySelector(".modal-thumb img");
var modalBody = document.querySelector(".modal-body");
var modalFooterLink = document.querySelector(".modal-footer a");
// Dynamically fill content of modal with function call
modalTitle.innerHTML = title;
modalThumb.src = "img/portfolio-screen-shots/" + thumb;
modalBody.innerHTML = body;
modalFooterLink.setAttribute("href", launchLink);
}
Also see: Tab Triggers