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 style="width: 300px; height: 600px; background-color: #666; overflow: hidden; font-family: 'Montserrat', sans-serif; position: relative;">
  <video id="video" src="https://hypebeast.com/image/2021/09/0803_LXS_TEASER_01_9x161.mp4" autoplay muted playsinline loop style="object-fit: cover; height: 100%;"></video>

  <div class="sound-control">
    <button>
      <span class="material-icons vol-off"> volume_off </span>
      <span class="material-icons vol-on"> volume_up </span>
    </button>
  </div>
  
  <div class="content" style="display: flex; position: absolute; bottom: 0; left: 0; width: 100%; align-items: flex-end; color: #FFF;">

    <div class="meta" style="width: 100%; padding: 15px;">
      <p class="brand" style="font-weight: 500;">@QuoteWizard</p>
      <p class="message" style="margin-top: 6px; font-size: 13px;">Enter model, See Savings</p>
      <p class="tag" style="margin-top: 6px; background-color: rgba(255, 255, 255, 0.4); font-size: 10px; display: inline-block; border-radius: 2px; padding: 2px 4px;">Sponsored</p>
    </div>

    <div class="sidebar" style="padding: 15px; text-align: center; line-height: 1; display: grid; grid-auto-flow: row; grid-row-gap: 10px;">
      <div>
        <div class="border-bg">
          <img style="width: 70px; border-radius: 100%; margin: 0 auto; display: block;" src="https://hypebeast.com/image/2021/08/hypebeast-2021.jpg">
        </div>
      </div>

      <div style="margin-top: 10px;">
        <span class="material-icons" style="font-size: 30px;">favorite</span>
        <p style="font-size: 12px;">43</p>
      </div>

      <div style="margin-top: 10px;">
        <span class="material-icons" style="font-size: 30px;"> message </span>
        <p style="font-size: 12px;">23</p>
      </div>

      <div>
        <span class="material-icons" style="font-size: 35px; transform: rotateY(180deg);">reply</span>
        <p style="font-size: 12px;">75</p>
      </div>

      <div style="margin-top: 10px;">
        <div class="border-bg" style="width: 50px; height: 50px; margin: 0 auto; border-radius: 100%; background-color: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center;">
          <img class="animate-brand" style="width: 70%; transform: rotate(0deg); will-change: transform; display: block; border-radius: 100%;" src="https://hypebeast.com/image/2021/08/hypebeast-2021.jpg">
        </div>
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                .sound-control {
  position: absolute; 
  top: 20px; 
  right: 20px;   
  color: #FFF;
  
  button {
    .vol-on {
      display: none;
    }
    
    &:hover {
      opacity: 0.6;
    }
  }
  
  &.active {
    button {
      .vol-on {
        display: initial;
      }
      
      .vol-off {
        display: none;
      }
    }
  }
}

.animate-brand {
  animation: spin 3s infinite linear;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

              
            
!

JS

              
                var soundControl = document.querySelector(".sound-control");

var video = document.querySelector("#video");

soundControl.querySelector("button").addEventListener("click", function(e) {
  video.muted = !video.muted;
  soundControl.classList.toggle("active", !video.muted);
});

              
            
!
999px

Console