Pen Settings



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


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


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.


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.



  <title>Lightbox Example</title>

  <script async src=""></script>
  <link href="" rel="stylesheet" type="text/css">

  <link href=";display=swap" rel="stylesheet">
  <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">

  <div class="viewport">
    <div class="fake-content"></div>
    <div class="entry-point-container">
      <h1> Web Stories </h1>
      <div class="circular-entry-point">
        <div class="entry-points">
          <div class="entry-point-card-container">
            <img src="" style="border-color:#FF6F32">
            <span class="entry-point-card-title">Q&A with ZOE Newman</span>
          <div class="entry-point-card-container">
            <img src="" style="border-color:#E6AD1C">
            <span class="entry-point-card-title">24 Hours in New York City</span>
          <div class="entry-point-card-container">
            <img src="" style="border-color:#466FFF">
            <span class="entry-point-card-title">The Next King of the Sea</span>
          <div class="entry-point-card-container">
            <img src="" style="border-color:#4CA47C">
            <span class="entry-point-card-title">Spark a Passion for Reading</span>
    <div class="fake-content"></div>

    <div class="lightbox">
      <amp-story-player class="my-player">
        <script type="application/json">
            "behavior": {
              "autoplay": false,
              "pageScroll": false
            "controls": [{
              "name": "close",
              "position": "start"

        <a href=""></a>
        <a href=""></a>
        <a href=""></a>
        <a href=""></a>



                .entry-point-container {
  margin-top: 40px;
  margin-bottom: 50px;

.entry-point-card-title {
  margin-top: 10px;
  font-weight: 500;
  font-family: Poppins;
  font-size: 11px;
  line-height: 15px;
  text-align: center;
  display: inline-block;
  color: #fff;

.lightbox {
  position: absolute;
  background-color: rgb(0, 0, 0, 0.7);
  z-index: -99999;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  opacity: 0;
  visibility: hidden;
  transition: visibility 0.2s linear, opacity 0.2s linear;
} {
  visibility: visible;
  z-index: 99999;
  opacity: 1;
} {
  width: 100%;
  height: 100%;
  /*   margin: 70px auto; */

.entry-points {
  width: 100%;
  display: flex;
  left: -20px;
  padding: 0px 60px;
  padding-bottom: 10px;

.circular-entry-point img {
  cursor: pointer;
  width: 100px;
  height: 100px;
  border-radius: 100%;
  background-clip: content-box;
  border: 2px solid;
  padding: 3px;

.entry-point-card-container {
  position: relative;
  padding-right: 25px;
  transition: transform 0.3s;

/* Extra stuff that makes sample aesthetic. */

body h1 {
  font-weight: 600;
  font-size: 18px;
  line-height: 27px;
  color: white;
  font-family: Poppins;
  margin-bottom: 35px;
  margin-left: 20px;

.fake-content {
  width: 320px;
  height: 427px;
  top: -178px;
  margin: auto;

  background: #24242d;
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.2);
  border-radius: 16px;

.viewport {
  position: absolute;
  display: flex;
  flex-direction: column;
  /*   border-radius: 10px; */
  padding: 20px;
  margin: auto;
  width: 360px;
  height: 800px;
  background-color: #202029;
  overflow: hidden;



                const player = document.body.querySelector("amp-story-player");
const lightboxEl = document.querySelector(".lightbox");

if (player.isReady) {
} else {
  player.addEventListener("ready", () => {

function initializeCarousel() {
  const stories = player.getStories();

  const thumbnails = document.querySelectorAll(
    ".entry-point-card-container img"

  thumbnails.forEach((img, idx) => {
    img.addEventListener("click", () => {[idx].href);;

player.addEventListener("amp-story-player-close", () => {