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.

Mit der 2-Klick-Lösung kannst du deinen Benutzern auf die Datenschutzbestimmungen hinweisen, bevor er ein YouTube-Video oder Google Maps ansieht. 

Die komplette Erklärung zum Skript findest du auf Codepalm: 

<div class="video_wrapper" style="background-image: url( 'https://images.unsplash.com/photo-1483959651481-dc75b89291f1?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjE0NTg5fQ' );">
	<div class="video_trigger" data-source="aqz-KE-bpKQ">
		<p class="text-center">Mit dem Aufruf des Videos erklärst Du Dich einverstanden, dass Deine Daten an YouTube übermittelt werden und das Du die <a href="#datenschutz" target="_blank">Datenschutzerklärung</a> gelesen hast.</p>
		<input type="button" class="btn" value="Akzeptieren" />
	<div class="video_layer"><iframe src="" border="0"></iframe></div>
              /* Video Wrapper */
.video_wrapper {
	background-image: url( 'bg_image.jpg' );
	background-size: cover;
	position: relative;
	box-shadow: 0px 3px 5px #333;
	height: 400px;
	width: 100%;
.video_wrapper .video_trigger:before {
	content: '\f04b';
	font-family: 'FontAwesome';
	position: absolute;
	z-index: -1;
	font-size: 120px;
	color: rgba( 255, 255, 255, .2 );
	width: 120px;
	height: 120px;
	line-height: 120px;
	text-align: center;
	top: -webkit-calc( 50% - 60px );
	top: calc( 50% - 60px );
	left: -webkit-calc( 50% - 60px );
	left: calc( 50% - 60px );
.video_wrapper .video_trigger {
	padding: 130px 30px;
	height: -webkit-calc( 100% - 260px );
	height: -moz-calc( 100% - 260px );
	height: -o-calc( 100% - 260px );
	height: calc( 100% - 260px );
	width: -webkit-calc( 100% - 60px );
	width: -moz-calc( 100% - 60px );
	width: -o-calc( 100% - 60px );
	width: calc( 100% - 60px );
	position: absolute;
	bottom: 0;
	z-index: 9;
	background-color: rgba( 0, 0, 0, .8 );
	color: #fff;
.video_wrapper .video_layer {
	position: relative;
	display: none;
	height: inherit;
	width: inherit;
	margin: auto;
.video_wrapper .video_layer iframe {
	border: 0px none transparent;
	height: inherit;
	width: inherit;

/* Button */
.btn {
  cursor: pointer;
  display: inline-block;
  transition: color .5s, background-color .5s, border .5s;
  padding: 8px 16px;
  font-size: 16px;
  border: 1px solid #ffffff;
.btn:hover {
  background-color: transparent;
  color: #ffffff;
              (function($) {
	$( document ).ready( function() {
		if( $( '.video_wrapper' ).length > 0 ) {
			$( '.video_wrapper' ).each( function() {
				_wrapper = $( this );
				_wrapper.children( '.video_trigger' ).children( 'input[type="button"]' ).click( function() {
					var _trigger = $( this ).parent();
					_trigger.siblings( '.video_layer' ).show().children( 'iframe' ).attr( 'src', 'https://www.youtube-nocookie.com/embed/' + _trigger.attr( 'data-source' ) + '?rel=0&controls=0&showinfo=0&autoplay=1&mute=1' );
🕑 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.