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

              
                <div class="container">
  <svg class="bezier-icon" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
     viewBox="0 0 200 100" style="enable-background:new 0 0 200 100;" xml:space="preserve" width="8em">
  <style type="text/css">
    .st0{fill:#fff;}
    .st1{fill:none;stroke:#fff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
  </style>
  <circle class="st0" cx="29.9" cy="50" r="4"/>
  <circle class="st0" cx="170.1" cy="50" r="4"/>
  <path class="st1" d="M17.5,68.4C40.7,54,69,50.4,95,50 M105,50c26-0.4,54.3-4,77.5-18.4 M91.8,50h-62 M108.2,50h62 M17.5,66.8h-10
    v10h10V66.8z M105,45H95v10h10V45z M192.5,23.2h-10v10h10V23.2z"/>
  </svg>
  <h1 class="container__headline">Bezier Curve Style Library</h1>
  <p class="container__subheading">Simple bezier curves and hover effects that you can use on your next project</p>
  <p class="container__subheading">Put away your phone, this only works if you can hover over these circles.</p>
  <p class="container__subheading"><a href="http://cubic-bezier.com/">Cubicbezier.com</a> is a great tool for creating better bezier curves.</p>
  <div id="shape1"></div>
  <div id="shape2"></div>
  <div id="shape3"></div>
  <div class="example__container">
    <div class="example">
      <div class="text__container">
        <h2 class="text">Easy Ease</h2>
      </div>
      <div class="circle" id="easy-ease"></div>
    </div>
    <div class="example">
      <div class="text__container">
        <h2 class="text">Big Bounce</h2>
      </div>
      <div class="circle" id="big-bounce"></div>
    </div>
    <div class="example">
      <div class="text__container">
        <h2 class="text">Little Bounce</h2>
      </div>
      <div class="circle" id="little-bounce"></div>
    </div>
    <div class="example">
      <div class="text__container">
        <h2 class="text">Grow Up</h2>
      </div>
      <div class="circle" id="grow-up"></div>
    </div>
    <div class="example">
      <div class="text__container">
        <h2 class="text">Smooth</h2>
      </div>
      <div class="circle" id="smooth"></div>
    </div>
    <div class="example">
      <div class="text__container">
        <h2 class="text">Pop</h2>
      </div>
      <div class="circle" id="pop"></div>
    </div>
  </div>
  <p class="container__subheading">Build by <a href="andrew-spencer.com">Andrew Spencer</a>.</p>
</div>
              
            
!

CSS

              
                //General styling code is here

//See bellow to explore the code for the transitions
//and feel free to use them in your own projects

//Colors
$circle: rgba(200, 200, 200, 1);
$circle-10l: lighten($circle, 10%);
$magenta: #ff00aa;

body {
  margin: 0;
}

.bezier-icon {
  display: block;
  margin: 0 auto;
}

.container {
  padding: 4em 0;
  background-color: #D1A475;
  background: linear-gradient(135deg, rgba(10, 10, 20, 0.92) 0%, rgba(10, 10, 20, 0.75) 100%), url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/664131/asfalt-dark.png);
  position: relative;
  
  &__headline {
    font-family: 'Roboto', Georgia, sans-serif;
    font-size: 3em;
    letter-spacing: -0.05em;
    text-align: center;
    margin-bottom: 0.25em;
    padding: 0 1em;
    color: #fff;
  }
  
  &__subheading {
    font-family: 'Cardo', Georgia, sans-serif;
    text-align: center;
    margin: 0.5em 0;
    padding: 0 1em;
    font-size: 0.75em;
    color: #aaa;
    
    & a {
      color: $magenta;
      text-decoration: none;
    }
  }
}

.circle {
  width: 4em;
  height: 4em;
  display: block;
  background-color: $circle;
  //border: 0.0625em solid $magenta;
  border-radius: 50%;
  box-shadow: 0 0.5em 1em rgba(0, 0, 0, 0.35), 0 0.5em 1em rgba(100, 0, 100, 0.10);
  
  &:hover {
    box-shadow: 0 1.25em 1.5em rgba(0, 0, 0, 0.25);
  }
  
  &:active {
    background-color: $circle-10l;
  }
}

.example__container {
  padding: 0 1em;
  margin-top: 4em;
  @media (min-width: 34em) {
    display: flex;
    justify-content: center;
    flex-flow: row wrap;
    flex-wrap: wrap;
    max-width: 40em;
    margin: 4em auto;
  }
  @media (min-width: 68em) {
    max-width: 56em;
  }
}

.example {
  display: block;
  margin: 0 auto 4em;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(215, 215, 215, 0.0) 100%);
  border: 0.0625em solid $magenta;
  height: 16em;
  max-width: 16em;
  padding: 1em;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  @media (min-width: 34em) {
    min-width: 10em;
    margin: 0 1em 2em;
    flex: 1;
  }
}

.text {
  display: inline;
  color: #000;
  font-family: 'Cardo', Georgia, sans-serif;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  background-color: #fff;
  border-bottom: 0.0625em solid $magenta;
  padding: 0.45em 0.25em 0.45em 0.5em;
  
  &__container {
    position: absolute;
    display: flex;
    justify-content: center;
    top: -1.4em;
    left: 0;
    width: 100%;
  }
}

#shape1 {
  width: 80vw;
  height: 40vh;
  background: linear-gradient(-135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.015));
  position: absolute;
  top: 0;
  left: 0;
}

#shape2 {
  width: 65vw;
  height: 24%;
  background: linear-gradient(-75deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.015));
  position: absolute;
  top: 30em;
  right: 0;
}

#shape3 {
  width: 70vw;
  height: 30%;
  background: linear-gradient(15deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.015));
  position: absolute;
  top: 45em;
  left: 0;
}

// -------------------------------------------
// All the code for the transitions lives here
// -------------------------------------------

#easy-ease {
  @extend .circle;
  transition: all 350ms ease, background-color 100ms ease;
  
  &:hover {
    width: 5em;
    height: 5em;
  }
}

#little-bounce {
  @extend .circle;
  transition: all 350ms cubic-bezier(.65, -0.40, .60, 1.23), background-color 100ms ease;
  
  &:hover {
    width: 5em;
    height: 5em;
  }
}

#big-bounce {
  @extend .circle;
  transition: all 350ms cubic-bezier(.65, -1.5, .40, 4.5);
  
  &:hover {
    width: 5em;
    height: 5em;
  }
}

#grow-up {
  @extend .circle;
  transition: all 150ms cubic-bezier(0.75, 0, 0.5, 1);
  
  &:hover {
    width: 5em;
    height: 5em;
  }
}

#smooth {
  @extend .circle;
  transition: all 350ms cubic-bezier(0, 0.8, 1, 1), background-color 100ms ease;
  
  &:hover {
    width: 5em;
    height: 5em;
  }
}

#pop {
  @extend .circle;
  transition: all 200ms cubic-bezier(1, 0.1, 0.9, 1), background-color 100ms ease;
  
  &:hover {
    width: 5em;
    height: 5em;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console