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.

            
              <div class="top">
  <div class="logo">SHAPES</div>
</div>
<div class="content">
  <div class="avatar">
    <!--img class="avatar-image" src="avatar.jpg" alt=""-->
    <svg class="avatar-image" xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><path fill="#ccc" stroke="#ccc" stroke-width="59.34" stroke-linecap="round" d="M29.67 29.67h140.66v140.66H29.67z"/><path d="M11.208 199.263s.135-4.435.704-7.67c.568-3.235 2.055-6.794 3.52-11.045 1.465-4.252 3.367-9.958 6.617-14.114 3.25-4.155 8.703-5.782 12.953-8.13 4.25-2.348 7.69-3.722 12.954-5.216 5.266-1.494 12.268-.82 18.446-2.608 6.177-1.79 14.362-.92 14.362-.92s64.627 10.357 80.82 14.113c16.195 3.756 12.015 3.793 17.038 5.676 5.023 1.882 9.473 4.415 12.954 6.135 3.48 1.72 8.026 5.37 8.026 5.37l-.282 18.715z" fill="#333" fill-rule="evenodd" stroke="#333" stroke-width=".823"/><path d="M136.01 112.79s4.918-4.462 6.182-9.238c1.264-4.776-1.153-11.255-1.99-16.59-.84-5.332-1.643-8.99-3.843-13.55-2.2-4.56-8.726-9.303-9.792-12.815-1.066-3.513 1.06-3.168-1.127-5.667-2.184-2.5-3.82-5.964-6.463-8.345-2.645-2.38-5.124-4.12-8.058-6.254-.734-.533-1.476-1.08-2.283-1.605-.807-.525-5.128-2.562-6.12-3.01-.99-.448-.93-3.06-.93-3.06-1.222-.532-.57 3.094-3.464 2.855-3.39-.28-1.558-1.472-3.567-2.164-.25-.087.03-1.867 1.8-2.6 2.71-1.124 7-1.137 7.244-1.724.245-.587-3.06-.904-5.605-.565-.864.115-3.63.916-4.937 1.963-.605.485-.227 3.636-2.853 3.43-1.883-.15-4.144-1.89-4.774-2.5-.63-.608-1.47-1.627-1.41-2.378.03-.396.32-1.09.727-1.914.41-.824 4.317-3.39 4.828-4.305.255-.458-.27-.964 1.79-1.977 2.06-1.012 6.703-2.53 6.87-2.867.337-.673-8.344 1.53-9.945 2.835-2.3 1.877-6.18 7.022-6.643 6.843-.464-.178-1.7-.523-2.19-.274-4.19 2.132-1.035 4.856-3.254 6.026-.555.293-2.055.917-2.056-.805 0-.237-.703-.404-.558-1.312.123-.775.624-1.762.607-3.362-.015-1.454.858-3.044.743-3.2-.23-.312-1.32 1.476-1.537 2.552-.358 1.768-1.286 2.46-1.476 2.565-.19.106-.7.58-1.228.42-1.388-.414-1.904-3.28-1.99-2.546-.084.736 1.156 2.306.948 5.098-.055.737 1.576 1.51.96 3.256-.203.57-.792.834-1.584 1.298-2.16 1.268-1.44-1.89-3.14-1.47-1.7.42-2.963 3.18-4.692 2.56-1.666-.595-1.576-4.365-2.852-5.872-1.277-1.506-3.8-1.955-5.79-1.656-1.987.3-3.422.89-4.565 2.958-1.142 2.067-1.482 5.77.87 8.37 1.49 1.65.385 2.934 1.306 4.213.923 1.28 6.324 1.194 5.746 3.778-.578 2.584-5.6.536-6.935 1.635-1.334 1.1.147 2.346-.538 3.752-.685 1.405-1.586 1.244-3.584 4.338-2 3.095-4.665 9.714-6.348 15.007-1.684 5.293-2.176 12.06-2.108 16.615.067 4.556 2.306 6.776 3.045 10.26.74 3.484.368 7.374 2.225 10.72 1.856 3.347 6.704 5.416 9.98 7.324 3.276 1.908 7.02 2.86 10.33 4.852 3.31 1.99 6.034 4.97 9.112 7.196 3.078 2.226 6.288 1.62 8.76 5.207 2.475 3.585 4.12 5.047 4.15 7.248.03 2.2-2.157 4.032-2.157 4.032s-.053-.554-1.147 2.323c-1.094 2.878-1.026 10.188-.845 15.467.182 5.28 1.492 11.568 2.555 16.207 1.063 4.64 3.302 7.992 4.405 10.642 1.102 2.648 2.2 6.56 2.2 6.56h45.8l9.956-19.96z" fill="#999" fill-rule="evenodd" stroke="#999" stroke-width=".823"/><path d="M107.734 105.415c-.775 2.216-.5 2.696.796 3.904 1.296 1.207 5.17 5.138 11.55 8.677-3.48 2.542-2.2 1.38-5.975 2.604-3.776 1.224-14.62.882-16.866 3.68-2.248 2.795-.76.753-1.057 1.527-1.776-.068-1.224.608-1.592 1.712-.368 1.102.042 2.464.797 3.928 3.994 1.31 3.585 3.472 3.585 3.472s1.96 2.704 4.24 3.727c2.28 1.024 5.783.392 9.3 1.045 3.518.652 8.668.394 11.948 2.17 3.28 1.774 5.356 3.293 7.17 7.377 1.81 4.083.768 10.96 1.31 16.41.545 5.453 2.814 8.072 3.865 12.225 1.05 4.153.337 8.688 1.76 11.26 1.423 2.573 3.605 1 4.613 3.492 1.007 2.49.023 6.943.023 6.943h25.068s-1.872-5.472-2.813-9.876c-.94-4.404-1.087-10.105-2.576-17.46-1.49-7.355-5.075-20.667-6.186-27.13-1.11-6.462-.36-9.096-1.244-11.356-.882-2.26-4.538-4.473-7.573-7.69-3.034-3.214-9.668-11.452-9.668-11.452l-10.963-6.587c-3.727-1.125-18.74-4.822-19.513-2.605z" fill="gray" fill-rule="evenodd" stroke="gray" stroke-width=".823"/></svg>
    <div class="avatar-who">Anna Evanka</div>
    <div class="avatar-where">Denton, TX</div>
    <div class="avatar-info">
      <div class="contributions">
        <div class="avatar-info-number">58</div>
        <div class="avatar-info-text">Contributions</div>
      </div>
      <div class="connections">
        <div class="avatar-info-number">17</div>
        <div class="avatar-info-text">Connections</div>
      </div>
    </div>
    <div class="avatar-shapes">
      <div class="avatar-shapes-row">
        <div class="avatar-shapes-square"></div>
        <div class="avatar-shapes-text">Sqaures</div>
      </div>
      <div class="avatar-shapes-row">
        <div class="avatar-shapes-circle"></div>
        <div class="avatar-shapes-text">Circles</div>
      </div>
      <div class="avatar-shapes-row">
        <div class="avatar-shapes-triangle"></div>
        <div class="avatar-shapes-text">Triangles</div>
      </div>
    </div>
  </div>
  <div class="box2">
    <div class="box-title2">@Johnny has added new triangles</div>
    <div class="box-body2">Three sides.</div>
  </div>
  <div class="box" onclick="expandTimelineOpen(expandTimeline1, event)">
    <div class="box-title">Feel free to reach out to us!</div>
    <div class="box-body">Our magicians are ready to help you.</div>
    <div class="circle">
      <div class="header"></div>
      <svg class="mail" xmlns="http://www.w3.org/2000/svg" width="24" height="20" viewBox="0 0 20 16">
            <g fill-rule="evenodd">
              <path class="email1" d="m 0,2.5 10,4 10,-4 0,-2.5 -0.5,0 -19.5,2.3 z" fill="#fff"/>
              <path class="email2" d="m 0,0 0,2.5 20,-2.5 z" fill="#fff"/>
              <path class="email3" d="m 0,4 0,12 0.2,0 20,-12 -10,4 z" fill="#fff"/>
              <path class="email4" d="m 20,4 -20,12 20,0 z" fill="#fff"/>
              <!--path d="M20 .2L0 9.5 6.4 11z" fill="#0f0"/>
              <path d="M20 .2L6.4 11l2.1 4.3 5.75-7.55z" fill="#ff0"/>
              <path d="M20 .2L8.5 11.5v3.7l8.1-5.6z" fill="#f0f"/>
              <path d="M20 .2l-5.2 15.3-6.3-4z" fill="red"/-->
            </g>
          </svg>
      <form class="message-form" action="">
        <div class="message-organization">
          <div class="message-text message-text-1">organization</div>
          <input type="text" class="message-input-organization">
        </div>
        <div class="message-role">
          <div class="message-text message-text-2">role</div>
          <input type="text" class="message-input-role">
        </div>
        <div class="message-message">
          <div class="message-text message-text-3">message</div>
          <input type="text" class="message-input-message">
        </div>
        <button class="message-button" onclick="expandTimelineClose(expandTimeline1, event);return false">SEND</button>
      </form>
    </div>
  </div>
  <div class="box2">
    <div class="box-title2">@Archimedes likes your circles</div>
    <div class="box-body2">Nothing to disturb.</div>
  </div>
</div>
            
          
!
            
              *, *:after, *:before {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Open Sans', 'sans serif';
  font-size: 18px;
  background: #F3F4F7;
}

.content {
  margin: 0 auto;
  margin-top: 70px;
  overflow: hidden;
  width: 720px;
}

.top {
  background: #fff;
  border-bottom: 1px solid #E4E5E5;
  height: 70px;
  margin-top: -70px;
  position: fixed;
  width: 100%;
  z-index: 1;
}

.logo {
  color: #33658A;
  font-size: 40px;
  font-weight: 900;
  left: 20px;
  position: relative;
  text-transform: uppercase;
  top: 9px;
}

.avatar {
  float: left;
  margin: 30px 30px 0;
  position: relative;
  width: 200px;
}

.avatar-who, .avatar-where {
  color: #fff;
  position: absolute;
  left: 20px;
}

.avatar-who {
  font-weight: 500;
  top: 144px;
}

.avatar-where {
  font-size: 14px;
  font-weight: 300;
  top: 166px;
}

.contributions {
  border-right: 1px solid #E4E5E5;
  box-sizing: boder-box;
  float: left;
  padding: 20px;
  width: 50%;
}

.connections {
  box-sizing: boder-box;
  float: left;
  padding: 20px;
  width: 50%;
}

.avatar-image {
  float: left;
}

.avatar-info {
  position: relative;
  overflow: hidden;
  float: left;
  clear: both;
  background: white;
  width: 200px;
  border: 1px solid #E4E5E5;
}

.avatar-info-number {
  font-weight: 500;
}

.avatar-info-text {
  color: #7b7b7b;
  font-size: 11px;
}

.avatar-shapes {
  background: #fff;
  border: 1px solid #E4E5E5;
  border-top-width: 0;
  float: left;
  padding: 20px;
  width: 100%;
}

.avatar-shapes-row {
  font-size: 15px;
  padding: 10px 0;
}

.avatar-shapes-text {
  display: inline-block;
  line-height: 20px;
  vertical-align: top;
  margin-left: 16px;
}

.avatar-shapes-square {
  background: #E4E5E5;
  display: inline-block;
  height: 20px;
  padding: 10px 0;
  width: 20px;
}

.avatar-shapes-circle {
  background: #E4E5E5;
  border-radius: 50%;
  display: inline-block;
  height: 20px;
  padding: 10px 0;
  width: 20px;
}

.avatar-shapes-triangle {
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 20px solid #E4E5E5;
  display: inline-block;
  height: 0;
  width: 0;
}

.box {
  background: #fff;
  border: 1px solid #E4E5E5;
  cursor: pointer;
  float: left;
  height: 112px;
  margin-top: 30px;
  position: relative;
  user-select: none;
  width: 432px;
  transition: background 200ms;
}

.box:hover {
  background: #f8f8f8;
}

.box.cursor {
  cursor: auto;
}

.box.cursor:hover {
  background: #fff;
}

.box-title {
  position: absolute;
  top: 34px;
  left: 100px;
}

.box-body {
  color: #7b7b7b;
  font-size: 15px;
  position: absolute;
  top: 58px;
  left: 100px;
}

.box-title2 {
  position: absolute;
  top: 34px;
  left: 30px;
}

.box-body2 {
  color: #7b7b7b;
  font-size: 15px;
  position: absolute;
  top: 58px;
  left: 30px;
}

.circle {
  background: #19A961;
  border-radius: 50%;
  height: 60px;
  margin: 25px;
  overflow: hidden;
  position: absolute;
  width: 60px;
}

.header {
  background: #01AB5D;
  /* background: #019A54; */
  height: 55px;
  position: absolute;
  width: 380px;
}

.mail {
  position: relative;
  top: 20px;
  left: 18px;
}

.heart {
  position: relative;
  top: 20px;
  left: 18px;
}

.message-form {
  color: #fff;
  font-size: 12px;
  font-weight: 300;
  left: 30px;
  position: absolute;
  top: 80px;
}

.message-form input {
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  border-bottom: 1px solid #6ECA9B;
  color: white;
  font-family: 'Geomanist', serif;
  font-size: 14px;
  height: 25px;
  outline: none !important;
  width: 100%;
}

.message-text {
  transform: translateY(18px);
  transition: transform 300ms, font-size 300ms;
  pointer-events: none;
  line-height: 18px;
}

.message-text.raised {
  font-size: 11px;
  transform: translateY(0);
}

.message-organization {
  display: inline-block;
  margin-right: 20px;
  width: 144px;
}

.message-role {
  display: inline-block;
  width: 144px;
}

.message-message {
  margin-top: 10px;
  width: 312px;
}

.message-button {
  -webkit-appearance: none;
  border: none;
  background-color: #fff;
  border-radius: 12px;
  color: #19A961;
  cursor: pointer;
  display: block;
  height: 24px;
  margin: 0 auto;
  margin-top: 25px;
  outline: none !important;
  padding: 0 20px;
  transition: background-color 200ms;
  width: 75px;
}

.message-button:focus {
  background-color: #f9f9f9;
}

.message-button:active {
  background-color: #f3f3f3;
}

.box2 {
  background: #fff;
  border: 1px solid #E4E5E5;
  float: left;
  height: 112px;
  margin-top: 20px;
  position: relative;
  width: 432px;
}

.circle2 {
  background: #DFBA0A;
  border-radius: 50%;
  margin: 25px;
  height: 60px;
  position: absolute;
  width: 60px;
}

            
          
!
            
              function create() {
  return anime.timeline({ autoplay: false, direction: 'alternate', loop: false });
}

function init(timeline) {
  timeline.menuOpened = false;

  timeline.complete = function() {
    timeline.reverse();
  };
}

var expandTimeline1 = create();
var expandTimeline2 = create();

expandTimeline1
.add({
  targets: '.box',
  height: [
  { value: 300, duration: 300, easing: 'easeInOutQuad' }
  ]
})
.add({
  targets: '.circle',
  height: [
  { value: 250, duration: 300, easing: 'easeInOutQuad' }
  ],
  offset: 60
})
.add({
  targets: '.circle',
  width: [
  { value: 380, duration: 300, easing: 'easeInOutQuad' }
  ],
  offset: 60
})
.add({
  targets: '.circle',
  borderRadius: [
  { value: ['50%', 0], duration: 300, easing: 'easeInOutQuad' }
  ],
  offset: 60
})
.add({
  targets: '.email1',
  d: [
  { value: [
    'm 0,2.5 10,4 10,-4 0,-2.5 -0.5,0 -19.5,2.3 z',
    'm 20,0.2 -0.55,0.35 -13.15,10.4 0.1,0.05 2.1,4.3 5.75,-7.55 z'
    ], duration: 300, easing: 'easeInOutQuad' }
    ],
    offset: 120
  })
.add({
  targets: '.email2',
  d: [
  { value: [
    'm 0,0 0,2.5 20,-2.5 z',
    'm 20,0 -20,9.3 6.4,1.5 z'
    ], duration: 300, easing: 'easeInOutQuad' }
    ],
    offset: 120
  })
.add({
  targets: '.email3',
  d: [
  { value: [
    'm 0,4 0,12 0.2,0 20,-12 -10,4 z',
    'm 20,0.2 -11.5,11.3 0,0 0,3.7 8.1,-5.6 z'
    ], duration: 300, easing: 'easeInOutQuad' }
    ],
    offset: 120
  })
.add({
  targets: '.email4',
  d: [
  { value: [
    'm 20,4 -20,12 20,0 z',
    'm 20,0.2 -5.2,15.3 -6.3,-4 z'
    ], duration: 300, easing: 'easeInOutQuad' }
    ],
    offset: 120
  })
.add({
  targets: '.email1',
  fill: [
  { value: '#bbb', duration: 300, easing: 'easeInOutQuad' }
  ],
  offset: 120
})
.add({
  targets: '.email3',
  fill: [
  { value: '#888', duration: 300, easing: 'easeInOutQuad' }
  ],
  offset: 120
})
.add({
  targets: '.header',
  background: [
  { value: '#019A54', duration: 300, easing: 'easeInOutQuad' }
  ],
  offset: 150
});

expandTimeline2
.add({
  targets: '.box2',
  height: [
    { value: 250, duration: 300, easing: 'easeInOutQuad' }
  ]
})
.add({
  targets: '.circle2',
  height: [
    { value: 200, duration: 300, easing: 'easeInOutQuad' }
  ],
  offset: 60
})
.add({
  targets: '.circle2',
  width: [
    { value: 380, duration: 300, easing: 'easeInOutQuad' }
  ],
  offset: 60
})
.add({
  targets: '.circle2',
  borderRadius: [
    { value: ['50%', 0], duration: 300, easing: 'easeInOutQuad' }
  ],
  offset: 60
})
.add({
  targets: '.heart1',
  d: [
  { value: [
    'm 3.535534,15.757359 c 2.9032034,1.754848 4.3704397,1.504145 6.761709,1.502603 8.048124,-0.92962 9.206582,-9.3307341 8.914278,-10.6798258 0.316072,-0.2070868 1.244164,-0.8126965 1.861517,-1.8659587 -0.787057,0.367614 -1.070969,0.4509428 -2.007043,0.5745243 C 19.416913,4.977924 20.111616,4.7281937 20.506097,3.3387965 19.884112,3.6287778 19.31529,4.0012091 18.296388,4.1784858 16.988816,2.9735006 15.397209,2.7220368 14.053747,3.471379 12.721834,4.1398781 11.816199,5.5456496 12.153398,7.4488546 10.236693,7.672681 6.6941365,6.095028 4.6845824,3.736544 3.3379409,6.4161958 5.0841948,8.265931 5.833631,8.4653206 5.1246595,8.6205159 4.8838666,8.2498941 4.1542523,8.2443498 4.3085214,10.536903 6.1313601,11.536375 7.380427,11.647301 c -0.9164475,0.199314 -1.1290664,0.14191 -1.9445436,0.08839 0.245183,1.095527 1.7936559,2.557015 3.3587572,2.563262 -1.8820443,1.155296 -3.521922,1.648104 -5.2591066,1.458406 z',
    'm 2.1213204,16.641242 c 2.9032034,1.754848 8.9666336,0.620262 11.3579036,0.61872 8.048124,-0.92962 7.969145,-5.26487 7.676841,-6.613962 0.316072,-0.207087 -0.70038,-4.8785603 -0.08303,-5.9318225 -0.787057,0.367614 0.873575,-0.9632708 -0.0625,-0.8396893 C 21.361457,3.5637104 20.111616,4.7281937 20.506097,3.3387965 19.884112,3.6287778 19.31529,2.9405489 18.296388,3.1178256 16.988816,1.9128404 15.397209,2.7220368 14.053747,3.471379 12.721834,4.1398781 10.578762,4.131436 10.915961,6.034641 8.9992561,6.2584674 6.6941365,7.9511833 4.6845824,5.5926993 3.3379409,8.2723511 0.75316576,6.232999 1.502602,6.4323886 0.79363046,6.5875839 1.9670511,8.6034475 1.2374368,8.5979032 c 0.1542691,2.2925528 0.032564,2.3197538 1.2816311,2.4306798 -0.9164475,0.199314 0.3735355,0.760628 -0.4419417,0.707108 0.245183,1.095527 -1.29993628,0.966025 0.265165,0.972272 -1.88204428,1.155296 1.5162138,4.122977 -0.2209708,3.933279 z'
    ], duration: 300, easing: 'easeInOutQuad' }
    ],
    offset: 120
  })
.add({
  targets: '.heart1',
  fill: [
  { value: '#c8a809', duration: 300, easing: 'easeInOutQuad' }
  ],
  offset: 120
});

init(expandTimeline1);
init(expandTimeline2);

function expandTimelineToggle(timeline, event) {
  if (timeline.menuOpened) {
    expandTimelineClose(timeline, event);
  } else {
    expandTimelineOpen(timeline, event);
  }
}

function expandTimelineOpen(timeline, event) {
  if (!timeline.menuOpened) {
    timeline.restart();
    timeline.menuOpened = true;
    event.stopPropagation();
    timeline.clear();
    timeline.open();
  }
}

function expandTimelineClose(timeline, event) {
  if (timeline.menuOpened) {
    timeline.play();
    timeline.menuOpened = false;
    event.stopPropagation();
    timeline.close();
  }
}

window.addEventListener('load', function() {
  function hookUp(labelSelector, inputSelector) {
    var label = document.querySelector(labelSelector);
    var input = document.querySelector(inputSelector);

    input.addEventListener('focus', function() {
      label.classList.add('raised');
    });
    input.addEventListener('blur', function() {
      if (input.value.length === 0) {
        label.classList.remove('raised');
      }
    });
  }
  hookUp('.message-text-1', '.message-input-organization');
  hookUp('.message-text-2', '.message-input-role');
  hookUp('.message-text-3', '.message-input-message');
});

function clearInput(labelSelector, inputSelector) {
  var label = document.querySelector(labelSelector);
  var input = document.querySelector(inputSelector);

  input.value = '';
  label.classList.remove('raised');
}

function openMessage() {
  document.querySelector('.box').classList.add('cursor');
}

function closeMessage() {
  document.querySelector('.box').classList.remove('cursor');
}

function clearMessage() {
  clearInput('.message-text-1', '.message-input-organization');
  clearInput('.message-text-2', '.message-input-role');
  clearInput('.message-text-3', '.message-input-message');
}

expandTimeline1.open = openMessage;
expandTimeline2.open = openMessage;
expandTimeline1.close = closeMessage;
expandTimeline2.close = closeMessage;
expandTimeline1.clear = clearMessage;
expandTimeline2.clear = clearMessage;
            
          
!
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