Commit 2e18cb32 authored by Angelin's avatar Angelin

Updated slider and demo

Updated less file to be parametric, updated slider stiles and improved
the demo page.
parent 5e669dda
* { margin: 0; padding: 0; }
body { font-family: 'Open Sans', sans-serif; color: #1f2636; font-size: 14px; }
header { background: #0db9f0; color: #fff; margin: -40px; margin-bottom: 40px; text-align: center; padding: 40px 0; }
h1 { font-weight: 300; }
.wrapper { background: #fff; padding: 40px; }
article { margin-bottom: 40px; }
\ No newline at end of file
......@@ -3,67 +3,78 @@
<head>
<meta charset="utf-8" />
<title>AngularJS Slider Plunker</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>AngularJS Touch Slider</title>
<link rel="stylesheet" href="demo.css" />
<link rel="stylesheet" href="../dist/rzslider.css" />
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../rzslider.js"></script>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,700' rel='stylesheet' type='text/css'>
</head>
<body ng-controller="MainCtrl">
<div style="background-color: #808080;margin-left: 40px;margin-right: 50px; padding: 30px;">
<pre>{{ priceSlider | json }}</pre>
<div class="wrapper">
<header>
<h1>AngularJS Touch Slider</h1>
</header>
<article>
<h2>Min/max slider example</h2>
Value: <pre>{{ priceSlider | json }}</pre>
<input type="text" ng-model="priceSlider.min"/><br/>
<input type="text" ng-model="priceSlider.max"/><br/>
<br/>
<rzslider
rz-slider-floor="priceSlider.floor"
rz-slider-ceil="priceSlider.ceil"
rz-slider-model="priceSlider.min"
rz-slider-high="priceSlider.max"
rz-slider-step="1"></rzslider>
<br> <br> <br>
</article>
<pre>{{ priceSlider2 | json }}</pre>
<br> <br>
<article>
<h2>One value slider example</h2>
Value: {{ priceSlider2 | json }}
<rzslider
rz-slider-floor="0"
rz-slider-ceil="450"
rz-slider-model="priceSlider2"
rz-slider-translate="translate"></rzslider>
</article>
<article>
<h2>Currency slider example</h2>
<pre>{{ priceSlider2 | json }}</pre>
<br> <br>
Value: {{ priceSlider2 | json }}
<rzslider rz-slider-model="priceSlider3"
rz-slider-floor="50"
rz-slider-ceil="450"></rzslider>
</article>
<br><br><br>
<pre>{{ alphabetTranslate(letter) }}</pre>
<br><br>
<article>
<h2>Alphabet slider example</h2>
Value: {{ alphabetTranslate(letter) }}
<rzslider
rz-slider-floor="0"
rz-slider-ceil="letterMax"
rz-slider-model="letter"
rz-slider-translate="alphabetTranslate"></rzslider>
</article>
</div>
</div>
</body>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../rzslider.js"></script>
<script>
var app = angular.module('plunker', ['rzModule']);
app.controller('MainCtrl', function($scope)
{
$scope.priceSlider = {
min: 4,
max: 481,
min: 100,
max: 400,
ceil: 500,
floor: 0
};
......
......@@ -7,11 +7,15 @@
* Licensed under the MIT license
*/
/* Slider colors */
/* Slider size parameters */
rzslider {
position: relative;
display: inline-block;
width: 100%;
height: 2px;
height: 4px;
margin: 30px 0 15px 0;
vertical-align: middle;
}
......@@ -32,22 +36,28 @@ rzslider span.bar {
z-index: 0;
width: 100%;
height: 100%;
background: #fff;
background: #d8e0f3;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
rzslider span.bar.selection {
z-index: 1;
width: 0;
background: #67b700;
background: #0db9f0;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
rzslider span.pointer {
top: -15px;
top: -14px;
z-index: 2;
width: 32px;
height: 32px;
cursor: pointer;
background-color: #ffffff;
background-color: #0db9f0;
-webkit-border-radius: 16px;
-moz-border-radius: 16px;
border-radius: 16px;
......@@ -59,7 +69,7 @@ rzslider span.pointer:after {
left: 12px;
width: 8px;
height: 8px;
background: #71818e;
background: #ffffff;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
......@@ -67,24 +77,24 @@ rzslider span.pointer:after {
}
rzslider span.pointer:hover:after {
background-color: #67b700;
background-color: #ffffff;
}
rzslider span.pointer.active:after {
background-color: #67b700;
background-color: #ffffff;
}
rzslider span.bubble {
top: -32px;
padding: 1px 3px 1px 3px;
color: #67b700;
padding: 1px 3px;
color: #55637d;
cursor: default;
}
rzslider span.bubble.selection {
top: 15px;
top: 16px;
}
rzslider span.bubble.limit {
color: #67b700;
color: #55637d;
}
\ No newline at end of file
/*! jusas-angularjs-slider - v0.1.6 - (c) Rafal Zajac <rzajac@gmail.com>, Jussi Saarivirta <jusasi@gmail.com>, https://github.com/rzajac/angularjs-slider.git - 2014-07-08 */
rzslider{position:relative;display:inline-block;width:100%;height:2px;margin:30px 0 15px 0;vertical-align:middle}rzslider span{position:absolute;display:inline-block;white-space:nowrap}rzslider span.base{width:100%;height:100%;padding:0}rzslider span.bar{z-index:0;width:100%;height:100%;background:#fff}rzslider span.bar.selection{z-index:1;width:0;background:#67b700}rzslider span.pointer{top:-15px;z-index:2;width:32px;height:32px;cursor:pointer;background-color:#fff;-webkit-border-radius:16px;-moz-border-radius:16px;border-radius:16px}rzslider span.pointer:after{position:absolute;top:12px;left:12px;width:8px;height:8px;background:#71818e;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;content:''}rzslider span.pointer:hover:after{background-color:#67b700}rzslider span.pointer.active:after{background-color:#67b700}rzslider span.bubble{top:-32px;padding:1px 3px 1px 3px;color:#67b700;cursor:default}rzslider span.bubble.selection{top:15px}rzslider span.bubble.limit{color:#67b700}
\ No newline at end of file
/*! jusas-angularjs-slider - v0.1.6 - (c) Rafal Zajac <rzajac@gmail.com>, Jussi Saarivirta <jusasi@gmail.com>, https://github.com/rzajac/angularjs-slider.git - 2015-05-21 */
rzslider{position:relative;display:inline-block;width:100%;height:4px;margin:30px 0 15px 0;vertical-align:middle}rzslider span{position:absolute;display:inline-block;white-space:nowrap}rzslider span.base{width:100%;height:100%;padding:0}rzslider span.bar{z-index:0;width:100%;height:100%;background:#d8e0f3;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}rzslider span.bar.selection{z-index:1;width:0;background:#0db9f0;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}rzslider span.pointer{top:-14px;z-index:2;width:32px;height:32px;cursor:pointer;background-color:#0db9f0;-webkit-border-radius:16px;-moz-border-radius:16px;border-radius:16px}rzslider span.pointer:after{position:absolute;top:12px;left:12px;width:8px;height:8px;background:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;content:''}rzslider span.pointer:hover:after{background-color:#fff}rzslider span.pointer.active:after{background-color:#fff}rzslider span.bubble{top:-32px;padding:1px 3px;color:#55637d;cursor:default}rzslider span.bubble.selection{top:16px}rzslider span.bubble.limit{color:#55637d}
\ No newline at end of file
This diff is collapsed.
......@@ -13,17 +13,26 @@
border-radius: @radius;
}
@handleActiveColor: #67b700;
@handleHoverColor: #67b700;
@labelTextColor: #67b700;
@handleBgColor: #fff;
@handleInnerColor: #71818e;
/* Slider colors */
@handleActiveColor: #fff;
@handleHoverColor: #fff;
@labelTextColor: #55637d;
@handleBgColor: #0db9f0;
@handleInnerColor: #fff;
@limitLabelTextColor: @labelTextColor;
@barFillColor: @handleBgColor;
@barNormalColor: #d8e0f3;
/* Slider size parameters */
@handleSize: 32px;
@handlePointerSize: 8px;
@bubblePadding: 1px 3px;
@barHeight: 4px;
rzslider {
display: inline-block;
position: relative;
height: 2px;
height: @barHeight;
width: 100%;
margin: 30px 0 15px 0;
vertical-align: middle;
......@@ -45,33 +54,35 @@ rzslider span.bar {
width: 100%;
height: 100%;
z-index: 0;
background: #fff;
background: @barNormalColor;
.rounded(@barHeight/2);
}
rzslider span.bar.selection {
width: 0%;
z-index: 1;
background: #67b700;
background: @barFillColor;
.rounded(@barHeight/2);
}
rzslider span.pointer {
cursor: pointer;
width: 32px;
height: 32px;
top: -15px;
width: @handleSize;
height: @handleSize;
top: -@handleSize/2 + @barHeight/2;
background-color: @handleBgColor;
z-index: 2;
.rounded(16px);
.rounded(@handleSize/2);
}
rzslider span.pointer:after {
content: '';
width: 8px;
height: 8px;
width: @handlePointerSize;
height: @handlePointerSize;
position: absolute;
top: 12px;
left: 12px;
.rounded(4px);
top: @handleSize/2 - @handlePointerSize/2;
left: @handleSize/2 - @handlePointerSize/2;
.rounded(@handlePointerSize/2);
background: @handleInnerColor;
}
......@@ -85,13 +96,13 @@ rzslider span.pointer.active:after {
rzslider span.bubble {
cursor: default;
top: -32px;
padding: 1px 3px 1px 3px;
top: -@handleSize;
padding: @bubblePadding;
color: @labelTextColor;
}
rzslider span.bubble.selection {
top: 15px;
top: @handleSize/2;
}
rzslider span.bubble.limit {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment