Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              
// Custom Jade Code Here
.container
	.checkboxes
		.check
			input(id="check" type="checkbox")
			label(for="check")
				.box
					i.fa.fa-check

		.check
			input(id="check1" type="checkbox")
			label(for="check1")
				.box
					i.fa.fa-check

		.check
			input(id="check2" type="checkbox")
			label(for="check2")
				.box
					i.fa.fa-check

		.check
			input(id="check3" type="checkbox")
			label(for="check3")
				.box
					i.fa.fa-check
				
				
				
	p This is updated version of checkboxes. Used css3 transform to achive better performance! Thank you for your <3.

            
          
!
            
              @import 'https://fonts.googleapis.com/css?family=Poiret+One'

$boxSize: 50

body
	background: #123456
	display: flex
	justify-content: center
	flex-direction: column
	align-items: center
	font-family: 'Poiret One', cursive
	color: #fff
	font-size: 100%
	height: 100vh

/* Custom Code Here */
.container
	max-width: 400px

	.checkboxes
		display: flex
		justify-content: center
		margin-bottom: 50px
	
		+ p
			text-align: center
	
	.check
		input
			display: none
	
			&:checked + label
				.box
					// old animation
					//animation: animOn 0.8s 1 forwards
					
					animation: animOnTransform 1s 1 forwards
					background: rgba(#000, 0.5)
		
					i
						transform: translate(-50%, -50%) scale(1)
						transition-duration: 200ms
						transition-delay: 400ms
						opacity: 1
	
		label
			min-width: 100px
			display: flex
			justify-content: center
			align-items: center
			flex-direction: row
			min-height: 60px
			cursor: pointer
			
			.box
				background: rgba(#000, 0.3)
				border-radius: 5px
				position: relative
				width: #{$boxSize}px
				height: #{$boxSize}px
				transition: background 300ms ease
		
				&:hover 
					background: rgba(#000, 0.5)
				
				i
					position: absolute
					top: 50%
					left: 50%
					font-size: 20px
					display: inline-block
					opacity: 0
					pointer-events: none
					transition: all 0.2s ease-in-out
					transition-delay: 200ms
					transform: translate(-50%, -50%) scale(4)
				
// old way
@keyframes animOn
	40%
		height: 20px
		width: 100px

	50%
		height: 60px
		width: 30px

	60%
		height: 40px
		width: 70px

	70%
		height: 55px
		width: 45px

	100%
		height: 50px
		width: 50px

// better way using transform (preformance enchance)

@keyframes animOnTransform
	40%
		transform: scale(1.5, 0.5)

	50%
		transform: scale(0.5, 1.5)

	60%
		transform: scale(1.3, 0.6)

	70%
		transform: scale(0.8, 1.2)

	100%
		transform: scale(1, 1)

/* end of custom code */

            
          
!
            
              $(document).ready(function(){
	console.log('ready!')
	// Custom jQuery Functions Here
})
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console