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.
<section class="l-container">
<header class="header">
<div class="logo">
<svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch Beta 3.7 (28138) - http://www.bohemiancoding.com/sketch -->
<defs></defs>
<g id="001" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Daily-UI-#001---Sign-Up" transform="translate(-144.000000, -81.000000)">
<g id="Logo" transform="translate(143.000000, 81.000000)">
<g id="Oval-3-+-Oval-4" transform="translate(1.000000, 0.000000)">
<path class='circle' d="M87.5794617,6.70020519 C106.839908,16.6866076 120,36.8064517 120,60 C120,93.137085 93.137085,120 60,120 C26.862915,120 0,93.137085 0,60 C0,26.862915 26.862915,0 60,0 C60.0507157,0 60.1014166,6.29228956e-05 60.1521028,0.000188694877 L60.1521028,5.04900441 C60.1186772,5.04895117 60.0852446,5.04892133 60.051805,5.04892133 C29.6761437,5.04892133 5.05180496,29.6732601 5.05180496,60.0489213 C5.05180496,90.4245826 29.6761437,115.048921 60.051805,115.048921 C90.4274662,115.048921 115.051805,90.4245826 115.051805,60.0489213 C115.051805,38.7813657 102.980666,20.3331757 85.3160283,11.1819915 L87.5794617,6.70020519 Z" id="Oval-3" fill="#F7F7F7"></path>
<path class='red' d="M83.3722284,4.90439647 C77.6658734,2.48716934 71.5078907,0.927819435 65.0600208,0.388087409 L64.6846019,5.41901478 C70.6409793,5.91711182 76.3275409,7.36440406 81.5925593,9.60916405 L83.3722284,4.90439647 Z" id="Oval-4" fill="#F04444"></path>
</g>
</g>
</g>
</g>
</svg>
</div>
<p>Capture</p>
</header>
<form action="" class="form">
<fieldset>
<label class="form__label" for="">EMAIL</label>
<input class="form__input" type="text" placeholder="Enter email address" required />
</fieldset>
<fieldset>
<label class="form__label" for="">USERNAME</label>
<input class="form__input" type="text" placeholder="Enter username" required />
</fieldset>
<fieldset>
<label class="form__label" for="">PASSWORD</label>
<input class="form__input" type="text" placeholder="Enter password" required />
</fieldset>
<input class="form__submit is-btn-hovered" type="submit" value="CREATE ACCOUNT">
</form>
<div class="connect">
<p>connect with <span class="fa fa-twitter connect__icon is-btn-txt"></span><span class="fa fa-facebook-official connect__icon is-btn-txt"></span></p>
</div>
<div class="account">
<p>ALREADY HAVE ACCOUNT?<span class="is-btn-txt">sign in</span></p>
</div>
</section>
@import url(https://fonts.googleapis.com/css?family=Open+Sans|PT+Serif:400,700);
$text-font: 'Open Sans', sans-serif;
$logo-font: 'PT Serif', serif;
$pg-bg: #bfbfbf;
$transparent-bg: rgba(#EEEEEE, .9);
$special-color: #b19a9a;
$special-hov-color: #906f6f;
@mixin center(){
margin-right:auto;
margin-left:auto;
}
/*************
Base
**************/
html, body{
width:100%;
height:100%;
box-sizing:border-box;
font-family: $text-font;
background:$pg-bg;
}
*, *:before, *:after{
box-sizing:border-box;
}
*:focus {
outline: none;
}
fieldset{
border: none;
}
input[type=submit]{
border:none;
font-size:1em;
}
/*************
Layout
**************/
.l-container{
margin-top:20px;
@include center;
width:400px;
height:695px;
box-shadow: 0 0 55px rgba(black, .6);
background:url(https://dl.dropboxusercontent.com/u/11530795/background_image.jpg),linear-gradient(-140deg, rgba(#4682B4, .5), black);
background-blend-mode:darken;
overflow:hidden;
}
/*************
Modules
**************/
.header{
padding-top:10px;
width:inherit;
height:160px;
text-align:center;
color:white;
font-family: $logo-font;
font-weight:100;
font-size:34px;
text-transform:uppercase;
letter-spacing: 2px;
.logo{
@include center;
padding-top:15px;
width:300px;
height:145px;
}
}
.form{
display:flex;
flex-direction:column;
margin-top:90px;
@include center;
width:225px;
height:370px;
border-radius:2px;
background:$transparent-bg;
&__label{
margin-top:10px;
font-size:12px
}
&__input{
margin-top:10px;
@include center;
padding-bottom:20px;
width:200px;
font-size:11px;
border: 0;
outline: 0;
border-bottom:1px solid $special-color;
background:transparent;
}
&__submit{
margin-top:10px;
@include center;
padding:10px 20px;
width:200px;
font-size: 13px;
color:white;
background: $special-color;
}
}
.connect{
margin-top:-55px;
@include center;
width:200px;
height:50px;
font-size:13px;
text-align:center;
&__icon{
margin-left:30px;
font-size:20px;
color:$special-color;
}
}
.account{
padding-left:15px;
@include center;
width:225px;
height:45px;
font-size: 10px;
line-height:45px;
border-radius:2px;
background:$transparent-bg;
span{
margin-left:25px;
font-size: 13px;
color:$special-color;
}
}
.circle{
stroke:none;
fill:none;
}
.red{
visibility: hidden;
}
/*************
states
**************/
.is-btn-hovered:hover{
background: $special-hov-color;
}
// variables
$(document).ready(function(){
var logo = $('.logo'),
logoName = $('.header p'),
form = $('form'),
fields = $('fieldset'),
submit = $('.form__submit'),
connect = $('.connect'),
account = $('.account'),
circle = $('.circle'),
red = $('.red'),
tl = new TimelineMax();
//animations
tl.from(logoName, .4,{y:-70, autoAlpha:0, ease:Sine.easeOut})
.from(form, .3,{y:-50, autoAlpha:0, ease:Sine.easeOut})
.staggerFrom(fields, .3, {y:-10, autoAlpha:0, ease:Sine.easeOut})
.from(submit, .3,{y:-50, autoAlpha:0, ease:Sine.easeOut})
.from(connect, .3,{y:-50, autoAlpha:0, ease:Sine.easeOut})
.from(account, .3,{y:-50, autoAlpha:0, ease:Sine.easeOut})
.fromTo(circle, 3, {drawSVG:0 }, {stroke:'white', drawSVG:"100%", ease:Sine.easeOut}, "-=1")
.fromTo(circle, .9,{drawSVG:0 }, {fill:'white', drawSVG:"102%", delay:0.5 })
.to(red, 1, {autoAlpha:1, ease:Linear.easeNone})
})
Also see: Tab Triggers