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="btn-holder">
  <p class="intro-text">Press the buttons</p>
  <button
    id="play-pause"
    onclick="changeStyle('play-pause')"
    aria-label="Play/Pause Button."
    class="btn neumorphic"
  >
    <span class="icon">
      <i id="play" class="material-icon">
        play_arrow
      </i>
      
      <i id="pause" class="material-icon">
        pause
      </i>
    </span>
  </button>
  
  <button
    id="shuffle-btn"
    onclick="changeStyle('shuffle-btn')"
    aria-label="Shuffle Button."
    class="btn neumorphic"
  >
    <i id="shuffle" class="material-icon">
      shuffle
    </i>
  </button>
</div>

              
            
!

CSS

              
                /* An import for use of Material icons */
@import url(//fonts.googleapis.com/icon?family=Material+Icons);

body{
  background-color: #6ec7ff;
}

.btn-holder{
  display: block;
  margin: 0 auto;
  margin-top: 64px;
  text-align: center;
}

.intro-text{
  margin-bottom: 48px;
  font-family: 'Quicksand', sans-serif;
  color: white;
  font-size: 18px;
}

.btn{
  width: 110px;
  height: 110px;
  font-size: 30px;
  border-radius: 30px;
  border: none;
  color: white;
  vertical-align: top;
  -webkit-transition: .6s ease-in-out;
  transition: .6s ease-in-out;
}

.btn:hover{
  cursor: pointer;
}

.btn:focus{
  /*  This is just so extra styles don't get in the way, 
      our border will take care of focus!  */
  outline: none;
}

/* Gives the buttons some breathing room */
.btn:first-of-type{
  margin-right: 30px;
}

/* Important stuff for neumorphic styling */
.neumorphic{
  /*  Background is the background color inside button  */
  background: linear-gradient(145deg, #76d5ff, #63b3e6);
  
  /*  The shadow around the buttons which make them look
      vacuum-formed */
  box-shadow: 30px 30px 40px #1e7689,
            -30px -30px 40px #7fe5ff;
  border: 3px solid rgba(255, 255, 255, .4);
}

/* How the buttons look when pressed down */
.neumorphic-pressed{
  background: linear-gradient(145deg, #63b3e6, #76d5ff);
  -webkit-box-shadow: inset 15px 15px 20px -20px rgba(0,0,0,.5);
  -moz-box-shadow: inset 15px 15px 20px -20px rgba(0,0,0,.5);
  box-shadow: inset 15px 15px 20px -20px rgba(0,0,0,.5);
}

/* How the buttons behave when hovered over or focused on - this allows us to get rid of the default outline and indicate focus ourselves */
.neumorphic:focus, .neumorphic:hover, .neumorphic:focus, .neumorphic:hover, .neumorphic-pressed:focus, .neumorphic-pressed:hover {
  border: 3px solid rgba(46, 74, 112, .75);
}

/* Some stuff for Material icons, you can ignore this */
.material-icon {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 32px;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  
  /* Support for all WebKit browsers. */
  -webkit-font-smoothing: antialiased;
  /* Support for Safari and Chrome. */
  text-rendering: optimizeLegibility;
  /* Support for Firefox. */
  -moz-osx-font-smoothing: grayscale;
  /* Support for IE. */
  font-feature-settings: 'liga';
}

#pause {
  color: #143664;
  display: none;
}
              
            
!

JS

              
                // Toggles the style of the neumorphic button
function changeStyle(btnPressed) {
  var btn = document.getElementById(btnPressed);
  btn.classList.toggle("neumorphic");
  btn.classList.toggle("neumorphic-pressed");
  
  // Figures out which function to call from which button was pressed
  if (btnPressed === 'play-pause') {
    play();
  } else if (btnPressed === 'shuffle-btn') {
    shuffle();
  }
}

// Toggles the visibility of the play/pause icon
function play() {
  var playBtn = document.getElementById('play');
  var pauseBtn = document.getElementById('pause');
  
  if (playBtn.style.display === 'none') {
    playBtn.style.display = 'block';
    pauseBtn.style.display = 'none';
  } else {
    playBtn.style.display = 'none';
    pauseBtn.style.display = 'block';
  }
}

// Toggles the style of the shuffle indicator
function shuffle() {
  var shuffleBtn = document.getElementById('shuffle-btn');
  
  if (shuffleBtn.style.color == 'white' || shuffleBtn.style.color == '') {
    shuffleBtn.style.color = '#143664';
  } else {
    shuffleBtn.style.color = 'white';
  }
}
              
            
!
999px

Console