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 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.
<header id="header">
<span class="blur"></span>
<h1 class="name">olga syahputrong</h1>
<div class="profile-picture">
<figure>
<img src="https://farm8.staticflickr.com/7508/15921174425_d8c87a67df_s.jpg" alt="">
</figure>
</div>
</header>
<div id="content">
<div class="container">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vel voluptates nostrum perspiciatis, quo aperiam ex voluptatibus, provident nam, quas quibusdam incidunt ea deleniti ut dolore at sint! Veritatis pariatur quas velit, non ad eum est hic dolores, debitis fugit cupiditate unde repudiandae maiores perferendis autem asperiores nisi et aliquid aliquam sunt cumque voluptatibus molestiae culpa. Ex, possimus quia nemo saepe necessitatibus, veritatis nam optio suscipit laudantium similique atque nisi praesentium eveniet placeat quaerat illo, consequuntur ad odio repellat eaque? Quod.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corporis perferendis numquam officiis consequatur hic provident quasi cumque magni maxime sed iusto maiores natus eveniet nostrum doloremque et, deleniti doloribus quibusdam.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa voluptatibus quis sequi voluptates placeat labore ab cupiditate velit totam, nesciunt adipisci eveniet molestias a quos aut nemo dicta consectetur mollitia vero earum architecto. Molestias eius excepturi aut dolorem voluptas fuga itaque sint odio asperiores. Quos velit, repellat assumenda. Magnam neque, ratione, quia dicta recusandae facilis aspernatur veritatis sint voluptates in, quo quod necessitatibus. Dolor, tempore esse, impedit nobis debitis nihil optio dolores quisquam itaque, at voluptatem voluptates error delectus consequuntur.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vero laudantium vitae consequuntur quasi odit voluptate, fugiat sunt explicabo nulla quis magni totam provident accusamus qui minima autem hic. Similique quidem dignissimos, quia quas eaque quaerat totam fugiat, voluptatibus sequi suscipit, in est eveniet atque.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis nobis repudiandae, explicabo nulla nostrum inventore velit excepturi rem modi! Iure tenetur debitis deserunt officiis ut, accusamus non reprehenderit recusandae assumenda ipsum voluptatibus fuga deleniti, sit soluta impedit doloremque voluptas, laborum quo minima praesentium alias architecto velit. Quia hic cupiditate ea architecto cumque. Inventore eos, quisquam eaque adipisci voluptate, obcaecati itaque nam dolorum ea dolore tempore aspernatur quod cum! Aut error dolorum mollitia est voluptatibus, assumenda, animi vero possimus, ipsum rerum architecto facere praesentium ipsam quas. Commodi, nobis.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corporis perferendis numquam officiis consequatur hic provident quasi cumque magni maxime sed iusto maiores natus eveniet nostrum doloremque et, deleniti doloribus quibusdam.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa voluptatibus quis sequi voluptates placeat labore ab cupiditate velit totam, nesciunt adipisci eveniet molestias a quos aut nemo dicta consectetur mollitia vero earum architecto. Molestias eius excepturi aut dolorem voluptas fuga itaque sint odio asperiores. Quos velit, repellat assumenda. Magnam neque, ratione, quia dicta recusandae facilis aspernatur veritatis sint voluptates in, quo quod necessitatibus. Dolor, tempore esse, impedit nobis debitis nihil optio dolores quisquam itaque, at voluptatem voluptates error delectus consequuntur.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa voluptatibus quis sequi voluptates placeat labore ab cupiditate velit totam, nesciunt adipisci eveniet molestias a quos aut nemo dicta consectetur mollitia vero earum architecto. Molestias eius excepturi aut dolorem voluptas fuga itaque sint odio asperiores. Quos velit, repellat assumenda. Magnam neque, ratione, quia dicta recusandae facilis aspernatur veritatis sint voluptates in, quo quod necessitatibus. Dolor, tempore esse, impedit nobis debitis nihil optio dolores quisquam itaque, at voluptatem voluptates error delectus consequuntur.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa voluptatibus quis sequi voluptates placeat labore ab cupiditate velit totam, nesciunt adipisci eveniet molestias a quos aut nemo dicta consectetur mollitia vero earum architecto. Molestias eius excepturi aut dolorem voluptas fuga itaque sint odio asperiores. Quos velit, repellat assumenda. Magnam neque, ratione, quia dicta recusandae facilis aspernatur veritatis sint voluptates in, quo quod necessitatibus. Dolor, tempore esse, impedit nobis debitis nihil optio dolores quisquam itaque, at voluptatem voluptates error delectus consequuntur.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vero laudantium vitae consequuntur quasi odit voluptate, fugiat sunt explicabo nulla quis magni totam provident accusamus qui minima autem hic. Similique quidem dignissimos, quia quas eaque quaerat totam fugiat, voluptatibus sequi suscipit, in est eveniet atque.</p>
</div>
</div>
@import "compass/css3";
body{
font-size: 16px;
font-family: 'Roboto', sans-serif;
}
p{
font-size: 18px;
}
header{
min-height: 60px;
height: 300px;
overflow: hidden;
position: fixed;
width: 100%;
top: 0;
background: black;
.blur{
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: -1;
display: block;
background: url(https://ununsplash.imgix.net/42/QrXgXMhCSouyhU7idq7g_IMG_8402.JPG?q=75&fm=jpg&s=bdea81e34350af8cbef0718c633aa78c)no-repeat;
@include background-size(cover);
background-attachment: fixed;
background-position: center;
// -webkit-filter: blur(5px);
// -moz-filter: blur(5px);
// -o-filter: blur(5px);
// -ms-filter: blur(5px);
// filter: blur(5px);
}
.name{
margin: 0;
display: block;
text-align: center;
color: white;
line-height: 60px;
opacity: 0;
text-transform: uppercase;
}
.profile-picture{
width: 150px;
height: 150px;
left: 50%;
top: 50%;
@include transform(translate(-50%,-50%));
position: absolute;
img{
border: 4px solid white;
@include border-radius(100%);
}
&:before,
&:after{
content:"";
width: 4px;
height: 100%;
position: absolute;
background: white;
left: 50%;
margin-left: -1px;
}
&:before{
top: -100%;
}
&:after{
top: 100%;
}
}
}
.container{
padding: 0 10%;
display: block;
margin: auto;
}
#content{
margin-top: 350px;
}
$(window).scroll(function(){
var ScreenHeight = document.documentElement.clientHeight;
var scrollLenght = $(window).scrollTop();
if( scrollLenght >= 0 ){
$('header').height(300-scrollLenght) ;
$('header span').velocity({ blur: scrollLenght/20 } ,10);
$('.profile-picture').css('opacity', 1 - (scrollLenght / 200));
$('.name').css('opacity', 0 + (scrollLenght / 200));
};
console.log(scrollLenght);
});
Also see: Tab Triggers