css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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="foreground">
  <a class="about" href="https://codepen.io/michellebarker/post/a-web-design-advent-calendar" target="_blank">About</a>

<header class="wrapper wrapper--header">
  <h1>2015 Web Design Advent</h1>
  <h2>The best articles, videos and tips from the past year in web design</h2>
</header>

<main class="wrapper--main">
  
  <a class="arrow arrow--left">
    <svg class="arrow-left" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0" y="0" viewBox="0 0 90 90" xml:space="preserve"><style type="text/css">
</style><path class="arrow-1" d="M0 45c0 24.9 20.1 45 45 45s45-20.1 45-45C90 20.1 69.9 0 45 0S0 20.1 0 45zM19.3 45l23.8-26.5 6 5.3L33.6 41h37v8h-37L49 66.2l-6 5.3L19.3 45z"/></svg>
  </a>

  <div class="main">
  <div class="card-wrapper">
    <div class="card-under"></div>
    <div class="card">
      <div class="card-face front"><h1 class="number">1</h1></div>
      <div class="card-face back"></div>
    </div>
  </div>
    <div class="card__contents">
    <div class="contents__wrapper">
      <h3>Codrops CSS Reference</h3>
      <p>Back in February of this year, <a href="https://tympanus.net/codrops/" target="_blank">Codrops</a> released an extensive CSS Reference, written by <a href="https://sarasoueidan.com/" target="_blank">Sara Soueidan</a>. Since then, barely a day has gone by when I’m writing CSS that I haven’t referred to it &ndash; whether it’s brushing up on little-used attributes, or reminding myself of the shorthand values of a particular property.</p><p> Sara writes clearly and comprehensively, and is one of he most inspiring people working on the web today.</p><p>If you write CSS, you need this in your life!</p>
      <a class="article__link" href="https://tympanus.net/codrops/css_reference/" target="_blank">Visit the site</a>
      <a class="close">x</a>
      <svg id="holly" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0" y="0" viewBox="0 0 210.5 169.3" xml:space="preserve"><style type="text/css">
	.leaf{fill:#004136;}
	.berry1{fill:#B22B5C;}
	.berry2{fill:#CC2F60;}
	.berry3{fill:#E73362;}
</style><path class="leaf" d="M70.5 26.6c0 0 29.9 17.2 37.7 49.8 0 0 27.9-31.8 62.7 11.5 0 0 6-40.1 39.6-35.6 0 0-21.3-11.5-23.6-40.4 0 0-46.2 22.6-64.7-11.9C122.2 0 100.5 32.1 70.5 26.6zM70.2 35.4c0 0-19.9 27.4-52.4 31.6 0 0 28.1 30.5-17.7 59.9 0 0 38.4 10 30.6 42.3 0 0 13.4-19.6 41.9-18.8 0 0-17.2-47.4 18.3-61.8C90.8 88.6 61.7 64.1 70.2 35.4z"/><circle class="berry1" cx="76" cy="48" r="14.5"/><circle class="berry2" cx="71.8" cy="28.1" r="16.5"/><circle class="berry3" cx="54.9" cy="46.4" r="16.5"/></svg>
    </div>
  </div>
  </div>
  
    
  <a class="arrow arrow--right" href="https://codepen.io/raad/debug/vLBJWO"> 
    <svg id="arrow-right" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0" y="0" viewBox="0 0 90 90" xml:space="preserve"><path class="arrow-2" d="M45 0C20.1 0 0 20.1 0 45c0 24.9 20.1 45 45 45s45-20.1 45-45C90 20.1 69.9 0 45 0zM46.9 71.5l-6-5.3L56.4 49H19.7v-8h36.7L41 23.8l6-5.3L70.7 45 46.9 71.5z"/></svg>
  </a>
  
</main>
	<div class="text-box">
		<p>Sorry, no peeking before tomorrow!</p>
	</div>
</div>

<div class="background">
  <!--ground-->
  <svg class="background__ground" xmlns="http://www.w3.org/2000/svg" version="1.1" id="Layer_2" x="0" y="0" viewBox="0 0 1314 227.7" xml:space="preserve"><style type="text/css">
#ground{fill:#E7F4FA;}
</style><g id="ground"><path class="st0" d="M0 21.6c141-41.8 293.2-11.1 441.1-5.1 107.2 4.4 214.4-4.5 321.6-9.3C814.4 4.8 866.3 3.4 918 8c46.2 4.1 92 13.1 138.3 13.2 86.5 0.1 175.7-30.4 257.7-2.5v209H0V21.6z"/></g>
  
  </svg>
  <!--snowman-->
  <svg xmlns="http://www.w3.org/2000/svg" version="1.1" id="snowman" x="0" y="0" viewBox="0 -20 300 250" xml:space="preserve" enable-background="new 0 0 178 219.4">
    <ellipse id="shadow" transform="matrix(0.9976 -6.986409e-02 6.986409e-02 0.9976 -14.0967 6.4916)" class="st0" cx="85.8" cy="204.8" rx="68.9" ry="13.8"/>
  <g class="background__snowman">
    <style type="text/css">
    
	#shadow, #mouth{fill:#B9C3C6;}
	#arm-r{fill:none;stroke:#202123;stroke-width:3;stroke-miterlimit:10;}
#head, #body{fill:#E7F4FA;}
	#eyes{fill:#202123;}
#nose{fill:#E7B75C;}
	#arm-l{fill:none;stroke:#202123;stroke-width:4;stroke-miterlimit:10;}
#buttons{fill:#808080;}

  </style>
    
    <g id="arm-r">
      <polyline class="st1" points="130 91.5 155.5 66.5 173.1 63.5 176.5 52.4 "/>
      <line class="st1" x1="155" y1="67" x2="155" y2="52"/>
      <line class="st1" x1="165.4" y1="64.8" x2="176.5" y2="77"/>
    </g>
    <ellipse id="body" transform="matrix(0.9955 -9.424890e-02 9.424890e-02 0.9955 -12.4309 9.7989)" class="st2" cx="97.5" cy="136.5" rx="65" ry="71.5"/>
    <circle id="head" class="st2" cx="86.5" cy="41" r="41"/>
    <g id="eyes">
      <ellipse transform="matrix(0.9437 -0.3309 0.3309 0.9437 -8.0174 28.9066)" class="st3" cx="80.9" cy="38" rx="4.9" ry="6.5"/>
      <ellipse transform="matrix(0.9437 -0.3309 0.3309 0.9437 -4.1167 39.8191)" class="st3" cx="114.9" cy="32" rx="4.9" ry="6.5"/>
    </g>
    <ellipse id="nose" transform="matrix(0.9598 -0.2807 0.2807 0.9598 -8.8038 31.2377)" class="st4" cx="104.7" cy="46.4" rx="7.1" ry="5.4"/>
    <ellipse id="mouth" class="st5" cx="101.1" cy="63.8" rx="3.6" ry="3.2"/>
    <g id="arm-l">
      <polyline class="st6" points="61 103.5 22 85.5 16.5 65.1 7.5 60.5 "/>
      <line class="st6" x1="19.7" y1="76.8" x2="0.5" y2="82"/>
      <line class="st6" x1="32.1" y1="90.2" x2="19.7" y2="96"/>
    </g>
    <g id="buttons">
      <ellipse transform="matrix(0.9821 0.1884 -0.1884 0.9821 20.1032 -18.9613)" class="st7" cx="109.8" cy="96.2" rx="5.1" ry="4.8"/>
      <ellipse transform="matrix(0.9378 -0.3472 0.3472 0.9378 -34.9546 47.3867)" class="st7" cx="114.8" cy="121.2" rx="5.1" ry="4.8"/>
    </g>
  </g>
  </svg>
  <!--snowflakes-->
  <div class="container--snowflakes">
  <svg xmlns="http://www.w3.org/2000/svg" version="1.1" id="snowflakes" x="0" y="0" viewBox="0 0 1243 450" xml:space="preserve" enable-background="new 0 0 1243 258">
  <style type="text/css">
    
	.st0{fill:#E7F4FA;}

  </style>
  <g id="snowflakes-1">
    <circle class="st0" cx="592" cy="48" r="7"/>
    <circle class="st0" cx="833" cy="148" r="7"/>
    <circle class="st0" cx="371" cy="105" r="7"/>
    <circle class="st0" cx="115" cy="28" r="7"/>
    <circle class="st0" cx="1106" cy="208" r="7"/>
    <circle class="st0" cx="1032" cy="35" r="7"/>
  </g>
  <g id="snowflakes-2">
    <circle class="st0" cx="566" cy="162" r="7"/>
    <circle class="st0" cx="764" cy="21" r="7"/>
    <circle class="st0" cx="958" cy="184" r="7"/>
    <circle class="st0" cx="411" cy="201" r="7"/>
    <circle class="st0" cx="297" cy="7" r="7"/>
    <circle class="st0" cx="136" cy="141" r="7"/>
  </g>
  <g id="snowflakes-3">
    <circle class="st0" cx="726.5" cy="225.5" r="4.5"/>
    <circle class="st0" cx="688.5" cy="123.5" r="4.5"/>
    <circle class="st0" cx="252.5" cy="168.5" r="4.5"/>
    <circle class="st0" cx="480.5" cy="83.5" r="4.5"/>
    <circle class="st0" cx="1180.5" cy="83.5" r="4.5"/>
    <circle class="st0" cx="907.5" cy="40.5" r="4.5"/>
    <circle class="st0" cx="1025.5" cy="253.5" r="4.5"/>
  </g>
  <g id="snowflakes-4">
    <circle class="st0" cx="4.5" cy="214.5" r="4.5"/>
    <circle class="st0" cx="52.5" cy="87.5" r="4.5"/>
    <circle class="st0" cx="256.5" cy="78.5" r="4.5"/>
    <circle class="st0" cx="598.5" cy="237.5" r="4.5"/>
    <circle class="st0" cx="1021.5" cy="123.5" r="4.5"/>
    <circle class="st0" cx="1238.5" cy="176.5" r="4.5"/>
  </g>
</svg>
  </div>

</div>

            
          
!
            
              $dk-blue: #003154;
$md-blue: #64A9EA;
$white: #E7F4FA;
$black: #0C1110;

*, html, body {
  box-sizing: border-box;
}

body {
  height: 100vh;
  background-color: $white;
  overflow-x: hidden;
  font-family: 'Lato', sans-serif;
  color: $black;
}

.background {
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient($dk-blue, $md-blue) no-repeat;
}

.foreground {
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 1000;
	opacity: .99;
}

svg.background__ground {
  position: absolute;
  bottom: 0;
  @media screen and (min-width: 1100px) {
    bottom: -2em;
  }
  @media screen and (min-width: 1400px) {
    bottom: -4em;
  }
}

#snowman {
  width: 18em;
  position: absolute;
  bottom: 0;
  margin: 1em;
  @media screen and (min-width: 720px) {
    bottom: 3em;
    left: 2em;
  }
  @media screen and (min-width: 900px) {
    bottom: 5em;
    left: 3em;
  }
  @media screen and (min-width: 1100px) {
    left: 5em;
  }
  @media screen and (min-width: 1500px) {
    bottom: 8em;
  }
}

g.background__snowman {
  animation: rock 6s ease-in-out 2s infinite;
  transform-origin: 50% 100%;
}

#snowflakes {
}

.container--snowflakes {
  max-width: 1200px;
  margin: 3em auto 1em auto;
}

#snowflakes-1 {
  opacity: 0;
  animation: snowfall 2.2s ease-out 1s infinite;
}

#snowflakes-2 {
  opacity: 0;
  animation: snowfall 2.5s ease-out .7s infinite;
}

#snowflakes-3 {
  opacity: 0;
  animation: snowfall 3s ease-out 1.2s infinite;
}

#snowflakes-4 {
  opacity: 0;
  animation: snowfall 2.8s ease-out .8s infinite;
}

@keyframes snowfall {
  0% { opacity: 0; }
  40% { opacity: 1; }
  70% { opacity: 0;  }
  100% { transform: translate(-2em, 10em); }
}

@keyframes rock {
  0% { transform: rotate(0); }
  60% { transform: rotate(-2deg); }
  80% { transform: rotate(1deg); }
  100% { transform: rotate(0); }
}

/* Foreground styles */

h1 {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .03em;
}

h2 {
  font-weight: 400;
  font-size: 1em;
}

.about {
  display: block;
  max-width: 8em;
  float: right;
  padding: 1em;
  text-transform: uppercase;
	text-decoration: none;
  letter-spacing: .06em;
  cursor: pointer;
  text-align: center;
  font-size: .9em;
  background-color: darken($dk-blue, 3%);
  color: $md-blue;
  border-radius: .5em;
  margin: 1em;
}

.wrapper--header {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 52em;
  margin: 0 auto;
  padding: 1em;
  z-index: -10000000;
  text-align: center;
  h1 {
    color: $white;
    text-shadow: -.1em .1em .5em $dk-blue;
  }
  h2 {
    color: darken($dk-blue, 5%);
  }
}

.wrapper--main {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 1em;
}

.card-wrapper,
.card-face,
.card-under {
  width: 10em;
  height: 10em;
}

.card-wrapper {
  position: relative;
  cursor: pointer;
}

.card {
  z-index: 100;
}

.card-face {
  position: absolute;
  overflow: hidden;
  border-radius: .5em;
  z-index: 200;
}

.front {
  background: linear-gradient(45deg, $dk-blue, $md-blue);
  display: flex;
  justify-content: center;
  align-items: center;
  h1 {
    font-size: 3em;
    color: $dk-blue;
  }
}

.back {
  background-color: darken($dk-blue, 5%);
}

.card-under {
  position: absolute;
  top: 0;
  left: 0;
  background-color: $dk-blue;
  z-index: 0;
  border-radius: .5em;
  box-shadow: -.3em .3em .2em darken($dk-blue, 5%) inset;
}

.front {
  border-top: 2px solid $md-blue;
  border-right: 2px solid $md-blue;
  border-bottom: 2px solid $dk-blue;
  border-left: 2px solid $dk-blue;
}

.card-under {
  border-top: 2px solid darken($dk-blue, 5%);
  border-right: 2px solid darken($dk-blue, 5%);
  border-bottom: 2px solid darken($dk-blue, 5%);
}

.card__contents {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 999999999;
  .contents__wrapper {
    position: relative;
    max-width: 40em;
    margin: 0 auto;
    background-color: $white;
    padding: 2em;
    border: 1px solid darken($white, 10%);
    box-shadow: -.1em .1em .5em $dk-blue;
  }
  p {
    line-height: 1.4;
  }
  a {
    color: $md-blue;
    &.article__link {
      padding: .5em;
      background-color: $md-blue;
      border-radius: .3em;
      color: $white;
      text-decoration: none;
      transition: all .2s ease-in-out;
      &:focus, &:hover, &:active {
        background-color: $dk-blue;
        color: $white;
      }
    }
    &:focus, &:hover, &:active {
      color: $dk-blue;
    }
  }
  a.close {
    position: absolute;
    top: 1em;
    right: 1em;
    cursor: pointer;
    padding: .2em;
    width: 2em;
    height: 2em;
    text-align: center;
    border-radius: 50%;
    border: 2px solid $md-blue;
    font-weight: 700;
    transition: all .2s ease-in-out;
    &:focus, &:hover, &:active {
      border: 2px solid $dk-blue;
    }
  }
  #holly {
    position: absolute;
    top: -1em;
    left: -.5em;
    width: 6em;
  }
}

.arrow {
  display: block;
  width: 2.5em;
  height: 2.5em;
	cursor: pointer;
	fill: $dk-blue;
  opacity: .5;
	transition: all .3s ease-in-out;
	&:focus, &:hover, &:active {
		opacity: 1;
	}
}

.text-box {
	position: absolute;
	top: 45vh;
	width: 100%;
	text-align: center;
	p {
		max-width: 20em;
		margin: 0 auto;
		background-color: orange;
		padding: 1em;
		border-radius: .2em;
		box-shadow: -.1em .1em .5em $dk-blue;
	}
}


/* Tablet styles */

@media screen and (min-width: 22em) {
  
  .card-wrapper,
  .card-face,
  .card-under {
    width: 12em;
    height: 12em;
  }
}

@media screen and (min-width: 720px) {
  
  .wrapper--header,
  .wrapper--main {
    padding: 1em 2em;
  }
  
  h1 {
    font-size: 2.2em;
  }
  
  h2 {
    font-size: 1.1em;
  }
  
  .card-wrapper,
  .card-face,
  .card-under {
    width: 16em;
    height: 16em;
  }
  
  .front {
    h1 {
      font-size: 5em;
    }
  }
}

@media screen and (min-width: 1100px) {
  
  h1 {
    font-size: 2.8em;
    margin-bottom: .5em;
  }
  h2 {
    font-size: 1.2em;
  }
}

@media screen and (min-width: 1400px) {
  .card-wrapper,
  .card-face,
  .card-under {
    width: 22em;
    height: 22em;
  }
  .wrapper--header {
    padding: 2em;
  }
  
  h1 {
    font-size: 3.4em;
    margin-bottom: .5em;
  }
  h2 {
    font-size: 1.4em;
  }
}
            
          
!
            
              $(document).ready(function(){

TweenLite.set(".card-wrapper");
TweenLite.set(".card", {transformStyle: "preserve-3d", transformOrigin: "left 50%", transformPerspective: 1800});
TweenLite.set(".back", {rotationY: 180});
TweenLite.set([".back", ".front"], {backfaceVisibility: "hidden"});
 TweenLite.set(".card__contents", { scale: 0, autoAlpha: 0});
  
  
  $('.card-wrapper').bind({
    click: function() {
      TweenLite.to($(this).find(".card"), 0.8, {rotationY:-120, ease:Back.easeOut});
     TweenLite.to(".card__contents", 1.2, {scale: 1, autoAlpha: 1, delay: 0.5, ease:Elastic.easeOut});
    }
});  
  
  $('.close').bind({
    click: function() {
     TweenLite.to(".card__contents", 0.4, {scale: 0, autoAlpha: 0, ease:Power1.easeOut});
      TweenLite.to(".card", 0.6, {rotationY: 0, delay: 0.5, ease: Power1.easeOut});
    }
}); 
	
	TweenLite.set(".text-box", {autoAlpha: 0, y: '20px'});
	
	/*$('.arrow--right').bind({
    click: function() {
     TweenLite.to(".text-box", 0.8, {autoAlpha: 1, y: '0px', ease:Power1.easeOut});
			TweenLite.to(".text-box", 0.8, {autoAlpha: 0, y: '40px', delay: 2, ease:Power1.easeIn});
    }
});*/
  
});


            
          
!
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.
Loading ..................

Console