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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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 Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

              
                <div class="content-width">
  <div class="slideshow">
    <!-- Slideshow Items -->
    <div class="slideshow-items">
      <div class="item">
        <div class="item-image-container">
          <figure>
            <img class="item-image" src="https://i.pinimg.com/564x/fd/2b/72/fd2b728e5c97e1175ecd381b6696b55d.jpg" />
          </figure>
        </div>
        <!-- Staggered Header Elements -->
        <div class="item-content">
          <div class="item-header">
            <span class="vertical-part"><b>H</b></span>
            <span class="vertical-part"><b>a</b></span>
            <span class="vertical-part"><b>r</b></span>
            <span class="vertical-part"><b>l</b></span>
            <span class="vertical-part"><b>e</b></span>
            <span class="vertical-part"><b>y</b></span>
            <span class="vertical-part"><b>Q</b></span>
            <span class="vertical-part"><b>u</b></span>
            <span class="vertical-part"><b>i</b></span>
            <span class="vertical-part"><b>n</b></span>
            <span class="vertical-part"><b>n</b></span>
          </div>
          <!-- Staggered Description Elements -->
          <div class="item-description">
            <span class="vertical-part">
              <b>Fictum, deserunt mollit anim laborum astutumque! Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua.</b>
          </span>
          </div>
        </div>
      </div>
      <div class="item">
        <div class="item-image-container">
          <figure>
            <img class="item-image" src="https://i.pinimg.com/564x/fa/14/43/fa14432704b792f1729197bf107a16b8.jpg" />
          </figure>
        </div>
        <div class="item-content">
          <!-- Staggered Header Elements -->
          <div class="item-header">
            <span class="vertical-part"><b>W</b></span>
            <span class="vertical-part"><b>o</b></span>
            <span class="vertical-part"><b>n</b></span>
            <span class="vertical-part"><b>d</b></span>
            <span class="vertical-part"><b>e</b></span>
            <span class="vertical-part"><b>r</b></span>
            <span class="vertical-part"><b>W</b></span>
            <span class="vertical-part"><b>o</b></span>
            <span class="vertical-part"><b>m</b></span>
            <span class="vertical-part"><b>a</b></span>
            <span class="vertical-part"><b>n</b></span>
          </div>
          <!-- Staggered Description Elements -->
          <div class="item-description">
            <span class="vertical-part">
            <b>Petierunt uti sibi concilium totius Galliae in diem certam indicere. Vivamus sagittis lacus vel augue laoreet rutrum faucibus. Tu quoque, Brute, fili mi, nihil timor populi, nihil! Morbi odio eros, volutpat ut pharetra vitae, lobortis sed nibh.</b>
          </span>
          </div>
        </div>
      </div>
      <div class="item">
        <div class="item-image-container">
          <figure>
            <img class="item-image" src="https://i.pinimg.com/564x/03/66/26/0366261722a01851c81703b321f8e1f4.jpg" />
          </figure>
        </div>
        <div class="item-content">
          <!-- Staggered Header Elements -->
          <div class="item-header">
            <span class="vertical-part"><b>E</b></span>
            <span class="vertical-part"><b>l</b></span>
            <span class="vertical-part"><b>e</b></span>
            <span class="vertical-part"><b>k</b></span>
            <span class="vertical-part"><b>t</b></span>
            <span class="vertical-part"><b>r</b></span>
            <span class="vertical-part"><b>a</b></span>
          </div>
          <!-- Staggered Description Elements -->
          <div class="item-description">
            <span class="vertical-part">
            <b>Nihil hic munitissimus habendi senatus locus, nihil horum? Hi omnes lingua, institutis, legibus inter se differunt. Gallia est omnis divisa in partes tres, quarum.</b>
          </span>
          </div>
        </div>
      </div>
    </div>
    <div class="bullets">
      <div class="bullet" data-index="0">
        <div><svg class="svg-circle"><circle cx="50%" cy="50%" r="45%" stroke-dasharray="160" stroke-dashoffset="160"></circle></svg></div>
      </div>
      <div class="bullet" data-index="1">
        <div><svg class="svg-circle"><circle cx="50%" cy="50%" r="45%" stroke-dasharray="160" stroke-dashoffset="160"></circle></svg></div>
      </div>
      <div class="bullet" data-index="2">
        <div><svg class="svg-circle"><circle cx="50%" cy="50%" r="45%" stroke-dasharray="160" stroke-dashoffset="160"></circle></svg></div>
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                // Variables

$tablet: 769px;
$desktop: 1004px;
$fullHd: 1280px;

// Mixins
@mixin mobile {
  @media screen and (max-width: $tablet - 1px) {
    @content;
  }
}
@mixin tablet {
  @media screen and (min-width: $tablet) {
    @content;
  }
}
@mixin desktop {
  @media screen and (min-width: $desktop) {
    @content;
  }
}
@mixin fullhd {
  @media screen and (min-width: $fullHd) {
    @content;
  }
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
  font-family: "open sans", monospace;
  -webkit-font-smoothing: antialiased;
  font-size: 1rem;
  color: #bdbdd5;
}

.slideshow {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  margin: 0 auto;
  display: grid;
  justify-items: stretch;
  grid-template-columns: 120px 1fr 120px;
  grid-auto-rows: 120px 1fr 120px;

  grid-gap: 1em;
  grid-template-areas: ". . ." ". s ." ". b .";

  @include mobile {
    grid-template-columns: 20px 1fr 20px;
    min-height: 100vh;
  }
}

.slideshow-items {
  position: relative;
  display: grid;
  justify-items: stretch;
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
  grid-gap: 1em;
  grid-area: s;

  grid-template-areas: "i";
}
.item-content {
  grid-area: c;
  display: grid;
  align-content: start;
}

.item {
  position: relative;
  grid-area: i;
  display: grid;
  justify-items: stretch;
  grid-template-columns: 1fr 120px 1.5fr;
  grid-auto-rows: 60px 1fr 60px;
  grid-gap: 1em;
  grid-template-areas: ". . f" "c . f" ". . f";
  max-height: calc(100vh - 240px - 2rem);

  @include mobile {
    grid-template-areas: ". . f" "c c f" ". . f";
  }
}

.item-image-container {
  grid-area: f;
}

figure {
  height: 100%;
  width: 100%;
}

.item-image {
  height: 100%;
  width: 100%;
  object-fit: cover;
  opacity: 0;
  display: block;
  transition: opacity 0.3s ease-out 0.45s;
}

.item.active .item-image {
  opacity: 1;
}

.item.active .item-image-container::before {
  opacity: 0.8;
}

.item-header {
  margin-bottom: 2rem;
  width: max-content;

  .vertical-part {
    margin: 0 -4px;
    -webkit-font-smoothing: auto;
    font-size: 5vw;
    color: #2a2a2a;
    line-height: 1.3;

    @include mobile {
      font-size: 1.6rem;
      letter-spacing: 1px;
    }
  }
}

.vertical-part {
  overflow: hidden;
  display: inline-block;
}

.vertical-part b {
  display: inline-block;
  transform: translateY(100%);
}

.item-header .vertical-part b {
  transition: 0.5s;
}

.item-description .vertical-part b {
  transition: 0.21s;
}

.item.active .item-header .vertical-part b {
  transform: translateY(0);
}

.item.active .item-description .vertical-part b {
  transform: translateY(0);
}

/* Controls ----------------------------------------------------------------------*/
.bullets {
  position: relative;
  text-align: left;
  z-index: 1000;
  grid-area: b;
}

.bullet {
  display: inline-block;
  width: 10px;
  height: 10px;

  margin: 3px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  cursor: pointer;
  position: relative;
  border-radius: 50%;
  border-width: 1px;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0);
  border-image: initial;
  vertical-align: middle;

  svg {
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    position: absolute;
    pointer-events: none;
  }

  &::before {
    width: 6px;
    height: 6px;
    opacity: 0.5;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    content: "";
    transform-origin: center center 0px;
    //background: rgb(255, 255, 255);
    background: rgb(0, 0, 0);
    transition: opacity 0.2s cubic-bezier(0.41, 0.33, 0, 0.87) 0s;
  }
  &.active {
    &::before {
      opacity: 1;
    }

    .svg-circle {
      -webkit-transform: rotate(-45deg);
      -ms-transform: rotate(-45deg);
      transform: rotate(-45deg);
    }
    circle {
      stroke-dashoffset: 0;
    }
  }

  &:hover {
    .svg-circle {
      -webkit-transform: rotate(-45deg);
      -ms-transform: rotate(-45deg);
      transform: rotate(-45deg);
    }

    circle {
      stroke-dashoffset: 0;
    }
  }
}

circle {
  fill: transparent;
  stroke: rgb(12, 12, 12);
  stroke-width: 1;
  transition: all 0.5s ease-out 0s;
  cx: 50%;
  cy: 50%;
  r: 45%;
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
  pointer-events: none;
}

              
            
!

JS

              
                // Master DOManipulator v2 ------------------------------------------------------------
const items = document.querySelectorAll('.item'),
  bullets = document.querySelectorAll('.bullet'),
  headerItems = document.querySelectorAll('.item-header'),
  descriptionItems = document.querySelectorAll('.item-description'),
  activeDelay = .76,
  interval = 5000;

let current = 0;

const slider = {
  init: () => {
    bullets.forEach(bullet => bullet.addEventListener('click', (e) => { slider.clickedControl(e) }));
    bullets[current].classList.add('active');
    items[current].classList.add('active');
  },
  nextSlide: () => { // Increment current slide and add active class
    slider.reset();
    if (current === items.length - 1) current = -1; // Check if current slide is last in array
    current++;
    bullets[current].classList.add('active');
    items[current].classList.add('active');
    slider.transitionDelay(headerItems);
    slider.transitionDelay(descriptionItems);
  },
  clickedControl: (e) => { // Add active class to clicked bullet and corresponding slide
    slider.reset();
    clearInterval(intervalF);

    const bullet = e.target,
      dataIndex = Number(bullet.dataset.index);

    bullet.classList.add('active');
    items.forEach((item, index) => {
      if (index === dataIndex) { // Add active class to corresponding slide
        item.classList.add('active');
      }
    })
    current = dataIndex; // Update current slide
    slider.transitionDelay(headerItems);
    slider.transitionDelay(descriptionItems);
    intervalF = setInterval(slider.nextSlide, interval); // Fire that bad boi back up
  },
  reset: () => { // Remove active classes
    items.forEach(item => item.classList.remove('active'));
    bullets.forEach(bullet => bullet.classList.remove('active'));
  },
  transitionDelay: (items) => { // Set incrementing css transition-delay for .item-header & .item-description, .vertical-part, b elements
    let seconds;

    items.forEach(item => {
      const children = item.childNodes; // .vertical-part(s)
      let count = 1,
        delay;

      item.classList.value === 'item-header' ? seconds = .015 : seconds = .007;

      children.forEach(child => { // iterate through .vertical-part(s) and style b element
        if (child.classList) {
          item.parentNode.classList.contains('active') ? delay = count * seconds + activeDelay : delay = count * seconds;
          child.firstElementChild.style.transitionDelay = `${delay}s`; // b element
          count++;
        }
      })
    })
  },
}

let intervalF = setInterval(slider.nextSlide, interval);
slider.init();
              
            
!
999px

Console