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 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

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>
  
<button id="button-1" class="button">
  <i class="fa fa-credit-card"></i>
  <span>Получить деньги</span>
</button>
  
<button id="button-2" class="button">
  <i class="fa fa-suitcase"></i>
  <span>Собрать чемодан</span>
</button>
  
<button id="button-3" class="button">
  <i class="fa fa-plane"></i>
  <span>Уехать в отпуск</span>
</button>
  
  <ul></ul>
  
</div>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css?family=Roboto");

body {
  background: #21c984;
  font-family: Roboto;
}

.button {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.5);
  outline: none;
  display: inline-block;
  overflow: hidden;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  font-size: 16px;
  padding: 12px 16px;
  color: #fff;
  background: transparent;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  margin: 12px;
}

.button span,
.button i {
  z-index: 2;
}

.button:active {
  border-color: rgba(0, 0, 0, 0.1);
}

.button::before,
.button::after {
  content: "";
  position: absolute;
  transition: all 0.3s;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.button::before {
  background: rgba(255, 255, 255, 0.3);
}

.button:active::before {
  background: rgba(0, 0, 0, 0.1);
}

/* --- Кнопка 1 --- */

#button-1 i {
  color: #e8d427;
}

#button-1::before,
#button-1:active::before {
  opacity: 0;
  transform: scale(1, 0.1);
}

#button-1:hover::before {
  opacity: 1;
  transform: scale(1, 1);
}

/* --- Кнопка 2 --- */

#button-2 i {
  color: #9b59b6;
}

#button-2::before {
  opacity: 0;
  transform: scale(0.1, 0.1);
}

#button-2:hover::before {
  opacity: 1;
  transform: scale(1, 1);
}

/* --- Кнопка 3 --- */

#button-3 i {
  color: #e67e22;
}

#button-3::before {
  left: 0;
  top: 0;
  height: 490%;
  width: 140%;
  -webkit-transform: translateX(-101%) translateY(-25%) rotate(45deg);
  transform: translateX(-101%) translateY(-25%) rotate(45deg);
}

#button-3:hover::before {
  -webkit-transform: translateX(-9%) translateY(-25%) rotate(45deg);
  transform: translateX(-9%) translateY(-25%) rotate(45deg);
}

.button i {
  margin-right: 4px;
}

div {
  margin: 24px;
  text-align: center;
}

ul li {
  list-style: none;
  color: rgba(0, 0, 0, 0.7);
  font-size: 16px;
  font-weight: lighter;
  font-family: Roboto;
  margin-top: 6px;
}

              
            
!

JS

              
                jQuery(document).ready(function($){
  
  var count = '0';
  var texts = [
      'Это просто пример.',
      'Так было бы слишком просто.',
      'Нажми на кнопку - получишь результат!',
      'Кнопка работает!',
      'Жми еще!',
      'Любишь нажимать на кнопки?',
      'Да ты, прирожденный кнопконажиматель!',
      'Нажимать на незнакомые кнопки - опасно!'
    ];
  
  $('.button').on('click', function(e){
    
    var text = '';
    if(count < texts.length){
      text = texts[count];
    }
    
    else {
      text = 'Даже не знаю, что еще сказать...'
    }
    
    $('ul').prepend('<li>' + text + '</li>');
   count++;
      
    
    
    
  });
  
});
              
            
!
999px

Console