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.

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="app">
  <svg class="menu" id="menu" width="172.5" height="242.5" viewBox="-15 -15 190 260">
    <symbol id="icon-2" viewBox="0 0 35 35">
      <path fill="#BD8590" d="M0.5 31.983c0.268 0.067 0.542-0.088 0.612-0.354 1.030-3.843 5.216-4.839 7.718-5.435 0.627-0.149 1.122-0.267 1.444-0.406 2.85-1.237 3.779-3.227 4.057-4.679 0.034-0.175-0.029-0.355-0.165-0.473-1.484-1.281-2.736-3.204-3.526-5.416-0.022-0.063-0.057-0.121-0.103-0.171-1.045-1.136-1.645-2.337-1.645-3.294 0-0.559 0.211-0.934 0.686-1.217 0.145-0.087 0.236-0.24 0.243-0.408 0.221-5.094 3.849-9.104 8.299-9.13 0.005 0 0.102 0.007 0.107 0.007 4.472 0.062 8.077 4.158 8.206 9.324 0.004 0.143 0.068 0.277 0.178 0.369 0.313 0.265 0.459 0.601 0.459 1.057 0 0.801-0.427 1.786-1.201 2.772-0.037 0.047-0.065 0.101-0.084 0.158-0.8 2.536-2.236 4.775-3.938 6.145-0.144 0.116-0.212 0.302-0.178 0.483 0.278 1.451 1.207 3.44 4.057 4.679 0.337 0.146 0.86 0.26 1.523 0.403 2.477 0.536 6.622 1.435 7.639 5.232 0.060 0.223 0.262 0.37 0.482 0.37 0.043 0 0.086-0.006 0.13-0.017 0.267-0.072 0.425-0.346 0.354-0.613-1.175-4.387-5.871-5.404-8.393-5.95-0.585-0.127-1.090-0.236-1.336-0.344-1.86-0.808-3.006-2.039-3.411-3.665 1.727-1.483 3.172-3.771 3.998-6.337 0.877-1.14 1.359-2.314 1.359-3.317 0-0.669-0.216-1.227-0.644-1.663-0.238-5.604-4.237-10.017-9.2-10.088l-0.149-0.002c-4.873 0.026-8.889 4.323-9.24 9.83-0.626 0.46-0.944 1.105-0.944 1.924 0 1.183 0.669 2.598 1.84 3.896 0.809 2.223 2.063 4.176 3.556 5.543-0.403 1.632-1.55 2.867-3.414 3.676-0.241 0.105-0.721 0.22-1.277 0.352-2.541 0.604-7.269 1.729-8.453 6.147-0.071 0.267 0.087 0.54 0.354 0.612z"></path>
    </symbol>
    <symbol id="icon-3" viewBox="0 0 35 35">
      <path fill="#BD8590" d="M0 31.479c0 0.276 0.224 0.5 0.5 0.5h31.111c0.067 0 0.132-0.013 0.193-0.039s0.116-0.063 0.162-0.109c0.001-0.001 0.002-0.001 0.003-0.002 0.003-0.003 0.003-0.009 0.007-0.012 0.051-0.055 0.084-0.122 0.107-0.195 0.007-0.023 0.010-0.045 0.014-0.069 0.004-0.025 0.015-0.047 0.015-0.073 0-0.040-0.014-0.075-0.023-0.112-0.003-0.014 0.003-0.028-0.002-0.042l-3.16-9.715c-0.024-0.075-0.066-0.144-0.122-0.199l-17.117-17.118c-0.018-0.028-0.031-0.058-0.055-0.083l-3.739-3.739c-0.607-0.607-1.595-0.607-2.203 0l-5.235 5.235c-0.294 0.294-0.456 0.685-0.456 1.101s0.162 0.808 0.456 1.102l3.656 3.656c0.018 0.027 0.030 0.058 0.054 0.082l17.090 17.205c0.059 0.060 0.131 0.103 0.212 0.127l6.713 2h-27.681c-0.276-0.001-0.5 0.223-0.5 0.499zM6.362 10.161l15.687 15.486-0.577 2.002-16.245-16.353 1.135-1.135zM22.816 25l-15.748-15.545 2.437-2.437 15.607 15.648v2.334h-2.296zM25.735 21.875l-15.523-15.564 1.039-1.039 16.211 16.211-1.727 0.392zM22.988 26h2.624c0.276 0 0.5-0.224 0.5-0.5v-2.685l2.007-0.456 2.723 8.37-8.488-2.529 0.634-2.2zM1 6.808c0-0.149 0.058-0.288 0.163-0.394l5.235-5.235c0.217-0.217 0.57-0.218 0.789 0l3.372 3.372-6.023 6.023-3.372-3.372c-0.106-0.105-0.164-0.245-0.164-0.394z"></path>
    </symbol>
    <symbol id="icon-4" viewBox="0 0 35 35">
      <path fill="#BD8590" d="M28.354 1.354c0.115-0.115 0.167-0.279 0.139-0.439s-0.132-0.297-0.28-0.366c-2.291-1.080-5.010-0.606-6.798 1.191-1.698 1.709-2.291 4.393-1.499 6.637l-11.539 11.539c-0.627-0.224-1.297-0.336-1.996-0.336-1.714 0-3.376 0.682-4.559 1.872-1.782 1.792-2.284 4.44-1.281 6.747 0.066 0.152 0.203 0.262 0.366 0.292 0.164 0.031 0.331-0.021 0.447-0.139l3.491-3.509c0.23-0.232 0.601-0.263 0.793-0.068l1.507 1.577c0.219 0.221 0.209 0.562-0.022 0.795l-3.478 3.5c-0.115 0.115-0.166 0.279-0.138 0.439s0.132 0.296 0.279 0.365c0.829 0.391 1.701 0.588 2.591 0.588 1.572 0 3.065-0.632 4.207-1.78 1.698-1.708 2.291-4.392 1.498-6.636l11.539-11.54c0.628 0.224 1.298 0.336 1.997 0.336 1.714 0 3.376-0.682 4.559-1.872 1.782-1.792 2.284-4.44 1.281-6.747-0.066-0.152-0.203-0.262-0.366-0.292-0.161-0.028-0.33 0.021-0.447 0.139l-3.491 3.509c-0.215 0.216-0.58 0.214-0.801-0.010l-1.499-1.499c-0.226-0.227-0.225-0.568-0.001-0.794l3.501-3.499zM24.146 6.354l1.499 1.499c0.599 0.602 1.625 0.605 2.218 0.009l2.93-2.944c0.469 1.741-0.016 3.609-1.324 4.926-0.997 1.003-2.399 1.577-3.85 1.577-0.683 0-1.33-0.128-1.923-0.38-0.188-0.081-0.405-0.037-0.549 0.106l-12 12c-0.144 0.144-0.186 0.36-0.107 0.547 0.803 1.91 0.314 4.375-1.163 5.861-1.321 1.328-3.244 1.801-4.985 1.258l2.941-2.96c0.621-0.625 0.631-1.594 0.029-2.198l-1.506-1.577c-0.581-0.585-1.614-0.549-2.218 0.062l-2.93 2.944c-0.469-1.741 0.016-3.609 1.324-4.926 0.997-1.003 2.399-1.577 3.85-1.577 0.683 0 1.33 0.128 1.923 0.38 0.187 0.082 0.405 0.037 0.549-0.106l12-12c0.144-0.144 0.186-0.36 0.107-0.547-0.803-1.91-0.314-4.376 1.163-5.862 1.32-1.328 3.242-1.798 4.982-1.258l-2.96 2.961c-0.616 0.617-0.616 1.585 0 2.205zM29.21 30.647c-0.221 0.222-0.604 0.222-0.827-0.002l-10.030-10c-0.195-0.193-0.512-0.194-0.707 0.002s-0.194 0.512 0.001 0.707l10.029 9.998c0.3 0.301 0.698 0.467 1.122 0.467 0 0 0 0 0 0 0.424 0 0.822-0.166 1.128-0.474l1.429-1.493c0.615-0.618 0.615-1.587-0.001-2.206l-10-10c-0.195-0.195-0.512-0.195-0.707 0s-0.195 0.512 0 0.707l9.999 9.999c0.229 0.23 0.229 0.564-0.007 0.802l-1.429 1.493zM5.854 3.146l-3-3c-0.195-0.195-0.512-0.195-0.707 0l-2 2c-0.195 0.195-0.195 0.512 0 0.707l3 3c0.097 0.098 0.225 0.147 0.353 0.147s0.256-0.049 0.354-0.146l0.646-0.647 7.646 7.646c0.098 0.098 0.226 0.147 0.354 0.147s0.256-0.049 0.354-0.146c0.195-0.195 0.195-0.512 0-0.707l-7.647-7.647 0.646-0.646c0.196-0.196 0.196-0.512 0.001-0.708zM3.5 4.793l-2.293-2.293 1.293-1.293 2.293 2.293-1.293 1.293z"></path>
    </symbol>
    <symbol id="icon-5" viewBox="0 0 35 35">
      <path fill="#BD8590" d="M1.5 9c-0.276 0-0.5 0.224-0.5 0.5v20.946c0 0.665 0.316 1.039 0.582 1.235 0.318 0.236 0.692 0.319 1.026 0.319 0.201 0 0.387-0.030 0.538-0.077 2.929-0.895 9.345-7.482 10.973-9.19 1.587 1.718 7.805 8.295 10.734 9.19 0.404 0.124 1.055 0.135 1.564-0.243 0.267-0.196 0.583-0.569 0.583-1.234v-20.946c0-0.276-0.224-0.5-0.5-0.5s-0.5 0.224-0.5 0.5v20.946c0 0.27-0.101 0.375-0.177 0.431-0.178 0.132-0.484 0.15-0.677 0.091-3.040-0.929-10.575-9.22-10.65-9.303-0.094-0.104-0.227-0.164-0.367-0.165-0.127-0.001-0.273 0.056-0.369 0.159-0.078 0.083-7.862 8.378-10.906 9.309-0.192 0.059-0.499 0.041-0.677-0.091-0.076-0.056-0.177-0.162-0.177-0.431v-20.946c0-0.276-0.224-0.5-0.5-0.5zM28 6.5v-5c0-0.827-0.673-1.5-1.5-1.5h-25c-0.827 0-1.5 0.673-1.5 1.5v5c0 0.276 0.224 0.5 0.5 0.5h27c0.276 0 0.5-0.224 0.5-0.5zM27 6h-26v-4.5c0-0.276 0.224-0.5 0.5-0.5h25c0.276 0 0.5 0.224 0.5 0.5v4.5z"></path>
    </symbol>
    <g id="symbolsContainer"/>
    <circle class="big-circle" opacity="0.9" fill="#842B3C" cx="121.7" cy="120.7" r="120.7"/>
    <g id="itemsContainer">
      <a id="item-2" transform="matrix(0.5,-0.86602,0.86602,0.5,-91.5063509461097,341.5063509461096)" xlink:title="" xlink:target="_parent">
        <path opacity="0.9" fill="none" d="M297.8 74.2l119.7 0c0-42.8-22.8-82.3-59.8-103.7L297.8 74.2z"/>
        <use xlink:href="#icon-2" width="70" height="70" x="-35" y="-35" transform="matrix(0.236 0.4087 -0.4087 0.236 368.319 33.5341)" overflow="visible"/>
      </a>
      <a id="item-3" transform="matrix(-0.49999,-0.86602,0.86602,-0.49999,158.49364905389024,591.5063509461097)" xlink:title="" xlink:target="_parent">
        <path opacity="0.9" fill="none" d="M426.1 203.5l119.7 0c0-42.8-22.8-82.3-59.8-103.7L426.1 203.5z"/>
        <use xlink:href="#icon-5" width="70" height="70" x="-35" y="-35" transform="matrix(0.236 0.4087 -0.4087 0.236 496.6274 162.8405)" overflow="visible"/>
      </a>
      <a id="item-4" transform="matrix(-1,0,0,-1,500,500)" xlink:title="" xlink:target="_parent">
        <path opacity="0.9" fill="none" d="M378.3 379.3H498c0-42.8-22.8-82.3-59.8-103.7L378.3 379.3z"/>
        <use xlink:href="#icon-3" width="70" height="70" x="-35" y="-35" transform="matrix(0.236 0.4087 -0.4087 0.236 448.7935 338.6109)" overflow="visible"/>
      </a>
      <a id="item-5" transform="matrix(-0.5,0.86602,-0.86602,-0.5,591.5063509461097,158.4936490538905)" xlink:title="" xlink:target="_parent">
        <path opacity="0.9" fill="none" d="M202.2 425.8h119.7c0-42.8-22.8-82.3-59.8-103.7L202.2 425.8z"/>
        <use xlink:href="#icon-4" width="70" height="70" x="-35" y="-35" transform="matrix(0.236 0.4087 -0.4087 0.236 272.6586 385.074)" overflow="visible"/>
      </a>
    </g>
    <g id="trigger">
      <circle fill="#842B3C" cx="128.7" cy="126.7" r="33.5"/>
    </g>
    <g class="menu-hamburger">
      <path id="menu3" fill="#BD8590" d="M112.694,113.692h18c0.275,0,0.512,0.098,0.707,0.293s0.293,0.431,0.293,0.707
        s-0.098,0.512-0.293,0.707s-0.432,0.293-0.707,0.293h-18c-0.276,0-0.512-0.098-0.707-0.293s-0.293-0.431-0.293-0.707
        s0.098-0.512,0.293-0.707S112.418,113.692,112.694,113.692z"/>
      <path id="menu2" fill="#BD8590" d="M131.401,121.399c-0.195,0.195-0.432,0.293-0.707,0.293h-18c-0.276,0-0.512-0.098-0.707-0.293
        s-0.293-0.431-0.293-0.707s0.098-0.512,0.293-0.707s0.431-0.293,0.707-0.293h18c0.275,0,0.512,0.098,0.707,0.293"/>
      <path id="menu1" fill="#BD8590" d="M112.694,125.692h18c0.275,0,0.512,0.098,0.707,0.293s0.293,0.432,0.293,0.707
        s-0.098,0.512-0.293,0.707s-0.432,0.293-0.707,0.293h-18c-0.276,0-0.512-0.098-0.707-0.293s-0.293-0.432-0.293-0.707
        s0.098-0.512,0.293-0.707S112.418,125.692,112.694,125.692z"/>
    </g>
    <path class="line-draw" fill="none" stroke="#BD8590" stroke-width="2" stroke-miterlimit="10" d="M131.4 121c0 0-69.6 3.5-26.5-29.3 0 0 23.9-12.5 39.8 5.7 0 0 18.8 16.5 5 41.8 0 0-14.2 21.6-42.3 11.8 0 0-16.1-8.1-19.1-23.3 0 0-1.9-21.4 11-31.5"/>
    <g id="x-replace">
      <line fill="none" stroke="#BD8590" stroke-width="2" stroke-miterlimit="10" x1="114.625" y1="113.462" x2="129.75" y2="128.541"/>
      <line fill="none" stroke="#BD8590" stroke-width="2" stroke-miterlimit="10" x1="114.625" y1="128.384" x2="129.75" y2="113.462"/>
    </g>
  </svg>
  <div class="text">
  <h2>In Shadows</h2>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque non elit nec nulla pulvinar semper. Donec sed maximus mauris. Nullam auctor velit ut fermentum dignissim. Cras ac ante sit amet ex pellentesque bibendum eu nec magna. Morbi elementum est sapien, sit amet mattis tortor faucibus vitae. Aliquam ornare mi nisi, sit amet vestibulum nisi rutrum ut.</p>
  </div><!--text-->
  <footer>
    <svg class="arrow-left" width="24" height="24" viewBox="0 0 24 24">
      <path fill="#842B3C" d="M10 4q0.414 0 0.707 0.293t0.293 0.707q0 0.422-0.297 0.711l-5.289 5.289h15.586q0.414 0 0.707 0.293t0.293 0.707-0.293 0.707-0.707 0.293h-15.586l5.289 5.289q0.297 0.289 0.297 0.711 0 0.414-0.293 0.707t-0.707 0.293q-0.422 0-0.711-0.289l-7-7q-0.289-0.305-0.289-0.711t0.289-0.711l7-7q0.297-0.289 0.711-0.289z"></path>
    </svg>
    <svg class="arrow-right" width="24" height="24" viewBox="0 0 24 24">
      <path fill="#842B3C" d="M14 4q0.422 0 0.711 0.289l7 7q0.289 0.289 0.289 0.711t-0.289 0.711l-7 7q-0.289 0.289-0.711 0.289-0.43 0-0.715-0.285t-0.285-0.715q0-0.422 0.289-0.711l5.297-5.289h-15.586q-0.414 0-0.707-0.293t-0.293-0.707 0.293-0.707 0.707-0.293h15.586l-5.297-5.289q-0.289-0.289-0.289-0.711 0-0.43 0.285-0.715t0.715-0.285z"></path>
    </svg>
  </footer>
</div><!--app-->
              
            
!

CSS

              
                /*----------------------------------
looks best full screen: 
https://codepen.io/sdras/full/Kwjyzo/
-----------------------------------*/

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  min-height: 760px;
  height: 100vh;
  background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/28963/bk-lg.jpg") no-repeat center center;
  background-size: cover;
  font-family: 'Josefin Sans', sans-serif;
  color: #fff;
}

.app {
  width: 400px;
  height: 700px;
  position: absolute;
  left: 50%;
  margin-left: -200px;
  margin-top: 20px;
  background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/28963/app-bk.png") top center no-repeat #333c4d;
}

.menu {
  float: right;
  margin-top: 140px;
}

#itemsContainer, .line-draw, .big-circle, #x-replace {
  visibility: hidden;
  -webkit-backface-visibility: hidden;
  perspective: 1000;
  z-index: 1;
}

#menu1, #menu2, #menu3 {
  -webkit-backface-visibility: hidden;
  perspective: 1000;
  z-index: 1;
  cursor: pointer;
}

#trigger {
  cursor: pointer;
}

.text {
  margin-top: 355px;
  width: 80%;
  margin-left: 10%;
  color: #f9f7eb;
  h2 {
    text-transform: uppercase;
    font-weight: 300;
    letter-spacing: 0.04em;
  }
  p {
    padding-top: 5px;
    line-height: 1.4em;
    font-size: 17px;
    letter-spacing: 0.025em;
  }
}

footer {
  bottom: 0;
  position: absolute;
  width: 100%;
  height: 60px;
  background: #1d0829;
}

.arrow-left {
  margin-top: 15px;
  margin-left: 15px;
}

.arrow-right {
  float: right;
  margin-top: 15px;
  margin-right: 15px;
}

@-moz-document url-prefix() { 
  #item2 {
     margin-left: 20px;
  }
}

              
            
!

JS

              
                /*----------------------------------
looks best full screen: 
https://codepen.io/sdras/full/Kwjyzo/
-----------------------------------*/

var $line = $(".line-draw"),
$mHam = $(".menu-hamburger"),
$iCont = $("#itemsContainer"),
$bCirc = $(".big-circle"),
$m1 = $("#menu1"),
$m2 = $("#menu2"),
$m3 = $("#menu3"),
$xR = $("#x-replace"),
$trigger = $("#trigger circle"),
$iCi = $("#itemsContainer use");

TweenMax.set([$iCont, $line, $bCirc], {
  visibility:"visible" 
});

TweenMax.set($iCi, {
  opacity:0, scale:0
});

TweenMax.set($trigger, {
  scale:0.8
});

TweenMax.set($line, {
  drawSVG:'0% -20%'
});

//var isFF = !!window.sidebar;

var isSafari = /constructor/i.test(window.HTMLElement);

// menu comes in
function sceneOne() {
  var tl = new TimelineLite();
  
  tl.add( "start");
  tl.fromTo($trigger, 3, {scale:0.8, transformOrigin:"50% 50%"}, {scale:1, transformOrigin:"50% 50%",  ease:Elastic.easeOut}, "start")
  .fromTo($line, 0.75, {scale:0.65}, {scale:1}, "start")
  .to($line, 0.75, {drawSVG:'120% 100%', opacity:0.6, stroke:"#b5324b", ease:Sine.easeOut}, "start+=1")
  .to($m2, 0.25, {opacity:0, ease:Expo.easeOut}, "start+=1");
  
  if (isSafari) {
    tl.to([$m1, $m3], 0.4, {opacity:0}, "start+=1");
  	tl.fromTo($xR, 0.5, {opacity:0}, {opacity:1}, "start+=1");
  } else {
    tl.to($m1, 0.5, {rotation:-45, transformOrigin:"0% 0%", y:2, x:2, opacity:0.6, ease:Back.easeOut}, "start+=1");
  	tl.to($m3, 0.5, {rotation:45, transformOrigin:"0% 0%", x:4, opacity:0.6, ease:Back.easeOut}, "start+=1");
  }
  
  tl.fromTo($bCirc, 1.65, {scale:0.2, opacity:0, transformOrigin:"50% 50%"}, {scale:1, opacity:0.75, transformOrigin:"50% 50%", ease:Back.easeOut}, "start+=1.2")
  .staggerFromTo($iCi, 0.5, {rotation:-200}, {rotation:61, ease:Sine.easeOut}, 0.1, "start+=0.9")
  .staggerTo($iCi, 0.5, {opacity:1, scale:0.4, ease:Sine.easeOut}, 0.09, "start+=1.4");
  
  tl.timeScale(1.8);
  
  return tl;
}

// menu goes away
function sceneTwo() {
  var tl = new TimelineLite();
  
  tl.add( "goBack");
  tl.staggerTo($iCi, 0.4, {opacity:0, rotation:-200, scale:0, ease:Back.easeOut}, 0.1, "goBack")
  .to($bCirc, 4, {scale:0.2, opacity:0, transformOrigin:"50% 50%", ease:Elastic.easeOut}, "goBack+=0.25")
  .to($line, 0.5, {drawSVG:'0% -10%', opacity:0.6, stroke:"#BD8590", opacity:0.7, scale:0.65, transformOrigin:"50% 50%", ease:Sine.easeOut}, "goBack+=0.5")
  .to($m2, 0.25, {opacity:1, ease:Expo.easeOut}, "goBack+=0.75");
  	tl.to($m1, 0.5, {rotation:0, transformOrigin:"0% 0%", y:0, x:0, opacity:1, ease:Back.easeOut}, "goBack+=0.75");
  	tl.to($m3, 0.5, {rotation:0, transformOrigin:"0% 0%", x:0, opacity:1, ease:Back.easeOut}, "goBack+=0.75");
  
  if (isSafari) {
    tl.to([$m1, $m3], 0.5, {opacity:1}, "start+=1");
  	tl.to($xR, 0.3, {opacity:0}, "goBack+=0.75");
  } 
  
  tl.to($trigger, 2, {scale:0.8, transformOrigin:"50% 50%",  ease:Elastic.easeOut}, "goBack+=0.75");
  
  tl.timeScale(1.6);
 
  return tl;
}

$(document).ready(function(){ 
  var master = new TimelineLite();
  master.add(sceneOne(), "scene1", "+=2")
        .add(sceneTwo(), "scene2", "+=1");

//master.seek("scene1+=4");

var menuT = document.getElementById('menu');
var mTrig = true;

$(menuT).on('click', function (e) {
    e.preventDefault();
    if (mTrig === false) {
      sceneTwo().restart();
      mTrig = true;
    } else {
      sceneOne().restart();
      mTrig = false;
    }
  });
});
              
            
!
999px

Console