123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

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.

            
              .container
  span.button &#10006;
  .content
    .head
      h1 Expand.
      p.sub by 
        a(href="https://codepen.io/woodwork/" target="_blank") Joe Harry
    .body
      p
            | There once was a wolf named <em>Knox</em>. He lived in a bright blue box. Until one day, his box blew away and he was left with only his <em>socks</em>.
            <br><br> Integer augue augue, fermentum at purus nec, euismod rutrum ex. Nulla pulvinar tortor ipsum, vel accumsan nunc rutrum sed. Praesent faucibus sollicitudin tempus. Phasellus congue ex tempor malesuada congue. Etiam vitae dui commodo, ultrices eros malesuada mi. Fusce suscipit eleifend lacus, at gravida urna gravida in. Nullam sodales a consequat leo nisl sit amet ipsum. Pellentesque aliquam dolor quam, et ultricies leo fringilla in. Nulla eu neque eu mauris malesuada efficitur ultrices sed mi. Vestibulum nec quam vitae purus ut sed velit. Vestibulum ultricies iaculis magna ut consequat.
      .action-bar
        a SHARE
        a LEARN MORE
            
          
!
            
              $body-bg: #FAFAFA;
//Other pretty primary colors: E91E63 FF5722
$primary-col: #03A9F4;
$accent-col: #FFC400;
$accent-fallback: #FFD740;

$font-stack: Roboto, sans-serif;
$easer: cubic-bezier(0.4, 0, 0.2, 1);

body {
  font-family: $font-stack;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  color: #FFF;
  background: $body-bg;
}

h1{
  font-weight: 700;
  font-size: 64px;
  margin: 20px 0 0 0;
  padding: 0 20px;
}

p{
  font-size: 16px;
  padding: 0 20px;
}

em{
  font-style: normal;
  color: $accent-col;
}

a{
  font-style: normal;
  color: $accent-fallback;
  text-decoration: none;
  padding-right: 10px;
  cursor: pointer;
}

.sub{
  margin: 0;
}

.button{
  cursor: pointer;
  width: 60px;
  height: 60px;
  display: inline-block;
  font-size: 20px;
  line-height: 60px;
  font-weight: bold;
  transform: rotate(45deg);

  transition: all 0.7s $easer;
}
.expand .button {
  transform: rotate(630deg);

  transition: all 0.5s $easer;
}

.container {
  position: absolute;
  margin: auto;
  left: 0;
  right: 0;
  top: 5vh;  
  background-color: $primary-col;

  border-radius: 50%;
  width: 60px;
  max-width: 60px;
  height: 60px;
  text-align: center;
  box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
  overflow: hidden;

  transition: all 0.2s 0.45s,
              height 0.2s $easer 0.25s, 
              max-width 0.2s $easer 0.35s, 
              width 0.2s $easer 0.35s;
}
.container.expand {
  box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.17);
  border-radius: 0;
  width: 80%;
  height: 500px;
  max-width: 600px;
  padding: 0;

  transition: all 0.2s, max-width 0.2s $easer 0.1s, height 0.3s ease 0.25s;
}

.content {
  transform: translateY(100%);
  width: 100%;
  height: 100%;
  opacity: 0;
  text-align: left;

  transition: transform 0.2s $easer, opacity 0.2s 0.2s;
}
.expand .content {
  transform: translateY(0px);
  opacity: 1;
  transition: transform 0.7s $easer 0.05s, opacity 0s;
}

.content .head {
  padding: 0 0 20px 0;
}
.content .body {
  color: #000;
  color: rgba(0, 0, 0, 0.87);
  background-color: #FFF;
  width: 100%;
  height: 100%;
  padding: 10px 0;
  box-sizing: border-box;
}

.action-bar {
  padding-left: 15px;
  border-top: 1px solid #E0E0E0;
  width: 100%;
}
.action-bar a {
  text-transform: uppercase;
  line-height: 52px;
  color: $accent-col;
}
            
          
!
            
              $('.button').click(function () {
  $(this).parent().toggleClass('expand');     
});

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console