Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ 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

Auto Save

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

              
                .iphone
	.border
		.top-left
		.top-right
		.bottom-left
		.bottom-right
		.top
		.bottom
		.left
		.right
	.mute.aside-btn
	.volume-plus.aside-btn
	.volume-minus.aside-btn
	.block-button.aside-btn
	.front-body
		.front-cam
		.speaker
		.home-button
		.screen
			.content
				.operator
					.level
						.level-item
						.level-item
						.level-item
						.level-item
						.level-item
					.name T-Mobile
				.battery
					.percentage 58%
					.level
				.time 17:57
				.date Thursday, August 25
				.slideToUnlock slide to unlock
					.arrow
				.showBottomPanel
				.camera
              
            
!

CSS

              
                html, body {
	width: 100%;
	height: 100%;
}

body{
	background-image: url('https://wallpaperaccess.com/full/91412.jpg');
	background-size: cover;
	font-size: 118px;
}

@import 'https://fonts.googleapis.com/css?family=Roboto:100';

.iphone{
	$border-from: #a1a2a8;
	$border-to: #6e6f75;
	$button-from: #66656f;
	$button-to: #c5c8cc;
	
	transition: transform .5s;
	position: absolute;
	margin: auto;
	top: 0;left: 0;right: 0;bottom: 0;
	width: 3.16em;
	height: 6.32em;
	box-sizing: border-box;
	box-shadow: -.3em .1em .4em .05em rgba(0,0,0,0.75);
	border-radius: .4em;

	.front-body{
	position: absolute;
	margin: auto;
	top: 0;bottom: 0;left: 0;right: 0;
	background-color: #000000;
	background-image: (linear-gradient(top, #080808 0%, #000000 100%));
	width: 3.06em;
	height: 6.22em;
	border-radius: .36em;
	overflow: hidden;
		
	&:after{
		content: "";
		position: absolute;
		margin: auto;
		top: -1em;
		left: 1.83em;
		width: 5em;
		height: 4em;
		background: linear-gradient(to bottom, rgba(255,255,255,.3) 0%,rgba(255,255,255,0) 100%);
		transform: rotate(-17deg);
	}	
}

	.border{
		position: absolute;
		margin: auto;
		top: 0;bottom: 0;left: 0;right: 0;
		width: 3.16em;
		height: 6.32em;
		border-radius: .4em;
		
		.top{
			position: absolute;
			top: 0;
			right: 0;
			left: 0;
			margin: auto;
			width: 2.35em;
			height: .1em;
			background-image: (linear-gradient(to top, $border-from 0%, $border-from 50%, $border-to 100%));
		}
		.bottom{
			position: absolute;
			bottom: 0;
			right: 0;
			left: 0;
			margin: auto;
			width: 2.35em;
			height: .1em;
			background-image: (linear-gradient(to bottom, $border-from 0%, $border-from 50%, $border-to 100%));
		}
		.left{
			position: absolute;
			left: 0;
			top: 0;
			bottom: 0;
			margin: auto;
			width: .1em;
			height: 5.5em;
			background-image: (linear-gradient(to left, $border-from 0%, $border-from 50%, $border-to 100%));
		}
		.right{
			position: absolute;
			right: 0;
			top: 0;
			bottom: 0;
			margin: auto;
			width: .1em;
			height: 5.5em;
			background-image: (linear-gradient(to right, $border-from 0%, $border-from 50%, $border-to 100%));
		}
		.top-left,
		.top-right,
		.bottom-left,
		.bottom-right{
			position: absolute;
			border-radius: 50%;
			width: .76em;
			height: .76em;
			background: radial-gradient(ellipse at center, #a7a9af 0%,#a7a9af 62%,#66676e 70%,#66676e 100%);
		}
		.top-left{
			top: 0;
			left: 0;
		}
		.top-right{
			top: 0;
			right: 0;
		}
		.bottom-left{
			bottom: 0;
			left: 0;
		}
		.bottom-right{
			bottom: 0;
			right: 0;
		}
}

	.speaker{
		background-color: #3f3f40;
		width: .43em;
		height: .05em;
		border-radius: .025em;
		position: absolute;
		left: 0;right: 0;top: .35em;
		margin: auto;
		z-index: 1;
		&:before{
			content: "";
			position: absolute;
			left: 0;right: 0;top: 0;bottom: 0;
			margin: auto;
			background-color: #3f3f40;
			box-shadow: 0 -.003em .005em .005em rgba(0,0,0,.25);
			width: .3em;
			height: 0;
		}
}

	.front-cam{
		width: .12em;
		height: .12em;
		background-image: (linear-gradient(right bottom, #767676 0%, #222222 100%));
		border-radius: 50%;
		position: absolute;
		top: .31em;
		left: 1em;
		margin: auto;
		&:before, &:after{
			content: "";
			border-radius: 50%;
			position: absolute;
			left: 0;right: 0;top: 0;bottom: 0;
			margin: auto;
			border-radius: 50%;
		}
		&:before{
			width: .06em;
			height: .06em;
			background-image: (linear-gradient(right bottom, #0d1b40 0%, #1b3267 100%));
			box-shadow: .01em .01em .005em rgba(0,0,0,.3);
		}
		&:after{
			width: .03em;
			height: .03em;
			opacity: .3;
			border-color: transparent;
			border-top: 1px solid #ffffff;
		}
}

	.screen{
		position: absolute;
		width: 2.7em;
		height: 4.8em;
		//background-color: #111111;
		background-image: url('https://wallpaperaccess.com/full/91412.jpg');
		background-size: cover;
		margin: auto;
		left: 0;right: 0;top: 0;bottom: 0;
		font-family: 'Roboto', sans-serif;
		color: #ffffff;
		
		.content{
			position: absolute;
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			z-index: 2;
			
			.operator, .battery{
				font-size: .12em;
			}
			
			.operator{
				margin-top: .2em;
				margin-left: .4em;
				float: left;
				
				.name{
					vertical-align: middle;
					position: relative;
					display: inline-block;
				}
				
				.level{
					vertical-align: middle;
					position: relative;
					display: inline-block;
					
					&-item{
						width: .4em;
						height: .4em;
						background-color: #ffffff;
						border-radius: 50%;
						display: inline-block;
						border: 1px solid #ffffff;
						&:nth-child(3), &:nth-child(4), &:nth-child(5){
							background-color: transparent;
						}
					}
				
				}
			}
			
			.battery{
				margin-top: .2em;
				margin-right: .5em;
				float: right;
				
				.percentage, .level{
					display: inline-block;
					position: relative;
					vertical-align: middle;
					height: 12px;
				}
				
				.level{
					width: 1.6em;
					height: .74em;
					background-color: transparent;
					border: 1px solid #ffffff;
					border-radius: .15em;
					margin-left: .1em;
					
					&:before, &:after{
						content: "";
						background-color: #ffffff;
						position: absolute;
						top: 0; bottom: 0;
						margin: auto;
					}
					
					&:before{
						width: .68em;
						height: .66em;
						left: .06em;
						border-top-left-radius: .1em;
						border-bottom-left-radius: .1em;
					}
					
					&:after{
						width: .1em;
						height: .35em;
						right: -.2em;
						border-top-right-radius: .4em;
						border-bottom-right-radius: .4em;
					}
					
				}
				
			}
			
			.time{
				text-align: center;
				font-size: .6em;
				margin-top: .8em;
			}
			
			.date{
				text-align: center;
				font-size: .15em;
				margin-top: 0;
			}
			
			.slideToUnlock{
				position: absolute;
				left: 53%;
				transform: translateX(-50%);
				margin: auto;
				font-size: .15em;
				text-align: center;
				bottom: 2em;
				
				.arrow{
					position: absolute;
					left: -1.6em;
					top: 0;
					bottom: 0;
					margin: auto;
					height: 1.4em;
					animation: slideToUnlock-arrow 1s linear infinite;
					&:before, &:after{
						content: "";
						background-color: #ffffff;
						width: .1em;
						height: .81em;
						position: absolute;
						right: 0;
					}
					&:before{
						top: 0;
						transform: rotate(-40deg);
					}
					&:after{
						bottom: 0;
						transform: rotate(40deg);
					}
				}
				
			}
			
		}
		
	}

	.home-button{
		position: absolute;
		width: .44em;
		height: .44em;
		background-image: (linear-gradient(bottom, #303030 0%, #303030 10%, #7a7a7a 30%, #7a7a7a 40%, #303030 50%, #303030 100%));
		border-radius: 50%;
		left: 0;right: 0;
		bottom: .14em;
		margin: auto;

		&:before{
			content: "";
			position: absolute;
			top: .02em;
			left: .02em;
			border-radius: 50%;
			width: .4em;
			height: .4em;
			background-color: #000000;
		}

}

	.aside-btn{
		position: absolute;
		height: .5em;
		width: .03em;
		background-image: (linear-gradient(to left, $button-from 0%, $button-from 30%, $button-to 60%));
	}

	.block-button{
		top: 1.4em;
		right: -.03em;
		border-top-right-radius: .8em;
		border-bottom-right-radius: .8em;
		background-image: (linear-gradient(to right, $button-from 0%, $button-from 30%, $button-to 60%));
}

	.mute{
		top: .73em;
		left: -.03em;
		height: .25em;
		border-top-left-radius: .8em;
		border-bottom-left-radius: .8em;
}

	.volume-plus, .volume-minus{
		top: 1.4em;
		left: -.03em;
		border-top-left-radius: .8em;
		border-bottom-left-radius: .8em;
}

	.volume-minus{
		top: 2.1em;
}
	
	@keyframes slideToUnlock-arrow{
		0%{
			transform: translateX(-.2em);
		}
		50%{
			transform: translateX(.2em);
		}
		100%{
			transform: translateX(-.2em);
		}
	}
	
}
              
            
!

JS

              
                
              
            
!
999px

Console