Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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="maxcontainer">
  <div class="thebutton progressive">
    <div class="box toyfight">

      <div class="toyfight-container">
        <a href="#" class="box-arrow-link">
          <span class="box-arrow-1">
    <span class="arrow-head">
      <span></span>
          </span>
          </span>
          <span class="box-arrow-text" data-color="black">View Button
  </span>
          <span class="box-arrow-2">
    <span class="arrow-head">
      <span></span>
          </span>
          </span>
        </a>
      </div>
    </div>
    <div class="desccontainer">
      <a class="desc left" target="_blank" href="http://uibuttons.com/">ui buttons</a>
      <a class="desc right" target="_blank" href="#">Code</a>
    </div>
  </div>

  <div class="thebutton info">
    <div class="boxinformation">
      <h1>Toy Fight</h1>
      <p>Spans on spans on spans.</p>
      <p>Just some expert CSS interweaving of overflow hiddens and translateXs wrapped up in webs of spans and carefully timed transitions.</p>
      <p>A truly badass button via
        <a target="_blank" href="http://toyfight.co/">Toy Fight</a>
      </p>
    </div>

  </div>

</div>
              
            
!

CSS

              
                /*** Container ****/

.box.toyfight {
  background: #ffd42d;
}


/*** Button Code ****/

.toyfight-container {
  position: absolute;
  top: 50%;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  left: 0;
  right: 0;
  margin: auto;
  text-align: center;
}

a {}

.box-arrow-link {
  position: relative;
  border: 2px solid #fff;
  -webkit-transition: .52s cubic-bezier(.7, .3, 0, 1);
  transition: .52s cubic-bezier(.7, .3, 0, 1);
  -webkit-transform: translateX(-22px);
  transform: translateX(-22px);
  height: 38px;
  display: inline-block;
  text-decoration: none;
}

.box-arrow-link:hover {
  -webkit-transform: translateX(25px);
  transform: translateX(25px);
  -webkit-transition-delay: .15s;
  transition-delay: .15s;
}

.box-arrow-text {
  font-size: 11px;
  line-height: 36px;
  letter-spacing: .15em;
  padding: 20px 16px;
  text-transform: uppercase;
  color: #212121;
  font-family: "roboto", sans-serif;
  font-weight: 600;
}

.box-arrow-1 {
  position: absolute;
  height: 43px;
  width: 50px;
  top: -2px;
  overflow: hidden;
  right: 100%;
}

.box-arrow-1:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 38px;
  border-top: 2px solid #fff;
  border-bottom: 2px solid #fff;
  -webkit-transition: .55s cubic-bezier(.7, .3, 0, 1);
  transition: .55s cubic-bezier(.7, .3, 0, 1);
  -webkit-transform: translateX(105%);
  transform: translateX(105%);
  border-left: 2px solid #fff;
  -webkit-transform-origin: 100% 0;
  transform-origin: 100% 0;
  background-color: #FFF;
}

.box-arrow-link:hover .box-arrow-1:before {
  -webkit-transform: translateX(0);
  transform: translateX(0);
  -webkit-transition-delay: .22s;
  transition-delay: .22s;
}

.arrow-head {
  left: 50%;
  top: 50%;
  width: 20px;
  height: 26px;
  overflow: hidden;
  margin: -14px 0 0 -10px;
  position: absolute;
  color: #212121;
  overflow: hidden;
}

.box-arrow-1 .arrow-head span {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -webkit-transition: .45s cubic-bezier(.7, .3, 0, 1);
  transition: .45s cubic-bezier(.7, .3, 0, 1);
  overflow: hidden;
  -webkit-transform: translateX(-105%);
  transform: translateX(-105%);
}

.box-arrow-2 .arrow-head span {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -webkit-transition: .45s cubic-bezier(.7, .3, 0, 1);
  transition: .45s cubic-bezier(.7, .3, 0, 1);
  overflow: hidden;
}

.arrow-head span:before {
  content: '';
  position: absolute;
  top: 50%;
  background-color: #212121;
  height: 2px;
  width: 90%;
  left: 0;
  margin-top: -1px;
}

.arrow-head span:after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: url("http://toyfight.co/img/ui/arrow-head-black.svg") center center/100% no-repeat;
}

.box-arrow-link:hover .arrow-head span {
  -webkit-transform: translateX(0);
  transform: translateX(0);
  -webkit-transition-delay: .22s;
  transition-delay: .22s;
  width: 100%;
}

.box-arrow-2 {
  position: absolute;
  height: 43px;
  width: 50px;
  top: -2px;
  overflow: hidden;
  left: 100%;
}

.box-arrow-2:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  margin-left: -3px;
  border-right: 2px solid #fff;
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
  height: 38px;
  border-top: 2px solid #fff;
  border-bottom: 2px solid #fff;
  -webkit-transition: .55s cubic-bezier(.7, .3, 0, 1);
  transition: .55s cubic-bezier(.7, .3, 0, 1);
}

.box-arrow-link:hover .box-arrow-2:before {
  -webkit-transform: translateX(-105%);
  transform: translateX(-105%);
}

.box-arrow-link:hover .box-arrow-2 .arrow-head span {
  -webkit-transform: translateX(105%);
  transform: translateX(105%);
  -webkit-transition-duration: .35s;
  transition-duration: .35s;
}


/*** Foundation Code ****/

body {
  background-color: #f4f4f4;
  font-family: "Roboto", sans-serif;
}

a {
  text-decoration: none;
}

.maxcontainer {
  width: 100%;
  max-width: 1100px;
  margin: auto;
  overflow: auto;
}

@media screen and (min-width: 750px) {
  .maxcontainer {
    padding: 0;
  }
}

.thebutton {
  float: left;
  width: 95%;
  margin: 2.5% 2.5% 0 2.5%;
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.1);
}

@media screen and (min-width: 750px) {
  .thebutton {
    width: 47.5%;
    margin: 2.5% 1.25% 0 1.25%;
  }
}

.box {
  overflow: hidden;
  width: 100%;
  margin: auto;
  height: 0;
  position: relative;
  padding-bottom: 70%;
}

@media screen and (min-width: 650px) {
  .box {}
}

.desccontainer {
  position: relative;
  width: 100%;
  background: rgba(255, 255, 255, 1);
  float: left;
}

.desc {
  float: left;
  font-size: 11px;
  font-weight: 900;
  padding: 10px 0;
  letter-spacing: .25px;
  text-align: center;
  color: #bcbcbc;
  opacity: 1;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
  z-index: 2000;
  background: rgba(255, 255, 255, 1);
  transition: all .1s ease-in-out;
  -o-transition: all .1s ease-in-out;
  -moz-transition: all .1s ease-in-out;
  -webkit-transition: all .1s ease-in-out;
}

.desc.left {
  width: 49.7%;
  margin-right: .3%;
  box-shadow: 1px 0px 0px 0px rgba(235, 235, 235, 1);
}

.desc.right {
  width: 50%;
}

.boxinformation {
  background: none;
  color: #000;
  font-weight: 200;
  width: 100%;
  margin: auto;
  position: relative;
}

.boxinformation a {
  color: #000;
  opacity: .4;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
  font-weight: bold;
  text-decoration: underline;
}

.boxinformation a:hover {
  opacity: 1;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
}

.thebutton.info {
  box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0);
}
              
            
!

JS

              
                
              
            
!
999px

Console