cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              <div class="wrapper">

  <header>
    <h1>Buttons</h1>
    <p>View Source: <a href="http://codepen.io/maee_co/pen/26f4a9f4f35a849eac6ad057425f3517" target="_blank">CODEPEN</a><br>
      Designed by: <a href="http://maee.co" target="_blank">mae</a>
    </p>
  </header>

  <div class="content">
    <section>
      <h2>
        <i class="fa fa-hand-o-down" aria-hidden="true"></i>
        Simple</h2>
      <p>
        <a class="button" href="">Simple</a>
      <p>
    </section>

    <section>
      <h2>
        <i class="fa fa-hand-o-down" aria-hidden="true"></i>
        Colors
      </h2>
      <p>
        <a class="button is-pink" href="">Pink</a>
        <a class="button is-lime" href="">Lime</a>
        <a class="button is-cyan" href="">Cyan</a>
        <a class="button is-purple" href="">Purple</a>
      </p>
    </section>

    <section>
      <h2>
        <i class="fa fa-hand-o-down" aria-hidden="true"></i>
        Sizes
      </h2>
      <p>
        <a class="button is-small" href="">small</a><br>
        <a class="button" href="">medium</a><br>
        <a class="button is-large" href="">large</a><br>
      </p>
    </section>

    <section>
      <h2>
        <i class="fa fa-hand-o-down" aria-hidden="true"></i>
        with Icon
      </h2>
      <p>
        <a class="button is-small" href="">
          <i class="fa fa-twitter" aria-hidden="true"></i>
          <span>Twitter</span>
        </a>
        <a class="button is-small" href="">
          <i class="fa fa-facebook-official" aria-hidden="true"></i>
          <span>Facebook</span>
        </a>
        <a class="button is-small" href="">
          <i class="fa fa-instagram" aria-hidden="true"></i>
          <span>Instagram</span>
        </a>

      </p>
    </section>

    <section>
      <h2>
        <i class="fa fa-hand-o-down" aria-hidden="true"></i>
        Loading
      </h2>
      <p>
        <a id="loading" class="button is-cyan is-fix-width" href="">
          <i class="fa fa-circle-o-notch fa-spin fa-3x fa-fw"></i>
          <span>Download</span>
        </a>
      </p>
    </section>


    <section>
      <h2>
        <i class="fa fa-hand-o-down" aria-hidden="true"></i>
        Circle
      </h2>
      <p>
        <a class="button-circle is-purple" href=""><span>Circle</span></a>
      </p>
    </section>

    <section>
      <h2>
        <i class="fa fa-hand-o-down" aria-hidden="true"></i>
        Animate
      </h2>
      <p>
        <a id="anime1" class="button-circle animate is-cyan" href=""><span>Anime1</span></a>
        <a id="anime2" class="button animate" href=""><span>Anime2</span></a>
        <a id="anime3" class="button-circle animate  is-lime" href=""><span>Anime3</span></a>
      </p>
    </section>

  </div>
</div>
            
          
!
            
              
// valiables
// -------------------------------------------------------

// color
$font-color-default: #444;
$font-color-light: #666;
$font-color-white: #fff;
$font-color-link-hover: #c0ca33;

// background-color
$background-default: #F6F6F6;
$background-cyan: #26C6DA;
$background-pink: #F06292;
$background-lime: #C0CA33;
$background-purple: #AB47BC;

// breakpoint
$break-point-mb: 640px;

// font-size
$font-size-base: 62.5%; //10px
$font-size-xsmall: 14;
$font-size-small: 16;
$font-size-middle: 20;
$font-size-large: 24;
$font-size-xlarge: 30;
$font-size-xxlarge: 60;

// easing
$ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
$ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);


// mixin
// -------------------------------------------------------

@mixin util-font-size($size: $font-size-middle) {
    $rem: $size / 10;
    font-size: $size + px;
    font-size: $rem + rem;
}
@mixin util-breakpoint($point:$break-point-mb, $min:true) {
    @if $min {
        @media screen and (min-width: $point) { @content; }
    } @else {
        @media screen and (max-width: $point) { @content; }
    }
}


// base styles
// -------------------------------------------------------

html {
  font-size: $font-size-base;
}

body {
  font-family: 'Noto Sans Japanese', '游ゴシック', YuGothic, 'ヒラギノ角ゴ Pro', 'Hiragino Kaku Gothic Pro', 'メイリオ', 'Meiryo', sans-serif;
  color: $font-color-default;
  font-weight: 300;
  line-height: 1em;
  background: #fafafa;
}

a {
  color: #aaa;
  text-decoration: none;
  &:link, &:visited {
    color: #aaa;
  }
}

h1, h2 {
  margin: 0;
  font-weight: 400;
  line-height: 1em;
}

h1 {
  text-align: center;
  @include util-font-size($font-size-xxlarge);
}

h2 {
  margin: 0 0 40px;
  @include util-font-size($font-size-large);
  @include util-breakpoint() {
    @include util-font-size($font-size-xlarge);
  }
  i {
    margin-right: 8px;
  }
}

// layout styles
// -------------------------------------------------------

.wrapper {
  width: 80vw;
  margin: 40px auto;

  header {
    padding: 30px;
    p {
      color: #666;
      padding: 10px 0;
      text-align: center;
      line-height: 1.4em;
      @include util-font-size($font-size-small);
      a {
        &:hover, &:active {
          color: $font-color-link-hover;
        }
      }
    }
  }
  section {
    margin: 60px auto;
    background: rgba(255,255,255,.8);
    padding: 30px;
    border-radius: 10px;
    p {
      display: flex;
      justify-content: center;
      flex-flow: row wrap;
      align-items: center;
    }
  }
}

// button styles
// -------------------------------------------------------

%color-button-style {
  color: $font-color-white;
  &:link, &:visited, &:hover {
    color: $font-color-white;
  }
  &:hover {
    -webkit-filter: brightness(106%);
  }
  &:active {
    -webkit-filter: brightness(106%);
  }
}

%button-base {
  display: inline-flex;
  justify-content: center;
  min-width: 150px;
  margin: 8px;
  padding: 20px;
  @include util-font-size($font-size-large);
  color: $font-color-light;
  line-height: 1em;
  background: $background-default;
  border: rgba(0,0,0,.1) solid 1px;
  box-shadow: -1px -1px rgba(0,0,0,.2) inset;

  // transition
  transition:
    -webkit-filter .3s $ease-out-cubic,
    transform .3s $ease-out-expo,
    background .4s $ease-out-cubic
  ;

  &:link, &:visited {
    color: $font-color-light;
  }
  &:hover {
    transform: scale(1.1);
    -webkit-filter: brightness(101%);
  }

  // click
  &:active {
    -webkit-filter: brightness(101%);
    transform: translate(1px, 1px) scale(1.1);
    box-shadow: 1px 1px rgba(0,0,0,.2) inset;
  }

  // variation
  &.is-pink {
    @extend %color-button-style;
    background: $background-pink;
  }
  &.is-lime {
    @extend %color-button-style;
    background: $background-lime;
  }
  &.is-cyan {
    @extend %color-button-style;
    background: $background-cyan;
  }
  &.is-purple {
    @extend %color-button-style;
    background: $background-purple;
  }

  // size
  &.is-small {
    padding: 14px;
    min-width: 80px;
    @include util-font-size($font-size-small);
  }
  &.is-large {
    min-width: 180px;
    @include util-font-size($font-size-xlarge);
  }

}

.button {
  @extend %button-base;
  border-radius: 4px;
  i {
    margin-right: 4px;
  }
  span {
    line-height: 1em;
  }

  &.is-fix-width {
    width: 200px;
  }

  // loading
  .fa-spin {
    display: none;
    @include util-font-size($font-size-large);
  }
  &.is-loading {
    .fa-spin {
      display: inline-block;
    }
    span {
      display: none;
    }
  }

}

.button-circle {
  @extend %button-base;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 150px;
  height: 150px;
  border-radius: 50%;

  &.is-small {
    width: 100px;
    height:100px;
  }

  &:hover {
    color: $font-color-white;
    background: $background-pink;
    transform: scale(1.1) rotate(360deg);
  }
}
            
          
!
            
              $(function() {
  console.log('Hello World!');
  $('.button').on('click', function(e) {
    e.preventDefault();
  });

  $('.button-circle').on('click', function(e) {
    e.preventDefault();
  });

  $('#loading').on('click', function(e) {
    $(this).toggleClass('is-loading');
  });

  $('#anime1').on('click', function(e) {
    $(this).addClass('jello animated');
  });
  $('#anime1').bind('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
    $(this).removeClass('jello animated');
  });

  $('#anime2').on('click', function(e) {
    $(this).addClass('swing animated');
  });
  $('#anime2').bind('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
    $(this).removeClass('swing animated');
  });

  $('#anime3').on('click', function(e) {
    $(this).addClass('bounce animated');
  });
  $('#anime3').bind('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
    $(this).removeClass('bounce animated');
  });

})
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console