JSFiddle - React, Tailwind, and code Playground

by Ketan Patel

HTML

<!doctype html>
<html ⚡>
<head>
  <meta charset="utf-8">
  <title>amp-lightbox</title>
  <script async src="https://cdn.ampproject.org/v0.js"></script>
  <!-- ## Setup -->
  <!-- Import the amp-lightbox component in the header -->
  <script async custom-element="amp-lightbox" src="https://cdn.ampproject.org/v0/amp-lightbox-0.1.js"></script>
  <script async custom-element="amp-youtube" src="https://cdn.ampproject.org/v0/amp-youtube-0.1.js"></script>
  <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
  
  <style amp-custom>
    .lightbox {
      background: rgba(0,0,0,0.8);
      width: 100%;
      height: 100%;
      position: absolute;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .lightbox h1 {
      color: white;
    }
  </style>
</head>
<body>
  <amp-lightbox id="my-lightbox" layout="nodisplay">
    <div class="lightbox" on="tap:my-lightbox.close" role="button" tabindex="0">
      <amp-youtube
    data-videoid="mGENRKrdoGY"
    layout="fixed"
    width="480" height="270" autoplay></amp-youtube>
    </div>
  </amp-lightbox>
  <button class="ampstart-btn caps m2" on="tap:my-lightbox" role="button" tabindex="0">
    Open lightbox
  </button>
</body>
</html>