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

              
                <div class="mask-color"></div>
<div class="outter">
  <div class="bar">
    <nav>
      <div class="item"></div>
      <div class="item"></div>
      <div class="item"></div>
    </nav>
  </div>
</div>


              
            
!

CSS

              
                :root{
  --body: white; /*body color*/
  --bg: black; /*bg mask*/
  --bar: white; /*bar mask*/
  --nav-color: #8CCBBE; /*base color*/
}

body{
  height: 100vh;
  margin: 0;
  display: flex;
  background: var(--body);
/*   reset all inverts */
  filter: invert(1);
}

nav{
  width: 100%;
  height: 50px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--bar);
/*   give smooth edges */
  filter: blur(5px);
 
}

.outter{
  width: 50%;
  height: 150px;
  position: relative;
  margin: auto;
  background: var(--bg);
  box-sizing: border-box;
  padding: 10px;
/*   Remove some blur */
  filter: contrast(10);
}

.bar{
  position: absolute;
  width: 90%;
  bottom: 10px;
  background: var(--bg);
/*   Horizontal center */
  left: 50%;
  transform: translateX(-50%);
}

.item{
  width: 30px;
  height: 30px;
  background-color: inherit;
  border-radius: 50%;
}

.item:nth-of-type(1){
  animation: moveUp 1s ease-in-out alternate infinite;
}

.item:nth-of-type(2){
  animation: moveUp 1s ease-in-out .3s alternate infinite;
}

.item:nth-of-type(3){
  animation: moveUp 1s ease-in-out .5s alternate infinite;
}


.mask-color{
  width: 50%;
  height: 150px;
  position: absolute;
  background-color:  var(--nav-color);
/*   Absolute center */
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
/*   Place above the nav */
  z-index: 10;
/*   Apply color to mask */
  mix-blend-mode: multiply;
/*   Some magic for right color */
  filter: invert(1);
}

@keyframes moveUp{
  0%{
    transform: translateY(0%);
  }
  70%{
    transform: translateY(-200%);
  }
  100%{
    transform: translateY(-200%);
  }
}
              
            
!

JS

              
                // The idea comes from this video: 
// https://youtu.be/QM3z4IEc4I0
// And the base code idea from this:
// https://youtu.be/pfYvcAGcQgE

// I modified the code so I can make the bar different colors, and the background different colors.

// For now can only use color bar an white background or color background and white bar.

// Combinations
// white background + color bar
// --body: white
// --bg: black
// --bar: white
// --nav-color: what ever you want

// color background + white bar
// --body: what ever you want
// --bg: black
// --bar: white
// --nav-color: same as body
              
            
!
999px

Console