<!DOCTYPE html>
<html ng-app="plunkr">

  <head>
    <link data-require="bootstrap-css@3.x" data-semver="3.1.1" rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
    <script data-require="jquery@*" data-semver="2.0.3" src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
    <script data-require="angular.js@1.3.0-beta.5" data-semver="1.3.0-beta.5" src="https://code.angularjs.org/1.3.0-beta.5/angular.js"></script>
    <script data-require="ui-bootstrap@*" data-semver="0.10.0" src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.10.0.js"></script>
    <script data-require="angular-resource@*" data-semver="1.2.14" src="http://code.angularjs.org/1.2.14/angular-resource.js"></script>
    <script src="rangeslider.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.9/angular-animate.js"></script>
    <link rel="stylesheet" href="rangeslider.css" />
    <link rel="stylesheet" href="style.css" />
    <script src="app.js"></script>
  </head>

  <body>
    <div class="container" ng-controller="MainCtrl">
      <h1>Filter with Rangeslider</h1>
      <p>The aim is to filter through the list of competitors by their running and swimming times.</p>
      <p>I might want to see all competitors with running times between <strong>20min & 40min</strong> who's swimming times are also between <strong>45min & 1hr</strong></p>
      <br />
      <h4>Running Times</h4>
      <div range-slider="" prevent-equal-min-max="" attach-handle-values="" step="{{sliderConfig.step}}" min="runSliderConfig.min" max="runSliderConfig.max" model-min="sliderRanges.runMin" model-max="sliderRanges.runMax" filter="hourMinFilter" filter-options="{{runSliderConfig.max}}"></div>
      <h4>Swimming Times</h4>
      <div range-slider="" prevent-equal-min-max="" attach-handle-values="" step="{{sliderConfig.step}}" min="swimSliderConfig.min" max="swimSliderConfig.max" model-min="sliderRanges.swimMin" model-max="sliderRanges.swimMax" filter="hourMinFilter" filter-options="{{swimSliderConfig.max}}"></div>
      
      <div class="exercises">
      
        <div class="exercise animate-repeat" ng-repeat="exercise in filteredExercise | orderBy:predicate:reverse | rangeFilter:sliderRanges">
          <h4>{{ exercise.competitor }}</h4>
          <p>
            <strong>Running Time:</strong> {{ exercise.run_time | hourMinFilter }}
          <br />
            <strong>Swimming Time:</strong> {{ exercise.swim_time | hourMinFilter }}
          </p>
        </div>
      </div>
    </div>
  </body>

</html>
var app = angular.module('plunkr', ['ngResource', 'ui.bootstrap', 'ui-rangeSlider']);

app.factory('dataFactory', function($resource) {
  return $resource('data.json');
});

app.controller('MainCtrl', function($scope, dataFactory) {
  $scope.exercise = dataFactory.query();
  $scope.predicate = '-competed_on';
  
  $scope.totalItems = $scope.exercise.length;
  $scope.itemsPerPage = 21
  $scope.currentPage = 1;
  
  $scope.pageCount = function () {
     return Math.ceil($scope.exercise.length / $scope.itemsPerPage);
   };

   $scope.exercise.$promise.then(function () {
    $scope.totalItems = $scope.exercise.length;
    $scope.$watch('currentPage + itemsPerPage', function() {
      var begin = (($scope.currentPage - 1) * $scope.itemsPerPage),
        end = begin + $scope.itemsPerPage;

      $scope.filteredExercise = $scope.exercise.slice(begin, end);
    });
   });
  
  $scope.runSliderConfig = {
     min:  0,
     max:  120,
     step: 10,
   };
   $scope.swimSliderConfig = {
     min:  0,
     max:  120,
     step: 10,
   };
   $scope.sliderRanges = {
     runMin: 0,
     runMax: 120,
     swimMin: 0,
     swimMax: 120
   };
});


app.filter('hourMinFilter', function () {
  return function (value) {
    if (value === 120) return 'All'
    var h = parseInt(value / 60);
    var m = parseInt(value % 60);
    var hStr = (h > 0) ? h + 'hr'  : '';
    var mStr = (m > 0) ? m + 'min' : '';
    var glue = (hStr && mStr) ? ' ' : '';
    return hStr + glue + mStr;
  };
});

app.filter('rangeFilter', function() {
  return function(items, sliderRanges ) {
    
    /*
      This is working well now, it was really  
      
    */
    var filtered = [];
    var runMin = parseInt(sliderRanges.runMin);
    var runMax = parseInt(sliderRanges.runMax);
    var swimMin = parseInt(sliderRanges.swimMin);
    var swimMax = parseInt(sliderRanges.swimMax);

    angular.forEach(items, function(item) {
      if((item.run_time >= runMin && item.run_time <= runMax) && (item.swim_time >= swimMin && item.swim_time <= swimMax)) {
        filtered.push(item);
      }
    });
    
    return filtered;
  };
});
/* Styles go here */
*{
  -webkit-box-sizing:border-box;
  -moz-box-sizing:border-box;
  box-sizing:border-box;
}
.exercise{
  background: tomato;
  padding: 5px;
  margin-bottom: 10px;
  width:32%;
  margin-right: 2%;
  float: left;
}
.exercise:nth-child(3n){
  margin-right:0;
}
/*
 *  Angular RangeSlider Directive
 * 
 *  Version: 0.0.7
 *
 *  Author: Daniel Crisp, danielcrisp.com
 *
 *  The rangeSlider has been styled to match the default styling
 *  of form elements styled using Twitter's Bootstrap
 * 
 *  Originally forked from https://github.com/leongersen/noUiSlider
 *

    This code is released under the MIT Licence - http://opensource.org/licenses/MIT

    Copyright (c) 2013 Daniel Crisp

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.

*/

(function () {
    'use strict';

    /**
     * RangeSlider, allows user to define a range of values using a slider
     * Touch friendly.
     * @directive
     */
    angular.module('ui-rangeSlider', [])
        .directive('rangeSlider', ["$document", "$filter", "$log", function($document, $filter, $log) {

        // test for mouse, pointer or touch
        var EVENT = window.PointerEvent ? 1 : (window.MSPointerEvent ? 2 : ('ontouchend' in document ? 3 : 4)), // 1 = IE11, 2 = IE10, 3 = touch, 4 = mouse
            eventNamespace = '.rangeSlider',

            defaults = {
                disabled: false,
                orientation: 'horizontal',
                step: 0,
                decimalPlaces: 0,
                showValues: true,
                preventEqualMinMax: false,
                attachHandleValues: false
            },

            onEvent = (EVENT === 1 ? 'pointerdown' : (EVENT === 2 ? 'MSPointerDown' : (EVENT === 3 ? 'touchstart' : 'mousedown'))) + eventNamespace,
            moveEvent = (EVENT === 1 ? 'pointermove' : (EVENT === 2 ? 'MSPointerMove' : (EVENT === 3 ? 'touchmove' : 'mousemove'))) + eventNamespace,
            offEvent = (EVENT === 1 ? 'pointerup' : (EVENT === 2 ? 'MSPointerUp' : (EVENT === 3 ? 'touchend' : 'mouseup'))) + eventNamespace,

            // get standarised clientX and clientY
            client = function (f) {
                try {
                    return [(f.clientX || f.originalEvent.clientX || f.originalEvent.touches[0].clientX), (f.clientY || f.originalEvent.clientY || f.originalEvent.touches[0].clientY)];
                } catch (e) {
                    return ['x', 'y'];
                }
            },

            restrict = function (value) {

                // normalize so it can't move out of bounds
                return (value < 0 ? 0 : (value > 100 ? 100 : value));

            },

            isNumber = function (n) {
               // console.log(n);
                return !isNaN(parseFloat(n)) && isFinite(n);
            };

        if (EVENT < 4) {
            // some sort of touch has been detected
            angular.element('html').addClass('ngrs-touch');
        } else {
            angular.element('html').addClass('ngrs-no-touch');
        }


        return {
            restrict: 'A',
            replace: true,
            template: ['<div class="ngrs-range-slider">',
                         '<div class="ngrs-runner">',
                           '<div class="ngrs-handle ngrs-handle-min"><i></i></div>',
                           '<div class="ngrs-handle ngrs-handle-max"><i></i></div>',
                           '<div class="ngrs-join"></div>',
                         '</div>',
                         '<div class="ngrs-value-runner">',
                           '<div class="ngrs-value ngrs-value-min" ng-show="showValues"><div>{{filteredModelMin}}</div></div>',
                           '<div class="ngrs-value ngrs-value-max" ng-show="showValues"><div>{{filteredModelMax}}</div></div>',
                         '</div>',
                       '</div>'].join(''),
            scope: {
                disabled: '=?',
                min: '=',
                max: '=',
                modelMin: '=?',
                modelMax: '=?',
                onHandleDown: '&', // calls optional function when handle is grabbed
                onHandleUp: '&', // calls optional function when handle is released 
                orientation: '@', // options: horizontal | vertical | vertical left | vertical right
                step: '@',
                decimalPlaces: '@',
                filter: '@',
                filterOptions: '@',
                showValues: '@',
                pinHandle: '@',
                preventEqualMinMax: '@',
                attachHandleValues: '@'
            },
            link: function(scope, element, attrs, controller) {

                /** 
                 *  FIND ELEMENTS
                 */

                var $slider = angular.element(element),
                    handles = [element.find('.ngrs-handle-min'), element.find('.ngrs-handle-max')],
                    values = [element.find('.ngrs-value-min'), element.find('.ngrs-value-max')],
                    join = element.find('.ngrs-join'),
                    pos = 'left',
                    posOpp = 'right',
                    orientation = 0,
                    allowedRange = [0, 0],
                    range = 0;

                // filtered
                scope.filteredModelMin = scope.modelMin;
                scope.filteredModelMax = scope.modelMax;

                /**
                 *  FALL BACK TO DEFAULTS FOR SOME ATTRIBUTES
                 */

                attrs.$observe('disabled', function (val) {
                    if (!angular.isDefined(val)) {
                        scope.disabled = defaults.disabled;
                    }

                    scope.$watch('disabled', setDisabledStatus);
                });

                attrs.$observe('orientation', function (val) {
                    if (!angular.isDefined(val)) {
                        scope.orientation = defaults.orientation;
                    }

                    var classNames = scope.orientation.split(' '),
                        useClass;

                    for (var i = 0, l = classNames.length; i < l; i++) {
                        classNames[i] = 'ngrs-' + classNames[i];
                    }

                    useClass = classNames.join(' ');

                    // add class to element
                    $slider.addClass(useClass);

                    // update pos
                    if (scope.orientation === 'vertical' || scope.orientation === 'vertical left' || scope.orientation === 'vertical right') {
                        pos = 'top';
                        posOpp = 'bottom';
                        orientation = 1;
                    }
                });

                attrs.$observe('step', function (val) {
                    if (!angular.isDefined(val)) {
                        scope.step = defaults.step;
                    }
                });

                attrs.$observe('decimalPlaces', function (val) {
                    if (!angular.isDefined(val)) {
                        scope.decimalPlaces = defaults.decimalPlaces;
                    }
                });

                attrs.$observe('showValues', function (val) {
                    if (!angular.isDefined(val)) {
                        scope.showValues = defaults.showValues;
                    } else {
                        if (val === 'false') {
                            scope.showValues = false;
                        } else {
                            scope.showValues = true;
                        }
                    }
                });

                attrs.$observe('pinHandle', function (val) {
                    if (!angular.isDefined(val)) {
                        scope.pinHandle = null;
                    } else {
                        if (val === 'min' || val === 'max') {
                            scope.pinHandle = val;
                        } else {
                            scope.pinHandle = null;
                        }
                    }

                    scope.$watch('pinHandle', setPinHandle);
                });

                attrs.$observe('preventEqualMinMax', function (val) {
                    if (!angular.isDefined(val)) {
                        scope.preventEqualMinMax = defaults.preventEqualMinMax;
                    } else {
                        if (val === 'false') {
                            scope.preventEqualMinMax = false;
                        } else {
                            scope.preventEqualMinMax = true;
                        }
                    }
                });

                attrs.$observe('attachHandleValues', function (val) {
                    if (!angular.isDefined(val)) {
                        scope.attachHandleValues = defaults.attachHandleValues;
                    } else {
                        if (val === 'false') {
                            scope.attachHandleValues = false;
                        } else {
                            scope.attachHandleValues = true;
                        }
                    }
                });


                // listen for changes to values
                scope.$watch('min', setMinMax);
                scope.$watch('max', setMinMax);

                scope.$watch('modelMin', setModelMinMax);
                scope.$watch('modelMax', setModelMinMax);

                /**
                 * HANDLE CHANGES
                 */

                function setPinHandle (status) {
                    if (status === "min") {
                        angular.element(handles[0]).css('display', 'none');
                        angular.element(handles[1]).css('display', 'block');
                    } else if (status === "max") {
                        angular.element(handles[0]).css('display', 'block');
                        angular.element(handles[1]).css('display', 'none');
                    } else {
                        angular.element(handles[0]).css('display', 'block');
                        angular.element(handles[1]).css('display', 'block');
                    }
                }

                function setDisabledStatus (status) {
                    if (status) {
                        $slider.addClass('disabled');
                    } else {
                        $slider.removeClass('disabled');
                    }
                }

                function setMinMax () {

                    if (scope.min > scope.max) {
                        throwError('min must be less than or equal to max');
                    }

                    // only do stuff when both values are ready
                    if (angular.isDefined(scope.min) && angular.isDefined(scope.max)) {

                        // make sure they are numbers
                        if (!isNumber(scope.min)) {
                            throwError('min must be a number');
                        }

                        if (!isNumber(scope.max)) {
                            throwError('max must be a number');
                        }

                        range = scope.max - scope.min;
                        allowedRange = [scope.min, scope.max];

                        // update models too
                        setModelMinMax();

                    }
                }

                function setModelMinMax () {

                    if (scope.modelMin > scope.modelMax) {
                        throwWarning('modelMin must be less than or equal to modelMax');
                        // reset values to correct
                        scope.modelMin = scope.modelMax;
                    }

                    // only do stuff when both values are ready
                    if (
                        (angular.isDefined(scope.modelMin) || scope.pinHandle === 'min') &&
                        (angular.isDefined(scope.modelMax) || scope.pinHandle === 'max')
                    ) {

                        // make sure they are numbers
                        if (!isNumber(scope.modelMin)) {
                            if (scope.pinHandle !== 'min') {
                                throwWarning('modelMin must be a number');
                            }
                            scope.modelMin = scope.min;
                        }

                        if (!isNumber(scope.modelMax)) {
                            if (scope.pinHandle !== 'max') {
                                throwWarning('modelMax must be a number');
                            }
                            scope.modelMax = scope.max;
                        }

                        var handle1pos = restrict(((scope.modelMin - scope.min) / range) * 100),
                            handle2pos = restrict(((scope.modelMax - scope.min) / range) * 100);

                        if (scope.attachHandleValues) {
                          var value1pos = handle1pos,
                              value2pos = handle2pos;
                        }

                        // make sure the model values are within the allowed range
                        scope.modelMin = Math.max(scope.min, scope.modelMin);
                        scope.modelMax = Math.min(scope.max, scope.modelMax);

                        if (scope.filter) {
                            scope.filteredModelMin = $filter(scope.filter)(scope.modelMin, scope.filterOptions);
                            scope.filteredModelMax = $filter(scope.filter)(scope.modelMax, scope.filterOptions);
                        } else {
                            scope.filteredModelMin = scope.modelMin;
                            scope.filteredModelMax = scope.modelMax;
                        }

                        // check for no range
                        if (scope.min === scope.max && scope.modelMin == scope.modelMax) {

                            // reposition handles
                            angular.element(handles[0]).css(pos, '0%');
                            angular.element(handles[1]).css(pos, '100%');

                            if (scope.attachHandleValues){
                              // reposition values
															angular.element('.ngrs-value-runner').addClass('ngrs-attached-handles');
                              angular.element(values[0]).css(pos, '0%');
                              angular.element(values[1]).css(pos, '100%');
                            }

                            // reposition join
                            angular.element(join).css(pos, '0%').css(posOpp, '0%');

                        } else {

                            // reposition handles
                            angular.element(handles[0]).css(pos, handle1pos + '%');
                            angular.element(handles[1]).css(pos, handle2pos + '%');

                            if (scope.attachHandleValues) {
                              // reposition values
															angular.element('.ngrs-value-runner').addClass('ngrs-attached-handles');
                              angular.element(values[0]).css(pos, value1pos + '%');
                              angular.element(values[1]).css(pos, value2pos + '%');
                              angular.element(values[1]).css(posOpp, 'auto');
                            }

                            // reposition join
                            angular.element(join).css(pos, handle1pos + '%').css(posOpp, (100 - handle2pos) + '%');

                            // ensure min handle can't be hidden behind max handle
                            if (handle1pos >  95) {
                                angular.element(handles[0]).css('z-index', 3);
                            }
                        }

                    }

                }

                function handleMove(index) {

                    var $handle = handles[index];

                    // on mousedown / touchstart
                    $handle.bind(onEvent + 'X', function (event) {

                        var handleDownClass = (index === 0 ? 'ngrs-handle-min' : 'ngrs-handle-max') + '-down',
                            unbind = $handle.add($document).add('body'),
                            modelValue = (index === 0 ? scope.modelMin : scope.modelMax) - scope.min,
                            originalPosition = (modelValue / range) * 100,
                            originalClick = client(event),
                            previousClick = originalClick,
                            previousProposal = false;

                        if (angular.isFunction(scope.onHandleDown)) {
                            scope.onHandleDown();
                        }

                        // stop user accidentally selecting stuff
                        angular.element('body').bind('selectstart' + eventNamespace, function () {
                            return false;
                        });

                        // only do stuff if we are disabled
                        if (!scope.disabled) {

                            // add down class
                            $handle.addClass('ngrs-down');

                            $slider.addClass('ngrs-focus ' + handleDownClass);

                            // add touch class for MS styling
                            angular.element('body').addClass('ngrs-touching');

                            // listen for mousemove / touchmove document events
                            $document.bind(moveEvent, function (e) {
                                // prevent default
                                e.preventDefault();

                                var currentClick = client(e),
                                    movement,
                                    proposal,
                                    other,
                                    per = (scope.step / range) * 100,
                                    otherModelPosition = (((index === 0 ? scope.modelMax : scope.modelMin) - scope.min) / range) * 100;

                                if (currentClick[0] === "x") {
                                    return;
                                }

                                // calculate deltas
                                currentClick[0] -= originalClick[0];
                                currentClick[1] -= originalClick[1];

                                // has movement occurred on either axis?
                                movement = [
                                    (previousClick[0] !== currentClick[0]), (previousClick[1] !== currentClick[1])
                                ];

                                // propose a movement
                                proposal = originalPosition + ((currentClick[orientation] * 100) / (orientation ? $slider.height() : $slider.width()));

                                // normalize so it can't move out of bounds
                                proposal = restrict(proposal);

                                if (scope.preventEqualMinMax) {

                                    if (per === 0) {
                                        per = (1 / range) * 100; // restrict to 1
                                    }

                                    if (index === 0) {
                                        otherModelPosition = otherModelPosition - per;
                                    } else if (index === 1) {
                                        otherModelPosition = otherModelPosition + per;
                                    }
                                }

                                // check which handle is being moved and add / remove margin
                                if (index === 0) {
                                    proposal = proposal > otherModelPosition ? otherModelPosition : proposal;
                                } else if (index === 1) {
                                    proposal = proposal < otherModelPosition ? otherModelPosition : proposal;
                                }

                                if (scope.step > 0) {
                                    // only change if we are within the extremes, otherwise we get strange rounding
                                    if (proposal < 100 && proposal > 0) {
                                        proposal = Math.round(proposal / per) * per;
                                    }
                                }

                                if (proposal > 95 && index === 0) {
                                    $handle.css('z-index', 3);
                                } else {
                                    $handle.css('z-index', '');
                                }

                                if (movement[orientation] && proposal != previousProposal) {

                                    if (index === 0) {

                                        // update model as we slide
                                        scope.modelMin = parseFloat((((proposal * range) / 100) + scope.min)).toFixed(scope.decimalPlaces);

                                    } else if (index === 1) {

                                        scope.modelMax = parseFloat((((proposal * range) / 100) + scope.min)).toFixed(scope.decimalPlaces);
                                    }

                                    // update angular
                                    scope.$apply();

                                    previousProposal = proposal;

                                }

                                previousClick = currentClick;

                            }).bind(offEvent, function () {

                                if (angular.isFunction(scope.onHandleUp)) {
                                    scope.onHandleUp();
                                }

                                unbind.off(eventNamespace);

                                angular.element('body').removeClass('ngrs-touching');

                                // remove down class
                                $handle.removeClass('ngrs-down');

                                // remove active class
                                $slider.removeClass('ngrs-focus ' + handleDownClass);

                            });
                        }

                    });
                }

                function throwError (message) {
                    scope.disabled = true;
                    throw new Error("RangeSlider: " + message);
                }

                function throwWarning (message) {
                    $log.warn(message);
                }

                /**
                 * DESTROY
                 */

                scope.$on('$destroy', function () {

                    // unbind event from slider
                    $slider.off(eventNamespace);

                    // unbind from body
                    angular.element('body').off(eventNamespace);

                    // unbind from document
                    $document.off(eventNamespace);

                    // unbind from handles
                    for (var i = 0, l = handles.length; i < l; i++) {
                        handles[i].off(eventNamespace);
                        handles[i].off(eventNamespace + 'X');
                    }

                });

                /**
                 * INIT
                 */

                $slider
                    // disable selection
                    .bind('selectstart' + eventNamespace, function (event) {
                        return false;
                    })
                    // stop propagation
                    .bind('click', function (event) {
                        event.stopPropagation();
                    });

                // bind events to each handle
                handleMove(0);
                handleMove(1);

            }
        };
    }]);
    
    // requestAnimationFramePolyFill
    // http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
    // shim layer with setTimeout fallback
    window.requestAnimFrame = (function(){
        return window.requestAnimationFrame    ||
            window.webkitRequestAnimationFrame ||
            window.mozRequestAnimationFrame    ||
            function( callback ){
                window.setTimeout(callback, 1000 / 60);
            };
    })();
}());
[
{ 
  "competitor": "Jack Heart",
  "run_time": "28",
  "swim_time": "120",
  "competed_on" : "2014/01/12 17:56:35 -0400"
},
{ 
  "competitor": "Tom Freud",
  "run_time": "22",
  "swim_time": "20",
  "competed_on" : "2013/05/06 17:56:35 -0400"
},
{ 
  "competitor": "Alex McCloud",
  "run_time": "58",
  "swim_time": "60",
  "competed_on" : "2014/04/14 17:56:35 -0400"
},
{ 
  "competitor": "Tim Riberton",
  "run_time": "90",
  "swim_time": "130",
  "competed_on" : "2014/04/10 17:56:35 -0400"
},
{ 
  "competitor": "Andrew Lingaurd",
  "run_time": "85",
  "swim_time": "90",
  "competed_on" : "2014/05/13 17:56:35 -0400"
},
{ 
  "competitor": "Garry Glen",
  "run_time": "38",
  "swim_time": "50",
  "competed_on" : "2014/05/19 17:56:35 -0400"
},
{ 
  "competitor": "Nate Andrews",
  "run_time": "15",
  "swim_time": "52",
  "competed_on" : "2014/02/01 17:56:35 -0400"
},
{ 
  "competitor": "Stuart Cliford",
  "run_time": "25",
  "swim_time": "65",
  "competed_on" : "2013/00/12 17:56:35 -0400"
},
{ 
  "competitor": "Eric Disilver",
  "run_time": "145",
  "swim_time": "30",
  "competed_on" : "2013/12/17 17:56:35 -0400"
},
{ 
  "competitor": "Micheal Reynolds",
  "run_time": "45",
  "swim_time": "10",
  "competed_on" : "2013/03/28 17:56:35 -0400"
}
]
/**
 * 	Angular RangeSlider SCSS
 * 
 *	Version: 0.0.7
 *
 * 	Author: Daniel Crisp, danielcrisp.com
 *
 * 	The rangeSlider has been styled to match the default styling
 * 	of form elements styled using Twitter's Bootstrap
 * 
 * 	Originally forked from https://github.com/leongersen/noUiSlider
 *

	This code is released under the MIT Licence - http://opensource.org/licenses/MIT

	Copyright (c) 2013 Daniel Crisp

	Permission is hereby granted, free of charge, to any person obtaining a copy
	of this software and associated documentation files (the "Software"), to deal
	in the Software without restriction, including without limitation the rights
	to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
	copies of the Software, and to permit persons to whom the Software is
	furnished to do so, subject to the following conditions:

	The above copyright notice and this permission notice shall be included in
	all copies or substantial portions of the Software.

	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
	THE SOFTWARE.

 */
/*------------------------------------*\
    COMPASS IMPORTS
\*------------------------------------*/
/*------------------------------------*\
    SETTINGS
\*------------------------------------*/
/*------------------------------------*\
    THE CSS
\*------------------------------------*/
/* line 69, scss/angular.rangeSlider.scss */
.ngrs-range-slider {
  position: relative;
  margin: 10px 0 30px;
  padding: 4px;
  border: 1px solid #ccc;
  background: #fff;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  -webkit-transition: border linear, box-shadow linear;
  -webkit-transition-delay: 0.2s, 0.2s;
  -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
  -o-transition: border linear 0.2s, box-shadow linear 0.2s;
  transition: border linear 0.2s, box-shadow linear 0.2s;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  /*------------------------------------*\
      RUNNER
  \*------------------------------------*/
  /*------------------------------------*\
      JOIN (connects the two handles)
  \*------------------------------------*/
  /*------------------------------------*\
      HANDLE
  \*------------------------------------*/
  /*------------------------------------*\
      HANDLE SPECIFICS
  \*------------------------------------*/
  /*------------------------------------*\
      VALUE LABELS
  \*------------------------------------*/
  /*------------------------------------*\
      ATTACHED VALUE RUNNER
  \*------------------------------------*/
  /*------------------------------------*\
      VERTICAL SLIDER
  \*------------------------------------*/
  /*------------------------------------*\
      FOCUS STATE
  \*------------------------------------*/
  /*------------------------------------*\
      DISABLED STATE
  \*------------------------------------*/
}
/* line 72, scss/angular.rangeSlider.scss */
.ngrs-range-slider, .ngrs-range-slider * {
  display: block;
  cursor: default;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  -moz-user-select: -moz-none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
/* line 97, scss/angular.rangeSlider.scss */
.ngrs-range-slider .ngrs-runner {
  position: relative;
  margin: 0 9px;
  height: 18px;
}
/* line 107, scss/angular.rangeSlider.scss */
.ngrs-range-slider .ngrs-join {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 0;
  right: 100%;
  height: 8px;
  margin: -4px 0 0 0;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  background-color: #2f96b4;
  background-image: -webkit-linear-gradient(#5bc0de, #2f96b4);
  background-image: -moz-linear-gradient(#5bc0de, #2f96b4);
  background-image: -o-linear-gradient(#5bc0de, #2f96b4);
  background-image: linear-gradient(#5bc0de, #2f96b4);
}
/* line 125, scss/angular.rangeSlider.scss */
.ngrs-range-slider .ngrs-handle {
  position: absolute;
  z-index: 2;
  height: 100%;
  width: 18px;
  margin: 0 0 0 -9px;
  background: #efefef;
  border: 1px solid #ccc;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
  /*------------------------------------*\
      HANDLE ICON
  \*------------------------------------*/
}
/* line 139, scss/angular.rangeSlider.scss */
.ngrs-range-slider .ngrs-handle i {
  display: block;
  width: 100%;
  height: 100%;
  background: no-repeat -9999px -9999px;
  cursor: pointer;
}
/* line 149, scss/angular.rangeSlider.scss */
.ngrs-no-touch .ngrs-range-slider .ngrs-handle:hover i, .ngrs-range-slider .ngrs-handle.ngrs-down i {
  background-position: 50% 50%;
}
/* line 154, scss/angular.rangeSlider.scss */
.ngrs-range-slider .ngrs-handle.ngrs-down {
  -webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
  -moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}
/* line 165, scss/angular.rangeSlider.scss */
.ngrs-range-slider .ngrs-handle-min i {
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFNJREFUeNpiYMAEXEDsA+OwoEnKALETEHOgK2AEYhMgNkQ3DqSAB6pLAot1DExIJmAFzED8C4hvQdnIppyFKYCBp0D8CohloVafxWUqN7I3AQIMAKw6B24pOi8lAAAAAElFTkSuQmCC");
}
/* line 172, scss/angular.rangeSlider.scss */
.ngrs-range-slider .ngrs-handle-max i {
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFdJREFUeNpiYEAAHyDmYkADzEhsByBWA+K3QPwJmwJjIGYBYlUgZgLi59gUwIAkEEsD8VMmBtyAkQFqJDZwAYjPAPE/dAU/gHg/ED/GpgvkTW50QYAAAwADfwrM5sqplgAAAABJRU5ErkJggg==");
}
/* line 182, scss/angular.rangeSlider.scss */
.ngrs-range-slider .ngrs-value {
  position: absolute;
  top: 100%;
  left: 0;
  padding: 5px 0 0 0;
  font-size: 12px;
  color: #999;
}
/* line 190, scss/angular.rangeSlider.scss */
.ngrs-range-slider .ngrs-value.ngrs-value-max {
  left: auto;
  right: 0;
  text-align: right;
}
/* line 198, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-handle-min-down .ngrs-value-min, .ngrs-range-slider.ngrs-handle-max-down .ngrs-value-max {
  color: #333;
}
/* line 205, scss/angular.rangeSlider.scss */
.ngrs-range-slider .ngrs-attached-handles {
  margin: 0 9px;
  position: relative;
  /*------------------------------------*\
      ATTACHED VALUE RUNNER LABELS
  \*------------------------------------*/
}
/* line 212, scss/angular.rangeSlider.scss */
.ngrs-range-slider .ngrs-attached-handles .ngrs-value-max {
  text-align: left;
}
/* line 215, scss/angular.rangeSlider.scss */
.ngrs-range-slider .ngrs-attached-handles .ngrs-value > div {
  margin: 0 0 0 -50%;
}
/* line 224, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-vertical {
  width: 28px;
  margin: 10px auto;
  /*------------------------------------*\
      RUNNER
  \*------------------------------------*/
  /*------------------------------------*\
      ATTACHED VALUE RUNNER
  \*------------------------------------*/
  /*------------------------------------*\
      JOIN
  \*------------------------------------*/
  /*------------------------------------*\
      HANDLE
  \*------------------------------------*/
  /*------------------------------------*\
      HANDLE SPECIFICS
  \*------------------------------------*/
  /*------------------------------------*\
      VALUE LABELS
  \*------------------------------------*/
  /*------------------------------------*\
      VERTICAL LEFT SLIDER
  \*------------------------------------*/
  /*------------------------------------*\
      VERTICAL RIGHT SLIDER
  \*------------------------------------*/
}
/* line 232, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-vertical .ngrs-runner {
  margin: 9px 0;
  height: 300px;
  width: 18px;
}
/* line 242, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-vertical .ngrs-value-runner.ngrs-attached-handles {
  padding: 4px;
  position: absolute;
  top: 0;
  margin: 9px 0;
  height: 300px;
  left: 100%;
}
/* line 256, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-vertical .ngrs-join {
  width: 8px;
  height: auto;
  top: 0;
  bottom: 100%;
  left: 50%;
  right: auto;
  margin: 0 0 0 -4px;
}
/* line 270, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-vertical .ngrs-handle {
  width: 100%;
  height: 18px;
  margin: -9px 0 0 0;
}
/* line 281, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-vertical .ngrs-handle-min i {
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFFJREFUeNpiYEAFPFAMB0xIbEYgdoJiRpggM5ICUyBWhZoA0vgMWYEsENsg6ZQE4ldA/AmkkguIHZGNhQKQGBfIBHcgFmTABCxALMJAMQAIMAAcNgVQJ7t7JQAAAABJRU5ErkJggg==");
}
/* line 288, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-vertical .ngrs-handle-max i {
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeNpiYKAUMAKxDxBL4ZB/xgQk9gHxDyySILF9zEDiNxC/A2JVNAW7gfgtM5TzCYhZgFgCyr8IxNdADGZk+4BYGoi/APEBIP6PzVE8UAwHAAEGAArIDvzRFIA6AAAAAElFTkSuQmCC");
}
/* line 298, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-vertical .ngrs-value {
  top: 0;
  left: 100%;
  padding: 0 0 0 5px;
}
/* line 303, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-vertical .ngrs-value.ngrs-value-max {
  top: auto;
  bottom: 0;
  right: auto;
  text-align: left;
}
/* line 312, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-vertical .ngrs-attached-handles .ngrs-value-max, .ngrs-range-slider.ngrs-vertical .ngrs-attached-handles .ngrs-value-min {
  margin: -50% 0 0;
}
/* line 321, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-vertical.ngrs-left {
  margin: 10px 0;
}
/* line 329, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-vertical.ngrs-right {
  margin: 10px 0 10px auto;
  /*------------------------------------*\
      ATTACHED VALUE RUNNER
  \*------------------------------------*/
  /*------------------------------------*\
      VALUE LABELS
  \*------------------------------------*/
}
/* line 335, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-vertical.ngrs-right .ngrs-attached-handles {
  left: 0%;
}
/* line 343, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-vertical.ngrs-right .ngrs-value {
  left: auto;
  right: 100%;
  padding: 0 5px 0 0;
  text-align: right;
}
/* line 349, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-vertical.ngrs-right .ngrs-value.ngrs-value-max {
  text-align: right;
}
/* line 361, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-focus {
  border-color: rgba(82, 168, 236, 0.8);
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
}
/* line 372, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-disabled, .ngrs-range-slider.ngrs-disabled.ngrs-focus {
  border-color: #ddd;
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
}
/* line 378, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-disabled .ngrs-handle {
  background: #fff;
  border-color: #ddd;
}
/* line 382, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-disabled .ngrs-handle i {
  background: none !important;
  cursor: default;
}
/* line 388, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-disabled .ngrs-join {
  background: #ddd;
}
/* line 392, scss/angular.rangeSlider.scss */
.ngrs-range-slider.ngrs-disabled .ngrs-value {
  color: #ddd;
}

/*------------------------------------*\
    TOUCH STATE
\*------------------------------------*/
/* line 404, scss/angular.rangeSlider.scss */
body.ngrs-touching {
  -ms-touch-action: none;
}