Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

Save Automatically?

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="slideshow">

  <figure>
    <a id="a-classic" href="#a-classic">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/A classic.jpg" alt="A classic" title="A classic">
    </a>
  </figure>

  <figure>
    <a id="a-taste-of-italy" href="#a-taste-of-italy">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/A taste of Italy.jpg" alt="A taste of Italy" title="A taste of Italy">
    </a>
  </figure>

  <figure>
    <a id="apple-pie-exit" href="#apple-pie-exit">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Apple pie exit.jpg" alt="Apple pie exit" title="Apple pie exit">
    </a>
  </figure>

  <figure>
    <a id="aztec-motel" href="#aztec-motel">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Aztec motel.jpg" alt="Aztec motel" title="Aztec motel">
    </a>
  </figure>

  <figure>
    <a id="ballroom-entrance" href="#ballroom-entrance">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Ballroom entrance.jpg" alt="Ballroom entrance" title="Ballroom entrance">
    </a>
  </figure>

  <figure>
    <a id="best-of-both-worlds" href="#best-of-both-worlds">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Best of both worlds.jpg" alt="Best of both worlds" title="Best of both worlds">
    </a>
  </figure>

  <figure>
    <a id="big-fish" href="#big-fish">
      <img loading="lazy" width="961" height="649" src="https://cadars.github.io/photosheet/img/john-margolies/Big fish.jpg" alt="Big fish" title="Big fish">
    </a>
  </figure>

  <figure>
    <a id="budget-knight" href="#budget-knight">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Budget knight.jpg" alt="Budget knight" title="Budget knight">
    </a>
  </figure>

  <figure>
    <a id="buffalo" href="#buffalo">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Buffalo.jpg" alt="Buffalo" title="Buffalo">
    </a>
  </figure>

  <figure>
    <a id="car-wash" href="#car-wash">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Car wash.jpg" alt="Car wash" title="Car wash">
    </a>
  </figure>

  <figure>
    <a id="censored-king-kong" href="#censored-king-kong">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Censored King Kong.jpg" alt="Censored King Kong" title="Censored King Kong">
    </a>
  </figure>

  <figure>
    <a id="chicken-sign" href="#chicken-sign">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Chicken sign.jpg" alt="Chicken sign" title="Chicken sign">
    </a>
  </figure>

  <figure>
    <a id="concert-venue" href="#concert-venue">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Concert venue.jpg" alt="Concert venue" title="Concert venue">
    </a>
  </figure>

  <figure>
    <a id="concrete-teepees" href="#concrete-teepees">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Concrete teepees.jpg" alt="Concrete teepees" title="Concrete teepees">
    </a>
  </figure>

  <figure>
    <a id="dinosaur-village" href="#dinosaur-village">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Dinosaur village.jpg" alt="Dinosaur village" title="Dinosaur village">
    </a>
  </figure>

  <figure>
    <a id="eye" href="#eye">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Eye.jpg" alt="Eye" title="Eye">
    </a>
  </figure>

  <figure>
    <a id="flamingo" href="#flamingo">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Flamingo.jpg" alt="Flamingo" title="Flamingo">
    </a>
  </figure>

  <figure>
    <a id="fox-tower" href="#fox-tower">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Fox tower.jpg" alt="Fox tower" title="Fox tower">
    </a>
  </figure>

  <figure>
    <a id="hat-and-boots" href="#hat-and-boots">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Hat and boots.jpg" alt="Hat and boots" title="Hat and boots">
    </a>
  </figure>

  <figure>
    <a id="hoot-owl-cafe" href="#hoot-owl-cafe">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Hoot owl cafe.jpg" alt="Hoot owl cafe" title="Hoot owl cafe">
    </a>
  </figure>

  <figure>
    <a id="ko-ko-mo" href="#ko-ko-mo">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Ko ko mo.jpg" alt="Ko ko mo" title="Ko ko mo">
    </a>
  </figure>

  <figure>
    <a id="loch-ness-auto-shop" href="#loch-ness-auto-shop">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Loch Ness auto shop.jpg" alt="Loch Ness auto shop" title="Loch Ness auto shop">
    </a>
  </figure>

  <figure>
    <a id="motel" href="#motel">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Motel.jpg" alt="Motel" title="Motel">
    </a>
  </figure>

  <figure>
    <a id="moulin-vert" href="#moulin-vert">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Moulin Vert.jpg" alt="Moulin Vert" title="Moulin Vert">
    </a>
  </figure>

  <figure>
    <a id="neon-couch" href="#neon-couch">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Neon couch.jpg" alt="Neon couch" title="Neon couch">
    </a>
  </figure>

  <figure>
    <a id="neon-sign" href="#neon-sign">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Neon sign.jpg" alt="Neon sign" title="Neon sign">
    </a>
  </figure>

  <figure>
    <a id="psa" href="#psa">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/PSA.jpg" alt="PSA" title="PSA">
    </a>
  </figure>

  <figure>
    <a id="peach" href="#peach">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Peach.jpg" alt="Peach" title="Peach">
    </a>
  </figure>

  <figure>
    <a id="red-rooster-sign" href="#red-rooster-sign">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Red rooster sign.jpg" alt="Red rooster sign" title="Red rooster sign">
    </a>
  </figure>

  <figure>
    <a id="roadside-art" href="#roadside-art">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Roadside art.jpg" alt="Roadside art" title="Roadside art">
    </a>
  </figure>

  <figure>
    <a id="robot" href="#robot">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Robot.jpg" alt="Robot" title="Robot">
    </a>
  </figure>

  <figure>
    <a id="teapot-cabaret" href="#teapot-cabaret">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Teapot cabaret.jpg" alt="Teapot cabaret" title="Teapot cabaret">
    </a>
  </figure>

  <figure>
    <a id="trading-post" href="#trading-post">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Trading post.jpg" alt="Trading post" title="Trading post">
    </a>
  </figure>

  <figure>
    <a id="whale-garage" href="#whale-garage">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/Whale garage.jpg" alt="Whale garage" title="Whale garage">
    </a>
  </figure>

  <figure>
    <a id="white-rooster-sign" href="#white-rooster-sign">
      <img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/White rooster sign.jpg" alt="White rooster sign" title="White rooster sign">
    </a>
  </figure>

  <div class="counter"></div>

</div>
              
            
!

CSS

              
                /* debug 
a:not(:target){background:rgba(255,100,100,.5);}
*/

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: system-ui, sans-serif;
  background: #0e0e0f;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}

.slideshow {
  height: 100%;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  overscroll-behavior: contain;
  display: flex;
}

.slideshow:hover {
  scroll-behavior: smooth;
  /* on :hover so it doesn't fire when linking directly to a particular #id */
}

figure {
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
}

figure a {
  display: block;
  padding-inline: 25%;  /* ??? */ 
  margin-inline: 25%;   /* ??? */
  scroll-margin: 0 50%; /* ??? */
  position: relative;   /* for z-index */
}
 
figure:first-of-type a {
  padding-inline-start: 0;
  margin-inline-end: 0;
}

figure:last-of-type a {
  padding-inline-end: 0;
  margin-inline-start: 0;
}

figure a img {
  display: block;
  max-width: 85vw;
  max-height: 100vh;
  height: auto;
  width: auto;
  padding: 1vw 2vw;
  user-select: none;
}

figure a:target {
  z-index: -1;
}

figure a:focus-visible {
  outline: 0;
}

/* Slides counter (doesn’t work on scroll, of course) 

.slideshow {
  counter-reset: currentStep 0 remainder 0 totalStep 0;
}

.slideshow figure {
  counter-increment: totalStep;
}

.slideshow figure::before {
  content: "";
  counter-increment: currentStep;
}

.slideshow figure:focus-within ~ figure::before {
  counter-increment: remainder;
}

.slideshow figure:focus-within ~ .counter {
  z-index: 1;
  font-variant-numeric: tabular-nums;
  position: absolute;
  bottom: 1em;
  right: 1.5em;
  opacity: 0.4;
  text-shadow: 1px 1px 1px #000;
}

.slideshow figure:focus-within ~ .counter::before {
  font-size: 0.9em;
  content: counter(currentStep) " / " counter(totalStep);
}

*/

              
            
!

JS

              
                
              
            
!
999px

Console