CodePen

HTML

            
              <div id="go">

		<a href="#go">Animate</a> <a href="#reset">Reset</a>

		<p>All of the animations below last exactly 2 seconds</p>

		<div class="one">
			<h2> cubic-bezier(.1,.9,.9,.1)</h2>
			<div class="box">
			</div>
		</div>

		<div class="two">
			<h2>cubic-bezier(.22,.81,.01,.99)</h2>
			<div class="box">
			</div>
		</div>

		<div class="three">
			<h2>cubic-bezier(.8,.1,1,.04)</h2>
			<div class="box">
			</div>
		</div>

		<div class="four">
			<h2>cubic-bezier(1,.45,0,.34)</h2>
			<div class="box">
			</div>
		</div>

	</div>
            
          
!

CSS

            
              .box {
  background: blue;
  width: 40px;
  height: 40px;
  -webkit-transition-duration: 2s;
  transition-duration: 2s;
}

.one .box {
  -webkit-transition-timing-function: cubic-bezier(.1,.9,.9,.1);
  transition-timing-function: cubic-bezier(.1,.9,.9,.1);
}
.two .box {
  -webkit-transition-timing-function: cubic-bezier(.22,.81,.01,.99);
  transition-timing-function: cubic-bezier(.22,.81,.01,.99);
}
.three .box {
  -webkit-transition-timing-function: cubic-bezier(.8,.1,1,.04);
  transition-timing-function: cubic-bezier(.8,.1,1,.04);
}
.four .box {
  -webkit-transition-timing-function: cubic-bezier(1,.45,0,.34);
  transition-timing-function: cubic-bezier(1,.45,0,.34);
}

#go:target .box {
  -webkit-transform: translate(300px);
  transform: translate(300px);
}

body {
  font: .7em Arial;
}

h2 {
  margin: 20px 0 5px;
}

a {
  padding: 5px 10px;
  background: blue;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 1.2em;
  display: inline-block;
  margin-top: 10px;
}

a:hover {
  opacity: 0.6;
}

p {
  font-size: 1.2em;
}
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              
            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................