-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
410 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
//noinspection CssInvalidHtmlTagReference | ||
volume-control { | ||
|
||
width: 150px; | ||
|
||
#volumeControl-mute { | ||
|
||
span { | ||
@extend .glyphicon; | ||
font-size: 13.6px; | ||
&:before { | ||
@extend .glyphicon-volume-up:before; | ||
} | ||
|
||
} | ||
|
||
&.muted { | ||
span { | ||
&:before { | ||
@extend .glyphicon-volume-off:before; | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
||
#volumeControl-slider { | ||
|
||
-webkit-appearance: none; | ||
margin-left:-1px; | ||
position:relative; | ||
|
||
&:focus{ | ||
z-index:1; | ||
} | ||
|
||
// track | ||
$track-height : 2px; | ||
$thumb-size: 10px; | ||
@mixin track { | ||
background-color: $btn-default-color; | ||
border: none; | ||
height: $track-height; | ||
|
||
} | ||
|
||
&::-ms-track { | ||
|
||
color: transparent; | ||
border: none; | ||
@include track; | ||
} | ||
&::-moz-range-track { | ||
@include track; | ||
} | ||
&::-webkit-slider-runnable-track { | ||
@include track; | ||
} | ||
|
||
|
||
// thumb | ||
@mixin thumb { | ||
background: none ; | ||
//background-color: blue; | ||
background-color: $btn-default-bg; | ||
width: $thumb-size; | ||
height: $thumb-size; | ||
border: solid $btn-default-color 1px; | ||
@include rounded-corners(50%); | ||
@include vendor-prefix(box-sizing, border-box); | ||
} | ||
|
||
&::-ms-thumb { | ||
@include thumb; | ||
} | ||
&::-moz-range-thumb { | ||
@include thumb; | ||
} | ||
&::-webkit-slider-thumb { | ||
-webkit-appearance: none; | ||
margin-top: - ($thumb-size / 2 ) + ($track-height/2); | ||
@include thumb; | ||
|
||
} | ||
|
||
// before | ||
&::-ms-fill-lower { | ||
border: none; | ||
background:none; | ||
} | ||
|
||
&::-ms-ticks-before { | ||
display: none; | ||
border: none; | ||
background:none; | ||
} | ||
|
||
// after | ||
&::-ms-fill-upper { | ||
border: none; | ||
background:none; | ||
|
||
} | ||
|
||
&::-ms-ticks-after { | ||
display: none; | ||
border: none; | ||
background:none; | ||
} | ||
} | ||
|
||
|
||
} | ||
|
||
/* | ||
glyphicon glyphicon-volume-down | ||
glyphicon glyphicon-volume-off | ||
glyphicon glyphicon-volume-up | ||
.decipher-tags-taglist .icon-remove { | ||
@extend .glyphicon; | ||
&:before { | ||
@extend .glyphicon-remove:before; | ||
} | ||
} | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
var acds = acds || angular.module("audio-control", []); | ||
|
||
/** | ||
* A directive for binding the volume of an audio element to some DOM. | ||
* | ||
*/ | ||
acds.directive("volumeControl", ["$parse", function ($parse) { | ||
return { | ||
restrict: "E", | ||
scope: { | ||
model: "=" | ||
}, | ||
templateUrl: "audioControl/volumeControl.tpl.html", | ||
link: function(scope, $element, attrs, controller, transcludeFunc) { | ||
|
||
// get instances of the mute button and the slider | ||
var element = $element[0], | ||
muteButton = element.querySelector("#volumeControl-mute"), | ||
slider = element.querySelector("#volumeControl-slider") | ||
; | ||
|
||
// set up binding | ||
// volume | ||
scope.$watch(function(){ | ||
return scope.model ? scope.model.volume : null; | ||
}, function volumeChanged(newValue, oldValue) { | ||
scope.volume = newValue ? newValue * 100 : null; | ||
}); | ||
|
||
// muted | ||
scope.$watch(function(){ | ||
return scope.model ? scope.model.muted : null; | ||
}, function mutedChanged(newValue, oldValue) { | ||
scope.muted = newValue; | ||
}); | ||
|
||
// bind from the inputs to the model | ||
muteButton.addEventListener('click', function() { | ||
scope.$apply(function() { | ||
scope.model.muted = !scope.model.muted; | ||
}); | ||
}); | ||
|
||
function sliderChanged() { | ||
scope.$apply(function() { | ||
scope.model.volume = parseFloat(slider.value) / 100; | ||
}); | ||
} | ||
slider.addEventListener('input', sliderChanged); | ||
//slider.click(); | ||
} | ||
}; | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div class="input-group-btn"> | ||
<button id="volumeControl-mute" | ||
class="btn btn-default" | ||
ng-class="{muted: muted}" title="{{muted && 'Unmute' || 'Mute'}}"> | ||
<span></span> | ||
</button> | ||
</div> | ||
<input id="volumeControl-slider" | ||
class="form-control" | ||
type="range" value="{{volume}}" | ||
max="100" min="0" | ||
ng-disabled="muted" | ||
title="{{ 'Volume ' + (volume | number:0) }}"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.