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(style='overflow:hidden;')
div(style='overflow: hidden; ')
#middlediv
#bottom.animated.pulse.infinite
i.fas.fa-angle-double-down
#left.animated.pulse.infinite.delay-1s
i.fas.fa-angle-double-left
#top.animated.pulse.infinite.delay-2s
i.fas.fa-angle-double-up
#right.animated.pulse.infinite.delay-3s
i.fas.fa-angle-double-right
.ft
h1 Ini Avan
h4 Celui qui revient
#topdiv
#topcenter.animated.pulse.infinite
i.fas.fa-angle-double-down
#bottomdiv
#bottomcenter.animated.pulse.infinite
i.fas.fa-angle-double-up
#rightdiv
h4.title-text Le film vu par Daniel Dos Santos
#rightcenter.animated.pulse.infinite
i.fas.fa-angle-double-left
object(data="https://cdpn.io/cathbailh/debug/f219c642c859ddb873dba43160022c59")
#leftdiv
#center.animated.pulse.infinite
i.fas.fa-angle-double-right
$color--text= ivory
$arrow--size= 2em
$arrow--z-index=111
$blend=difference
//CATH
$mq--mobile = 320px
$mq--tablet = 600px
$mq--desktop = 1280px
// breakpoints (not used here for the moment) (eg @media break-S)
break-S = "screen and (max-width $mq--mobile)"
break-M = "screen and (min-width $mq--tablet)"
break-L = "screen and (min-width $mq--desktop)"
// font-size
font($scale-min, $scale-max)
font-size $scale-min
@media screen and (min-width $mq--mobile)
font-size "calc(%s + %s * ((100vw - %s) / %s))" % ($scale-min unit($scale-max - $scale-min, '') $mq--mobile unit($mq--desktop - $mq--mobile, ''))
@media screen and (min-width $mq--desktop)
font-size $scale-max
*,
*::after,
*::before
box-sizing border-box
html,body
overflow hidden !important
color $color--text
font(12px, 22px)
#middlediv
height 100%
width 100%
background black
background-image url(https://www.lacor.info/film/ini_avan/dossier-photos/images/large/Ini_avan_12.jpg)
background-repeat no-repeat
background-size cover
background-position 80% center
position absolute
.ft
display block
width 80%
position absolute
top 50%
left 50%
z-index 10
transform translate(-50%,-25%)
text-align center
mix-blend-mode $blend
h1
font-size 5em
text-shadow 2px 0 0 red
h4
opacity 0
animation:appear 2s ease-in-out 1 forwards
@keyframes appear
to
opacity 1
letter-spacing 5px
#topdiv
height 100%
width 100%
background red
background-image linear-gradient(to top, #9be15d 0%, #00e3ae 100%)
position absolute
bottom 100%
#bottomdiv
height 100%
width 100%
background-image linear-gradient(60deg, #64b3f4 0%, #c2e59c 100%)
position absolute
top 100%
#rightdiv
height 100%
width 100%
background gold
position absolute
left 100%
h2,h3,h4
text-align center
width 90%
left 50%
transform translateX(-47%)
z-index 100
position relative
font-family:'Coming soon',cursive
.title-text
padding-top 1em
object
width 90%
min-width 300px
max-width 1200px
height 50vh
min-height 600px
max-height 900px
position absolute
top 50%
left 50%
transform translate(-47%,-47%)
#leftdiv
height 100%
width 100%
background blue
background-image linear-gradient(to right, #92fe9d 0%, #00c9ff 100%)
position absolute
right 100%
#bottom
color $color--text
position absolute
bottom 0px
left 50%
font-size $arrow--size
z-index 111
cursor pointer
#left
color $color--text
position absolute
bottom 50%
left 10px
font-size $arrow--size
z-index $arrow--z-index
cursor pointer
#top
color $color--text
position absolute
left 50%
top 10px
font-size $arrow--size
z-index $arrow--z-index
cursor pointer
#right
color $color--text
position absolute
right 0px
bottom 50%
font-size $arrow--size
z-index $arrow--z-index
cursor pointer
#topcenter
color $color--text
position absolute
bottom 0px
left 50%
font-size $arrow--size
z-index $arrow--z-index
cursor pointer
#bottomcenter
color white
position absolute
left 50%
top 10px
font-size $arrow--size
z-index $arrow--z-index
cursor pointer
#rightcenter
color white
position absolute
bottom 50%
left 10px
font-size $arrow--size
z-index $arrow--z-index
cursor pointer
#center
color white
position absolute
right 10px
bottom 50%
font-size $arrow-size
z-index $arrow--z-index
cursor pointer
$('#left').click(function(){
$('#leftdiv').animate({
position:"absolute",
right:"0px"
})
$('#middlediv').animate({
position:"absolute",
left:"100%"
})
});
$('#center').click(function(){
$('#leftdiv').animate({
position:"absolute",
right:"100%"
})
$('#middlediv').animate({
position:"absolute",
left:"0"
})
});
$('#top').click(function(){
$('#topdiv').animate({
position:"absolute",
bottom:"0px"
})
$('#middlediv').animate({
position:"absolute",
top:"100%"
})
});
$('#topcenter').click(function(){
$('#topdiv').animate({
position:"absolute",
bottom:"100%"
})
$('#middlediv').animate({
position:"absolute",
top:"0",
bottom:"0"
})
});
$('#bottom').click(function(){
$('#middlediv').animate({
position:"absolute",
bottom:"100%",
top:"-100%"
})
$('#bottomdiv').animate({
position:"absolute",
top:"0"
})
});
$('#bottomcenter').click(function(){
$('#middlediv').animate({
position:"absolute",
top:"0",
bottom:"0"
})
$('#bottomdiv').animate({
position:"absolute",
top:"100%"
})
});
$('#right').click(function(){
$('#rightdiv').animate({
position:"absolute",
left:"0px",
})
$('#middlediv').animate({
position:"absolute",
right:"100%",
left:"-100%"
})
});
$('#rightcenter').click(function(){
$('#middlediv').animate({
position:"absolute",
right:"0",
left:"0"
})
$('#rightdiv').animate({
position:"absolute",
left:"100%"
})
});
Also see: Tab Triggers