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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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 class="container" ng-app="app" ng-controller="mainCtrl">
  <div class="row">
    <div class="columns small-10 small-offset-1 text-center">
			<h1>Freelance Calculator</h1>
      <p class="lead">You can make <strong>{{ weeklyIncome | currency }}/week</strong> and <strong>{{ yearlySalary | currency }}/year!</p>
    </div>
  </div>
  <div class="row">
    <div class="columns small-12 medium-2 text-right">
      Hours Per Week
    </div>
    <div class="columns small-12 medium-10">
      <div class="range-slider">
        <input class="range-slider__range" type="range" value="{{ hoursPerWeek }}" min="0" max="100" ng-model="hoursPerWeek" ng-change="updateNumbers()">
        <span class="range-slider__value">{{ hoursPerWeek }}</span>
      </div>
    </div>
  </div>
  <div class="row">
    <div class="columns small-12 medium-2 text-right">
      Percent Billable
    </div>
    <div class="columns small-12 medium-10">
      <div class="range-slider">
        <input class="range-slider__range" type="range" value="{{ percentBillable }}" min="0" max="100" step="1" ng-model="percentBillable" ng-change="updateNumbers()">
        <span class="range-slider__value">{{ percentBillable }}%</span>
      </div>
    </div>
  </div>
  <div class="row">
    <div class="columns small-12 medium-2 text-right">
      Weeks Vacation/Yr
    </div>
    <div class="columns small-12 medium-10">
      <div class="range-slider">
        <input class="range-slider__range" type="range" value="{{ percentBillable }}" min="0" max="50" step="1" ng-model="weeksVacation" ng-change="updateNumbers()">
        <span class="range-slider__value">{{ weeksVacation }}</span>
      </div>
    </div>
  </div>
  <div class="row">
    <div class="columns small-12 medium-2 text-right">
      Hourly Rate to Charge
    </div>
    <div class="columns small-12 medium-10">

      <input type="number" id="hourly" name="hourly" ng-model="hourlyRate" ng-change="updateNumbers()" min="0" max="1000"></input>
    </div>
  </div>
</div>
              
            
!

CSS

              
                // Base Colors
$shade-10: #D3D3D3 !default;
$shade-1: #222 !default;
$shade-0: #333 !default;
$teal: blue !default;


// Reset
* {
  &,
  &:before,
  &:after {
    box-sizing: border-box;
  }
}

body {
	background: darkslategray;
  font-family: sans-serif;
  padding: 60px 20px;
  color: white;
  @media (min-width: 600px) {
    padding: 60px;
  }
}

.range-slider {
  margin: 0px;
}


// Range Slider
$range-width: 100% !default;

$range-handle-color: $shade-10 !default;
$range-handle-color-hover: $teal !default;
$range-handle-size: 20px !default;

$range-track-color: $shade-1 !default;
$range-track-height: 10px !default;

$range-label-color: $shade-10 !default;
$range-label-width: 60px !default;

.range-slider {
  width: $range-width;
}

.range-slider__range {
  -webkit-appearance: none;
  width: calc(100% - (#{$range-label-width + 13px}));
  height: $range-track-height;
  border-radius: 5px;
  background: $range-track-color;
  outline: none;
  padding: 0;
  margin: 0;

  // Range Handle
  &::-webkit-slider-thumb {
    appearance: none;
    width: $range-handle-size;
    height: $range-handle-size;
    border-radius: 50%;
    background: $range-handle-color;
    cursor: pointer;
    transition: background .15s ease-in-out;

    &:hover {
      background: $range-handle-color-hover;
    }
  }

  &:active::-webkit-slider-thumb {
    background: $range-handle-color-hover;
  }

  &::-moz-range-thumb {
    width: $range-handle-size;
    height: $range-handle-size;
    border: 0;
    border-radius: 50%;
    background: $range-handle-color;
    cursor: pointer;
    transition: background .15s ease-in-out;

    &:hover {
      background: $range-handle-color-hover;
    }
  }

  &:active::-moz-range-thumb {
    background: $range-handle-color-hover;
  }
}


// Range Label
.range-slider__value {
  display: inline-block;
  position: relative;
  width: $range-label-width;
  color: $shade-0;
  line-height: 20px;
  text-align: center;
  border-radius: 3px;
  background: $range-label-color;
  padding: 5px 10px;
  margin-left: 8px;

  &:after {
    position: absolute;
    top: 8px;
    left: -7px;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-right: 7px solid $range-label-color;
    border-bottom: 7px solid transparent;
    content: '';
  }
}


// Firefox Overrides
::-moz-range-track {
    background: $range-track-color;
    border: 0;
}

input::-moz-focus-inner,
input::-moz-focus-outer { 
  border: 0; 
}
.row{
  padding: 15px 0;
}
              
            
!

JS

              
                var app = angular.module('app', []);

app.controller('mainCtrl', ['$scope', function($scope){
  $scope.hoursPerWeek = 40;
  $scope.percentBillable = 80;
  $scope.hourlyRate = 60;
  $scope.weeksVacation = 4;
  $scope.weeklyIncome;
  $scope.yearlySalary;

  var calcIncome = function(hours,percentBillable,rate){
    var income; 
    var billable = (hours*(percentBillable*.01));
    income = billable*rate;
    return income;
  }
  var calcSalary = function(weekly,vacation){
    var salary = weekly*(52-vacation);
    return salary;
  }
  
  $scope.updateNumbers = function(){
    var hours = $scope.hoursPerWeek,
        billable = $scope.percentBillable,
        rate = $scope.hourlyRate,
        vacation = $scope.weeksVacation;
    var weekly = calcIncome(hours,billable,rate);
    var salary = calcSalary(weekly,vacation);
    $scope.yearlySalary = salary;
    $scope.weeklyIncome = weekly;
  }
  $scope.updateNumbers();
}])
              
            
!
999px

Console