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

              
                <h1 class="heading">Live Screen Effect <span>using matrix3d()</span></h1>

<div class="laptop">

	<div class="screen-overlay">

		<iframe src="https://codepen.io/GeorgePark/embed/MqVoYP?default-tab=html%2Cresult&theme-id=dark" class="live-view" sandbox="allow-scripts allow-same-origin allow-pointer-lock"></iframe>

	</div>

</div>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Montserrat:500);

body {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 0 15px;
	background-color: #0a0a0a;
}

.heading {
	font-family: "Montserrat", Arial, sans-serif;
	font-size: 50px;
	font-weight: 500;
	line-height: 1.5;
	letter-spacing: 2.5px;
	padding: 30px 0;
	color: #fff;
	text-align: center;
	text-shadow: 2px 2px #000;
}

.heading span {
	display: block;
}

.laptop {
	box-sizing: border-box;
	width: 900px;
	max-width: 100%;
	height: 550px;
	margin: 0 auto;
	border: 5px solid #fff;
	border-radius: 10px;
	overflow: hidden;
	background-image: url(https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=1100&h=550&fit=crop&fp-y=.12);
}

.screen-overlay {
	width: 600px;
	height: 500px;
	background-color: #191919;

	/* Transform screen overlay to cover laptop screen image */
	transform: matrix3d(1.11008, 0.108202, 0, 0.000394192, 
						0.224001, 0.803852, 0, -8.80428e-05, 
						0, 0, 1, 0, 
						40, 34, 0, 1);
	transform-origin: 0 0 0;
}

.live-view {
	width: 200%;
	height: 200%;
	transform: scale(0.5);
	transform-origin: top left;

	/* Prevent user interaction with iframe content */
	/* pointer-events: none; */
}

              
            
!

JS

              
                /*

Full-page view:

https://codepen.io/GeorgePark/full/QQZXNy/

*/
              
            
!
999px

Console