cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

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 ng-app="buttonApp">
	<div class="row" ng-controller="ButtonCtrl">
		<div class="group">
      <input type="text" placeholder="Detroit, MI" ng-focus="updateButton()" />
      <button type="button" class="button" ng-click="saveLocation()" ng-class="{'saving': locationSaving}">
        <span class="button-text" ng-bind="buttonText"></span>
        <span class="message-text" ng-bind="messageText"></span>
      </button>
    </div>
    <div class="group">
     
    </div>
  </div>  
</div>
            
          
!
            
              @import "compass/css3";

$base: #CFC8B2;
$button: #CB5F7B;
$progress: darken($button,10%);
* {
  box-sizing: border-box;
}
html {
  font-size: 62.5%;
}
body {
  padding: 30px;
  font-size: 1.8rem;
  line-height: 1.6;
  background: $base;
  text-align: center;
  font-family: 'Nunito', sans-serif;
  -webkit-font-smoothing: antialiased;
}
.row { 
  max-width: 600px;
  margin: 0 auto;
}

.group {
  position: relative;
  padding: 60px 10px 10px;
}
input[type="text"] {
  margin-bottom: 10px;
  padding: 10px;
  width: 100%;
  border-radius: 4px;
  border: 3px solid darken($base,5%);
  &:focus {
    border: 3px solid $button;
    outline: none;
  }
}
.button {
  overflow: hidden;
  font-size: 1.5rem;
  width: 100%;
  height: 65px;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(left, $progress 0, $progress 50%, $button 50%, $button);
  background-size: 200% 100%;
  background-position: 100% 0;
  text-transform: uppercase;
  padding: 24px;
  border-radius: 4px;
  line-height: 1;
  font-weight: 700;
  color: #fff;
  position: relative;
  border: 1px solid darken($button,2%);
  text-shadow: 1px 1px 0 rgba(0,0,0,.3);
  box-shadow: 0 1px 0 rgba(255,255,255,.1) inset, 0 2px 5px rgba(0,0,0,.2);
  transition: background-position .3s ease-out;
  &:hover, &:focus {
    outline: none;
    // background: darken($button,3%);
  }
  &.saving {   
    background-position: 0 0;
    .button-text {
      opacity: 0;
      transition: opacity .2s ease-out;
      height: 0;
    }
    .message-text {
      opacity: 1;
       transition: opacity .2s ease-out;
      transition-delay: .4s;
    }
  }

}
.message-text {
  opacity: 0;
}
.button-text {
  display: block;
}

            
          
!
            
              // Init App
var buttonApp = angular.module('buttonApp', []);

// Controller
buttonApp.controller('ButtonCtrl', function($scope) {
  $scope.buttonText = "Save Location";
  $scope.locationSaving = false;
  $scope.messageText="Success!";
  $scope.saveLocation = function () {
    $scope.locationSaving = true;
  }
  $scope.updateButton = function() {
    if ($scope.locationSaving == true) {
      $scope.locationSaving = false;
    }
  }
});

// Google Fonts
WebFontConfig = {
  google: { families: [ 'Nunito:400,700,300:latin' ] }
  };
  (function() {
    var wf = document.createElement('script');
    wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
      '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
    wf.type = 'text/javascript';
    wf.async = 'true';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(wf, s);
  })();
            
          
!
999px
Loading ..................

Console