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.
.container.out
h1 Sleepless nights
p.fade
| However, standard default text can do the trick. I hope you enjoyed the fake text. The standard default text is designed to ramble about nothing. This string is randomly generated.
p.fade
| This text will not appear in a consistent order. The standard default text is designed to ramble about nothing. Your design looks awesome by the way. If it is not real text, they will focus on the design.
p.fade
| However, standard default text can do the trick. JavaScript has the awesome power to manipulate DOM elements on the fly. People tend to read writing. Humans are creative beings.
h2.fade Keep scrolling down
p.fade
| Cow pork loin sausage, beef ribs ribeye capicola pancetta porchetta cupim drumstick meatball short ribs ham hock pig. Biltong jowl frankfurter ground round bacon turkey turducken prosciutto cupim bresaola kevin swine ribeye short loin. Rump tail ham hamburger shank chicken tongue meatloaf. Tail tenderloin ball tip, pork chop meatball shank doner ham drumstick. Salami short loin shank filet mignon fatback jowl t-bone ball tip pork chop venison capicola meatball tongue tri-tip. Pork loin pork frankfurter ham hock tongue tail chuck jowl salami short ribs tenderloin chicken turducken.
p.fade
| Rump filet mignon kevin chicken porchetta pastrami ham hock pork loin. Doner tenderloin fatback cow. Andouille alcatra meatloaf venison spare ribs, capicola salami porchetta filet mignon. Turducken chicken short ribs t-bone ground round meatball, ribeye kielbasa short loin boudin shoulder shank sirloin. Pancetta sausage andouille sirloin meatloaf fatback ball tip ham hock alcatra shank.
h2.fade Keep scrolling down
p.fade
| Meatball shoulder capicola, flank pork chop prosciutto turkey short ribs t-bone short loin. Doner beef ribs drumstick tail. Beef ribs flank pastrami bresaola andouille pig shankle ham hock boudin prosciutto. Swine bresaola shoulder filet mignon hamburger, landjaeger beef cow kielbasa flank strip steak. Turducken filet mignon swine, kielbasa shank boudin drumstick.
p.fade
| Venison hamburger sirloin, pork belly beef ribs spare ribs biltong swine fatback capicola. Corned beef chicken tail, beef ribs porchetta ham hock fatback sausage capicola meatloaf swine shoulder tongue. Short loin ball tip strip steak, tri-tip picanha shank burgdoggen pork pancetta kielbasa venison porchetta leberkas chuck andouille. Short loin pancetta spare ribs, pig jerky pork loin cow boudin landjaeger swine jowl. Capicola bacon jerky pastrami ham hock bresaola leberkas.
h2.fade Keep scrolling down
p.fade
| However, standard default text can do the trick. I hope you enjoyed the fake text. The standard default text is designed to ramble about nothing. This string is randomly generated.
p.fade
| This text will not appear in a consistent order. The standard default text is designed to ramble about nothing. Your design looks awesome by the way. If it is not real text, they will focus on the design.
p.fade
| However, standard default text can do the trick. JavaScript has the awesome power to manipulate DOM elements on the fly. People tend to read writing. Humans are creative beings.
.flowcontent.flow
.imageholder.img1
.caption
h4 "I needed you."
p Gif
.flowcontent.flow
.imageholder.img2
.caption.right
h4 "She sat there in silence and waited."
p Pexels image
h2.fade Keep scrolling down
p.fade
| Cow pork loin sausage, beef ribs ribeye capicola pancetta porchetta cupim drumstick meatball short ribs ham hock pig. Biltong jowl frankfurter ground round bacon turkey turducken prosciutto cupim bresaola kevin swine ribeye short loin. Rump tail ham hamburger shank chicken tongue meatloaf. Tail tenderloin ball tip, pork chop meatball shank doner ham drumstick. Salami short loin shank filet mignon fatback jowl t-bone ball tip pork chop venison capicola meatball tongue tri-tip. Pork loin pork frankfurter ham hock tongue tail chuck jowl salami short ribs tenderloin chicken turducken.
p.fade
| Rump filet mignon kevin chicken porchetta pastrami ham hock pork loin. Doner tenderloin fatback cow. Andouille alcatra meatloaf venison spare ribs, capicola salami porchetta filet mignon. Turducken chicken short ribs t-bone ground round meatball, ribeye kielbasa short loin boudin shoulder shank sirloin. Pancetta sausage andouille sirloin meatloaf fatback ball tip ham hock alcatra shank.
.flowcontent.flow
video(autoplay="autoplay", poster="http://gifly.com//media_gifly/7/n/K/c/b/7nKc.jpg", loop="", muted="")
source(src="http://gifly.com//media_gifly/7/n/K/c/b/7nKc.mp4",type="video/mp4")
.caption
h4 Weird monochromatic video
p Gifly mp4 video
h2.fade After Hours Programming created
p.fade
| Meatball shoulder capicola, flank pork chop prosciutto turkey short ribs t-bone short loin. Doner beef ribs drumstick tail. Beef ribs flank pastrami bresaola andouille pig shankle ham hock boudin prosciutto. Swine bresaola shoulder filet mignon hamburger, landjaeger beef cow kielbasa flank strip steak. Turducken filet mignon swine, kielbasa shank boudin drumstick.
p.fade
| Venison hamburger sirloin, pork belly beef ribs spare ribs biltong swine fatback capicola. Corned beef chicken tail, beef ribs porchetta ham hock fatback sausage capicola meatloaf swine shoulder tongue. Short loin ball tip strip steak, tri-tip picanha shank burgdoggen pork pancetta kielbasa venison porchetta leberkas chuck andouille. Short loin pancetta spare ribs, pig jerky pork loin cow boudin landjaeger swine jowl. Capicola bacon jerky pastrami ham hock bresaola leberkas.
html
background black
body
font-size 100%
font-family 'PT Sans', sans-serif
line-height 1.5
background black
color alpha(white, 0.7)
h1, h2, h3, h4, h5
color white
font-family 'Lora'
h1
font-size 90px
line-height 1.1
@media screen and (max-width: 40em)
font-size 50px
line-height 1.25
h2
font-size 40px
line-height 1.3
@media screen and (max-width: 40em)
font-size 28px
line-height 1.4
h4
font-size 24px
margin-bottom 0.3em
p
font-size 20px
line-height 1.5
.container
width 100%
padding-top 130px
margin-left auto
margin-right auto
transition opacity 1s 2s
&.out
opacity 0
> h1
> h2
> p
position relative
z-index 2
width 80%
max-width 600px
margin-left auto
margin-right auto
.fade
transition all 0.6s
.fade.out
opacity 0
transform translateY(20px)
.flow
transition all 0.8s
.flow.out
opacity 0
.flowcontent
position relative
&:before
display table
content ''
width 1px
height 1200px
.caption
position absolute
border-radius 3px
padding 20px
display block
top 50%
left 10%
z-index 1
transform translateY(-50%)
text-shadow 1px 1px 2px rgba(0,0,0,0.5)
&.right
left auto
right 10%
.imageholder
background-size cover
background-repeat no-repeat
background-position center center
width 100%
height 100%
position fixed
top 0
left 0
z-index 0
&.img1
background-image url(https://dl.dropboxusercontent.com/u/8254962/rihanna-smoke.gif)
&.img2
background-image url(https://dl.dropboxusercontent.com/u/8254962/pexels-photo-234078%401600px.jpeg)
video
position fixed
min-height 100%
min-width 100%
top 50%
left 50%
transform translateX(-50%) translateY(-50%)
z-index 0
/*//////////////////////
*
* SCROLLMAGIC STARTS
*
*//////////////////////
// init controller
var controller = new ScrollMagic.Controller();
//flow
$(".flow").each(function(){
$(this).addClass('out');
new ScrollMagic.Scene({
triggerElement: this,
triggerHook: 0,
duration: 600
})
.on("enter", function(ev){$(ev.target.triggerElement()).removeClass('out');})
.on("leave", function(ev){$(ev.target.triggerElement()).addClass('out');})
.addTo(controller);
});
//fade
$(".fade").each(function(){
$(this).addClass('out');
new ScrollMagic.Scene({
triggerElement: this,
triggerHook: 0.65
})
.on("enter", function(ev){$(ev.target.triggerElement()).removeClass('out');})
.on("leave", function(ev){$(ev.target.triggerElement()).addClass('out');})
.addTo(controller);
});
$('.container').removeClass('out');
Also see: Tab Triggers