Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

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.

+ add another resource

Packages

Add Packages

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.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                .form
	form(action="/" method="POST") 
		.back 
			span
				i(class="fa fa-arrow-circle-left" aria-hidden="true")
		h3
			| Enter your credentials
		.inputs 
			.email
				input.first(type="text" placeholder="Your email")
				button.next
					| Next
			.password
				input.second(type="password" placeholder="Enter Password")
				button.login
					| Log in

p.warning

	
              
            
!

CSS

              
                body 
	padding 0
	margin 0
	height 100vh
	background -webkit-linear-gradient(white 0% , #F2F7FF 100%)
	font-family sans-serif
	-webkit-font-smoothing antialiased
	
.active-back
	color #69748A + 40 !important
	&:hover
		cursor pointer
		color #286EFA !important
		
.back
	position absolute
	height 20px
	width 40px
	color #C2C6D0 + 20
	display block
	transition .3s
	margin-left 20px
	margin-top -30px
	font-size 24px

.shift
	left -330px !important

h3
	position absolute
	margin-left 88px
	margin-top 80px
	font-size 22px
	font-weight 200
	color #4F5C76

input
	width 250px
	height 35px
	border-radius 3px
	border 1px solid #CCCCCC
	font-size 14px
	padding-left 10px
	transition .3s
	&::-webkit-input-placeholder
		font-size 14px
	&:focus
		border 1px solid #286EFA !important
		outline-width 0
button
	margin-top 30px
	width 262px
	height 40px
	background #286EFA
	color white
	font-size 14px
	border 1px solid #286EFA
	border-radius 3px
	&:hover
		background #286EFA + 20
		cursor pointer
	
.form
	position relative
	margin 0 auto
	margin-top 100px
	width 400px
	height 400px
	background white
	box-shadow 0px 5px 80px 0px #E4E8F0
	border-radius 5px
	overflow hidden
	form
		margin-top 50px
		width 750px
		.inputs
			position relative
			left 65px
			top 150px
			transition .3s
			.email
				float left
				position relative
				width 350px
			.password
				float right
				position relative
				width 350px
.warning
	color red
	text-align center
	font-size 15px
	margin-top 30px
.loader
	margin-left 22%
	margin-top 22%
	width 50px
	height 50px
	border-radius 50%
	border 5px solid #EDF0F6 - 5
	border-top-color #286EFA
	animation spinner 1s infinite linear

	
@keyframes spinner
	0%
		transform rotate(0deg)
	100%
		transform rotate(360deg)
		


			
              
            
!

JS

              
                setTimeout(() => {
	$('.email > input').focus()
}, 300)

$('.email > input').on('keydown', (event) => {
	if (event.which === 13 || event.keyCode === 13) {
		$('.email > input').blur()
		$('.next').click()
	}
})

$('.password > input').on('keydown', (event) => {
	if (event.which === 13 || event.keyCode === 13) {
		$('.login').click()
	}
})

$('.next').on('click', (event) => {
	let emailInput = $('.email > input').val()
	if (validateEmail(emailInput)) {
		event.preventDefault()
		$('.inputs').addClass('shift')
		$('.back').addClass('active-back')
		$('.email > input').css({
			'border': '1px solid #cccccc'
		})
		$('.warning').empty()
		setTimeout(() => {
			$('.password > input').focus()
		}, 400)

	} else {
		event.preventDefault()
		$('.warning').empty()
		$('.email > input').css({
			'border': '1px solid red'
		})
		$('.warning').append('Invalid Email Address')

	}
})

$('.back').on('click', (event) => {
	event.preventDefault()
	$('.inputs').removeClass('shift')
	$('.back').removeClass('active-back')
	setTimeout(() => {
		$('.email > input').focus()
	}, 300)
})

$('.login').on('click', (event) => {
	event.preventDefault()
	$('form').empty()
	$('form').append('<div class="loader"></div>')
	setTimeout(() => {
		location = location
	}, 2000)
})

const validateEmail = (email) => {
	var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
	return re.test(email)
}
              
            
!
999px

Console