mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Initial Hue Bridge support & Small changes (#177)
* Initial WebUI with sample functions * Changed folder structure * Light Reset Button and Translation fixing in Links * Indentation fixed * Reorganized menu and new function for setting effects * Styling fix * WebUI Initial Philips Hue support * Encoding, refactoring etc * Filename changes * Typo fix * Translation cleanup & adding * Added Favicon * Edited title
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header" lang="en">Light test</h1>
|
||||
<h1 class="page-header" lang="en" data-lang-token="menulighttesttoken">Light test</h1>
|
||||
<div class="col-lg-1">
|
||||
<span lang="en" data-lang-token="lighttesttoken">Color: </span>
|
||||
</div>
|
||||
@@ -24,17 +24,18 @@
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
var webSocket = new WebSocket('ws://'+document.location.hostname+':19444');
|
||||
|
||||
|
||||
webSocket.onerror = function(event) {
|
||||
alert(event.data);
|
||||
};
|
||||
|
||||
|
||||
webSocket.onopen = function(event) {
|
||||
$(function() {
|
||||
$('#cp2').colorpicker({
|
||||
format: 'rgb',
|
||||
|
||||
colorSelectors: {'default': '#777777',
|
||||
'primary': '#337ab7',
|
||||
'success': '#5cb85c',
|
||||
@@ -53,24 +54,24 @@
|
||||
},
|
||||
alpha: {
|
||||
maxTop: 200
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#cp2').colorpicker().on('changeColor', function(e) {
|
||||
//console.log(e.color.toRGB());
|
||||
webSocket.send('{"command":"color", "color":['+e.color.toRGB().r+','+e.color.toRGB().g+','+e.color.toRGB().b+'], "priority":1}');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$("#reset_color").on("click", function() {
|
||||
webSocket.send('{"command":"clear", "priority":1}');
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
webSocket.onmessage = function(event){
|
||||
console.log(event.data);
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user