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

              
                <div class="onboarding">
  <div class="slider">
    <div class="slide">
      <h1>Communicate</h1>
<!--       <img src="https://s9.postimg.org/i65ness8f/chat-bubbles.png" alt="chat bubbles"> -->
      <div class="img chat-bubbles"></div>
      <p>Communicate with friends using a convenient chat</p>
    </div>
    <div class="slide">
      <h1>Mind Battles</h1>
<!--       <img src="https://s9.postimg.org/7qzh5k2nz/swords.png" alt="swords"> -->
      <div class="img swords"></div>
      <p>Fight with other players in daily intellectual battles</p>
    </div>
    <div class="slide">
      <h1>Learn</h1>
<!--       <img src="https://s9.postimg.org/l7wfosv3j/brain-bulb.png" alt="brain bulb"> -->
      <div class="img brain-bulb"></div>
      <p>Perform tasks, get cool bonuses, ranks and awards</p>
    </div>
  </div>
  <div class="controls">
    <form>
      <input type="radio" name="page" checked>
      <label for="page"></label>
      <input type="radio" name="page">
      <label for="page"></label>
      <input type="radio" name="page">
      <label for="page"></label>
    </form>
    <a href="#" class="btn-next">Next</a>
  </div>
</div>

<!-- <div class="thumbnail">
  <a href="https://codepen.io/enahom99/full/EEgPQP/">
    <img src="" alt="">
  </a>
</div> -->


<div class="toast">View in <a href="https://codepen.io/enahom99/full/EEgPQP/" target="_blank">Full Page</a></div>
              
            
!

CSS

              
                * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  height: 100%;
}
body {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Roboto", sans-serif;
  background: #000;
  background: linear-gradient(to top right,#5139cf,#46baca);
}

:root {
  // --page-number: 1;
}

.onboarding {
  --page-number: 1;
  zoom: .9;
  & {
    height: 640px;
    width: 360px;
    border-radius: 10px;
    overflow: hidden;
  }
  .slider {
    width: 300%;
    height: 100%;
    display: flex;
    background-color: #fff;
    margin-left: calc(-360px * (var(--page-number) - 1));
    transition: margin-left 400ms;
    .slide {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      h1 {
        margin: 70px 0 40px 0;
        text-transform: uppercase;
        font-size: 20px;
        letter-spacing: .25em;
        color: #00bcc2;
      }
      img, .img {
        transform: scale(.7);
        margin-bottom: 20px;
      }
      .img {
        height: 240px;
        width: 320px;
        // background: #000;
        background-image: url(https://cdn.dribbble.com/users/622814/screenshots/3373149/attachments/733934/appicons__3.png);
        background-repeat: no-repeat;
      }
      .img.chat-bubbles {
        background-size: 500%;
        background-position: 10% 41%;
        position: relative;
        left: -40px;
      }
      .img.swords {
        background-size: 400%;
        background-position: 50% 41%;
      }
      .img.brain-bulb {
        background-size: 500%;
        background-position: 90% 41%;
        position: relative;
        left: 40px;
      }
      p {
        margin: 20px;
        // max-width: 230px;
        // max-width: 222px;
        max-width: 250px;
        font-size: 16px;
        font-size: 19px;
        line-height: 1.5em;
        text-align: center;
        color: #9e9e9e;
      }
    }
  }
  .controls {
    --h: 167px;
    height: var(--h);
    margin-top: calc(var(--h) * -1);
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    form {
      display: flex;
      align-items: center;
      justify-content: center;
      flex: 1;
      padding: 20px;
      input[type="radio"] {
        outline: none;
        margin: 20px 5px;
        opacity: 0;
        & + label {
          position: relative;
          top: -1px;
          left: -17px;
          height: 10px;
          width: 10px;
          border-radius: 100%;
          border: 1px solid #ced7e6;
          transition: border 300ms, background 300ms;
        }
        &:checked + label {
          border: 1px solid #68e0e3;
          background-color: #68e0e3;
        }
      }
    }
    a.btn-next {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 60px;
      height: 65px;
      background: #02C1C5;
      color: white;
      font-family: sans-serif;
      font-size: 18px;
      text-decoration: none;
    }
  }
}

.thumbnail {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: url("https://s9.postimg.org/mv4hbyhhr/thumbnail.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  display: none;
}

@media screen and (max-width: 400px) {
  .thumbnail {
    display: block;
  }
}


.img.bubbles {
  height: 200px;
  
}


.toast {
  // height: 70px;
  // width: 300px;
  padding: 20px;
  background-color: #212121;
  color: white;
  position: fixed;
  bottom: 20px;
  right: 20px;
  a {
    margin-left: 4px;
    text-decoration: none;
    color: #abcdef;
  }
}
              
            
!

JS

              
                if (location.href.includes('full')) {
  document.querySelector('.toast').parentElement.removeChild(document.querySelector('.toast'));
}
const onboarding = document.querySelector('.onboarding');
console.log(onboarding);
const bookmarks = document.querySelectorAll("form input[type=\"radio\"]");
const btnNext = document.querySelector("a.btn-next");
btnNext.addEventListener("click", (e) => {
  const pageNumber = parseInt(getComputedStyle(onboarding).getPropertyValue('--page-number')) + 1;
  if (pageNumber < 4) {
    onboarding.style.setProperty('--page-number', pageNumber);
    bookmarks[pageNumber-1].checked = true;
  }
  else {
    onboarding.style.setProperty('--page-number', 1);
    bookmarks[0].checked = true;
  }
});


window.addEventListener('load', event => {
  
});
              
            
!
999px

Console