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

              
                <!--Disclaimer: This CodePen is provided for instructional purposes only. Vidyard cannot support or guarantee any dependencies on third-party code or libraries such as JavaScript, jQuery or CSS-->

<!--GDPR Consent Banner - v1.1. Created by Chris Broughton - Last modified Dec 2022-->

<script type="text/javascript" async src="https://play.vidyard.com/embed/v4.js"></script>  

<div class="player">
  <img
    style="width: 100%; margin: auto; display: block;"
    class="vidyard-player-embed"
    src="https://play.vidyard.com/woZzcBfj8ruda19xMLjrSg.jpg"
    data-uuid="woZzcBfj8ruda19xMLjrSg"
    data-v="4"
    data-type="inline"
    data-width="640"
    data-height="360"
  />
</div>

<div class="gdpr-banner hidden" id="gdpr-consent-banner">
    <div><br/><br/><br/><br/><br/><br/><br/><br/>By clicking “Accept”, you agree to the storing of cookies on your device to track how you interact with our website. <a href="YOUR COOKIE POLICY HERE">Cookie Policy</a><br/><br/></div>
    <button id="decline-consent">Decline</button>&nbsp;&nbsp;&nbsp;
    <button id="provide-consent">Accept</button>
  <button class="close-banner cancel"><span aria-hidden="true">&times;</span></button><br/><br/><br/><br/><br/><br/><br/><br/>
</div>

<div class="gdpr-banner hidden" id="gdpr-revoke-banner">
  <div class="revoke-text">You have previously accepted the use of cookies. Would you like to revoke this choice?</div>
    <button class="close-banner">Cancel</button>
    <button id="revoke-consent">Revoke</button>
  <button class="close-banner cancel"><span aria-hidden="true">&times;</span></button>
</div>


              
            
!

CSS

              
                .player {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.gdpr-banner {
    position: fixed;
    z-index: 10000;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    background: #111111;
    margin-bottom: 10px;
    padding: 5px 0 5px 0;
    color: white;
    font-family: sans-serif;
    font-size: 12px;
    opacity: 0.9;
    visibility: visible;
    transition: all 0.2s;
}

.gdpr-banner div {
    display: inline;
}

.gdpr-banner.hidden {
    opacity: 0;
    visibility: hidden;
}

button {
    background: rgba(0, 0, 0, 1);
    display: inline;
    color: white;
    border: solid;
    font: inherit;
    outline: none;
    font-size: 14px;
    border-radius: 20px;
    padding: 8px 10px;
    margin: 5px 2px;
    transition: all 0.2s;
}

button:hover {
    background: rgba(33, 33, 33, 1);
    cursor: pointer;
}

.close-banner {
    margin-left: 30px;
    margin-right: 10px;
}

.cancel {
    float: right;
    width: 20px;
    height: 20px;
    position: absolute;
    border-radius: 0px;
    padding: 0px;
    top: 0;
    right: 0;
    margin: 1px;
    border: none;
}

a {
    color: white
}
              
            
!

JS

              
                document.addEventListener('DOMContentLoaded', function() {
  var consentBanner = document.getElementById("gdpr-consent-banner");
  var revokeBanner = document.getElementById("gdpr-revoke-banner");

  function grantConsent() {
    VidyardV4.api.GDPR.consent(true);
    closeBanner();
  }

  function revokeConsent() {
    VidyardV4.api.GDPR.consent(false);
    closeBanner();
  }

  function closeBanner() {
    consentBanner.classList.add('hidden');
    revokeBanner.classList.add('hidden');
  }

  function listenForButtons() {
    [...document.getElementsByClassName('close-banner')].forEach(btn => btn.addEventListener('click', closeBanner));
    document.getElementById('provide-consent').addEventListener('click', grantConsent);
    document.getElementById('revoke-consent').addEventListener('click', revokeConsent);
  document.getElementById('decline-consent').addEventListener('click', revokeConsent);
  }
  listenForButtons();

  window['onVidyardAPI'] = function() {
    VidyardV4.api.GDPR.hasConsentOnReady((hasConsent) => {
      if (hasConsent) {
        revokeBanner.classList.remove('hidden');
      } else {
        consentBanner.classList.remove('hidden');
      }
    });
  }
});

              
            
!
999px

Console