JavaScript preprocessors can help make authoring JavaScript easier and more convenient. For instance, CoffeeScript can help prevent easy-to-make mistakes and offer a cleaner syntax and Babel can bring ECMAScript 6 features to browsers that only support ECMAScript 5.
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.
HTML Settings
Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
<div id="container">
<nav class="navbar">
<a>Home</a>
<a>About</a>
<a>Products</a>
<a>Features</a>
<a>Buy Now</a>
</nav>
<div id="background"></div>
<div class="section">
<h1 id="title" class="margin-top">Fitbit Alta</h1>
<h2 class="less-margin">a <span class="highlight">wristband</span> that lets you </h2><h2>wear fitness <span class="highlight">your way</span>.</h2>
<h1 class="look">Find your look</h1>
<div class="alta">
<img id="alta" src="https://marketing-pages.fitbit.com/images/product-listing/desktop/altahr-coral-silver-tpu-regular-0-2d30e3c8ded88413047136b8c97e06bc.png">
<div class="button rosegold" id="rosegold" onclick="rosegoldColor()"></div>
<div class="button coral" id="coral" onclick="coralColor()"></div>
<div class="button fuschia" id="fuschia" onclick="fuschiaColor()"></div>
<div class="button black" id="black" onclick="goldColor()"></div>
</div>
</div>
<p id="desc">Fitbit motivates you to reach your health and fitness goals by tracking your <br>activity, exercise, sleep, weight and more.</p>
</div>
$coral: #FF7A6C;
$yellow: #FFDC7B;
$gray: #84828E;
$onyx: #373449;
$rosegold: #CE8C91;
$fuschia: #A24868;
$white: #EDEDED;
@import url('https://fonts.googleapis.com/css?family=Work+Sans:800|Open+Sans');
$big: 'Work Sans', sans-serif;
$regular: 'Open Sans', sans-serif;
body {
background: $white;
}
a {
cursor: pointer;
}
#container {
height: 600px;
width: 900px;
margin: 15% auto;
position: relative;
box-shadow: 4px 10px 20px rgba($onyx, .4)
}
#background {
position: fixed;
bottom: 0px;
right: 0px;
width: 50%;
height: 100%;
background: $coral;
-webkit-clip-path: polygon(52% 0, 100% 0, 100% 100%, 0% 100%);
clip-path: polygon(52% 0, 100% 0, 100% 100%, 0% 100%);
z-index: -1;
transition: all .8s ease;
}
/* navigation */
nav {
display: block;
float: right;
margin: 1em;
margin-top: 2.4em;
font-family: $regular;
font-size: 11px;
}
.navbar a {
padding: 10px;
margin-left: 10px;
border-radius: 25px;
text-decoration: none;
text-transform: uppercase;
letter-spacing: 2px;
color: $onyx;
&:hover {
background: $yellow;
padding: 10px;
border-radius: 25px;
transition: all .5s ease;
}
}
.navbar a:last-child {
background: $onyx;
color: $yellow;
padding: 10px;
border-radius: 25px;
&:hover {
color: $onyx;
background: $yellow;
transition: all .5s ease;
}
}
/* sections */
.section {
position: absolute;
margin-top: 5%;
margin-left: 5%;
width: 100%;
height: 80%;
}
.button {
position: absolute;
width: 15px;
height: 15px;
border-radius: 50%;
&:hover {
transform: scale(1.1);
transition: all 1s ease;
}
}
.rosegold {
background: $rosegold;
}
.coral {
background: $coral;
left: 35px;
}
.fuschia {
background: $fuschia;
left: 70px;
}
.black {
background: $onyx;
left: 105px;
}
/* text-styling */
h1 {
font-family: $big;
color: $coral;
text-transform: uppercase;
font-size: 3.5em;
text-shadow: 2px 1px 0px rgba($onyx, .9);
}
#title {
transition: all 1s ease;
}
h2 {
font-size: 1.2em;
text-transform: uppercase;
margin-top: -20px;
letter-spacing: 3px;
font-family: $regular;
color: $onyx;
}
p {
font-family: $regular;
font-size: .8em;
letter-spacing: 2px;
display: inline-block;
padding: 0 45px;
text-transform: uppercase;
color: $onyx;
}
#desc {
position: absolute;
top: 77%;
}
.look {
position: absolute;
color: $white;
opacity: .4;
right: 5px;
top: 185px;
font-size: 2.3em;
white-space: nowrap;
transform: rotate(90deg);
}
.highlight {
background-color: $yellow;
}
.margin-top {
margin-top: 135px;
}
.less-margin {
margin-top: -35px;
}
/* image */
.alta img {
height: 370px;
position: absolute;
top:50px;
right: 140px;
z-index: -1;
}
#alta img {
transition: all 1s ease;
}
/*
.container {
position: relative;
margin: auto;
background: $yellow;
opacity: .8;
margin-top: 10%;
width: 600px;
height: 400px;
box-shadow: 2px 15px 30px rgba($onyx, .2);
}
.inner-triangle {
position: absolute;
background: white;
opacity: .9;
width: 100%;
height: 100%;
-webkit-clip-path: $bottom-triangle;
clip-path: $bottom-triangle;
}
*/
let alta = document.getElementById('alta');
let background = document.getElementById('background');
let title = document.getElementById('title');
function rosegoldColor() {
alta.src='https://marketing-pages.fitbit.com/images/product-listing/desktop/altahr-soft-pink-22k-rose-gold-plated-tpu-regular-0-2485b69d61944f699443a751d3349b11.png';
background.style.backgroundColor = '#CE8C91';
title.style.color= '#CE8C91';
}
function coralColor() {
alta.src='https://marketing-pages.fitbit.com/images/product-listing/desktop/altahr-coral-silver-tpu-regular-0-2d30e3c8ded88413047136b8c97e06bc.png';
background.style.backgroundColor = '#FF7A6C';
title.style.color= '#FF7A6C';
}
function fuschiaColor() {
alta.src='https://marketing-pages.fitbit.com/images/product-listing/desktop/altahr-fuchsia-silver-tpu-regular-0-e29ab56f259fc0d42c90e8a41b068a03.png';
background.style.backgroundColor = '#A24868';
title.style.color= '#A24868';
}
function goldColor() {
alta.src= 'https://marketing-pages.fitbit.com/images/product-listing/desktop/alta-black-22k-gold-plated-22k-gold-plated-tpu-regular-0-21b753812fcc0c0ea68bbeacfc731d38.png';
background.style.backgroundColor= '#C6AD61';
title.style.color= '#C6AD61';
}
Also see: Tab Triggers