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

              
                <body class="dark-theme">

    <div class="video-background">

        <div class="video-foreground">

            <iframe src="https://www.youtube.com/embed/bog4VzMWP20?controls=0&showinfo=0&rel=0&autoplay=1&loop=1&mute=1&playlist=bog4VzMWP20" frameborder="0" allowfullscreen tabindex="-1"></iframe>

            <h1 class="knockout-text">glide</h1>

        </div>

    </div>

    <button class="theme-btn">Switch to <span class="theme-type">Light</span> Theme</button>

    <!-- External JavaScript File -->
    <script src="/js/main.js"></script>

</body>
              
            
!

CSS

              
                * {
	box-sizing: border-box;
}

body {
	font-family: Arial, sans-serif;
    height: 100vh;
	overflow: hidden;
}

/* Video */

.video-background {
  background: url(https://images.unsplash.com/photo-1519373344801-14c1f9539c9c?w=1920&h=1080&fit=crop&crop=bottom) no-repeat center;
  background-size: cover;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
}
.video-foreground,
.video-background iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@media (min-aspect-ratio: 16/9) {
  .video-foreground {
	  height: 300%;
	  top: -100%;
  }
}

@media (max-aspect-ratio: 16/9) {
  .video-foreground {
	  width: 300%;
	  left: -100%;
  }
}

/* Knockout Text */

.knockout-text {
	position: absolute;
	top: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	height: 100%;
    font-size: calc(10px + 13vw + 2.5vh);
	font-weight: 900;
	letter-spacing: 0.15em;
    margin: auto;
	text-transform: uppercase;
	user-select: none;
    -webkit-text-stroke-color: #9f9f9f;
	-webkit-text-stroke-width: 0.015em;	
}

.light-theme .knockout-text {
	background-color: #fff;
    color: #000;
    mix-blend-mode: screen;
}

.dark-theme .knockout-text {
	background-color: #000;
    color: #fff;
    mix-blend-mode: multiply;
}

/* Change Theme Button */

.theme-btn {
	position: absolute;
	top: 1em;
	left: 1em;
	font-family: inherit;
	font-size: calc(15px + 0.1vw + 0.5vh);
	border-width: 0.15em;
	border-style: solid;
	border-radius: 0.8em;
	background-color: transparent;
	margin: 0 auto;
	padding: 0.8em 1.2em;
	cursor: pointer;
	outline: none;
	white-space: nowrap;
	user-select: none;
}

.light-theme .theme-btn {
	color: #1a1a1a;
	border-color: #1a1a1a;
}

.dark-theme .theme-btn {
	color: #eee;
	border-color: #eee;
}

              
            
!

JS

              
                //JavaScript to switch theme classes only

//DOM load event
window.addEventListener("DOMContentLoaded",	() => {

    const themeButton = document.querySelector('.theme-btn'),
          themeType = document.querySelector('.theme-type');

    themeButton.addEventListener('click', () => {

        //Apply theme
        if (document.body.classList.contains('light-theme')) {

            //Remove light theme
            document.body.classList.remove('light-theme');

            //Add dark theme
            document.body.classList.add('dark-theme');

            //Set button text
            themeType.textContent = 'Light';

        } else {

            //Remove dark theme
            document.body.classList.remove('dark-theme');

            //Add light theme
            document.body.classList.add('light-theme');

            //Set button text
            themeType.textContent = 'Dark';

        }
    })
});
              
            
!
999px

Console