minor improvements

This commit is contained in:
Egor 2016-11-26 21:14:40 -08:00
parent 108e7be16c
commit 11ad26fdbd
17 changed files with 71 additions and 64 deletions

View file

@ -7,8 +7,9 @@ It lives at http://www.huegasm.com
## Current priorities ## Current priorities
- create a hybrid app with Cardova - create a hybrid app with Cardova
## Bugs ## WTF
- HackTimer not working? Slowness when switching to another browser tab, etc... Cordova disables the volume buttons for some reason. Monkey patching that shit ( must be a better way :( ).
Comment out: webView.setButtonPlumbedToJs lines from its source code.
## POSSIBLE FUTURE FEATURES ## POSSIBLE FUTURE FEATURES
- decode the hue color better - decode the hue color better

View file

@ -83,6 +83,7 @@ export default Component.extend({
if (!isNone(storage.get('huegasm.dimmerOn'))) { if (!isNone(storage.get('huegasm.dimmerOn'))) {
this.set('dimmerOn', storage.get('huegasm.dimmerOn')); this.set('dimmerOn', storage.get('huegasm.dimmerOn'));
this.get('dimmerOnClass');
} }
if (!isNone(this.get('storage').get('huegasm.selectedTab'))) { if (!isNone(this.get('storage').get('huegasm.selectedTab'))) {
@ -106,7 +107,9 @@ export default Component.extend({
updateLightData(){ updateLightData(){
let fail = ()=>{ let fail = ()=>{
if(this.get('displayFailure')){ if(isNone(this.get('lightsData'))) {
this.send('clearBridge');
} else if(this.get('displayFailure')) {
this.get('notify').warning({html: '<div class="alert alert-warning" role="alert">Error retrieving data from your lights. Yikes.</div>'}); this.get('notify').warning({html: '<div class="alert alert-warning" role="alert">Error retrieving data from your lights. Yikes.</div>'});
this.set('displayFailure', false); this.set('displayFailure', false);

View file

@ -1,7 +1,9 @@
{{#if ready}} {{#if ready}}
<div id="navigation"> <div id="navigation">
<div id="dimmer" class={{dimmerOnClass}} {{action "toggleDimmer"}}> <div id="dimmer-container" {{action "toggleDimmer"}}>
<div id="dimmer" class={{dimmerOnClass}} >
<div id="dimmer-switch"></div> <div id="dimmer-switch"></div>
</div>
</div> </div>
{{#each tabData as |tab|}} {{#each tabData as |tab|}}
@ -35,6 +37,8 @@
{{lights-tab apiURL=apiURL lightsData=lightsData activeLights=activeLights syncLight=syncLight trial=trial active=lightsTabSelected colorLoopOn=colorLoopOn dimmerOn=dimmerOn playing=playing pauseLightUpdates=pauseLightUpdates}} {{lights-tab apiURL=apiURL lightsData=lightsData activeLights=activeLights syncLight=syncLight trial=trial active=lightsTabSelected colorLoopOn=colorLoopOn dimmerOn=dimmerOn playing=playing pauseLightUpdates=pauseLightUpdates}}
{{music-tab apiURL=apiURL lightsData=lightsData activeLights=activeLights active=musicTabSelected pauseLightUpdates=pauseLightUpdates dimmerOn=dimmerOn playing=playing storage=storage colorLoopOn=colorLoopOn action="startIntro"}} {{music-tab apiURL=apiURL lightsData=lightsData activeLights=activeLights active=musicTabSelected pauseLightUpdates=pauseLightUpdates dimmerOn=dimmerOn playing=playing storage=storage colorLoopOn=colorLoopOn action="startIntro"}}
{{else}}
{{paper-progress-circular diameter=100}}
{{/if}} {{/if}}
{{ember-notify messageStyle='bootstrap' closeAfter=5000}} {{ember-notify messageStyle='bootstrap' closeAfter=5000}}

View file

@ -304,22 +304,6 @@ export default Component.extend(helperMixin, visualizerMixin, {
client_id: this.get('SC_CLIENT_ID') client_id: this.get('SC_CLIENT_ID')
}); });
document.addEventListener('volumedownbutton', () => {
let volume = this.get('volume') - 5;
volume = volume < 0 ? 0 : volume;
this.set('volume', volume);
window.system.setSystemVolume(volume/100);
}, false);
document.addEventListener('volumeupbutton', () => {
let volume = this.get('volume') + 5;
volume = volume > 100 ? 100 : volume;
this.set('volume', volume);
window.system.setSystemVolume(volume/100);
}, false);
document.addEventListener('pause', () => { document.addEventListener('pause', () => {
this.get('dancer').pause(); this.get('dancer').pause();
}, false); }, false);

View file

@ -50,9 +50,6 @@ body.dimmerOn {
.add-new-music:hover { .add-new-music:hover {
background: darken($dimmerOnButtonColor, 5%); background: darken($dimmerOnButtonColor, 5%);
} }
.popover-content {
color: $blackish !important;
}
.md-bar { .md-bar {
background-color: darken(white, 60%) !important; background-color: darken(white, 60%) !important;
} }
@ -63,22 +60,28 @@ body.dimmerOn {
opacity: 0.9 !important; opacity: 0.9 !important;
} }
#dimmer-container {
float: left;
cursor: pointer;
padding: 5px 10px;
position: relative;
bottom: 5px;
}
#dimmer { #dimmer {
background: url(images/lightswitch.png) !important; background: url(images/lightswitch.png) !important;
width: 14px; width: 14px;
height: 34px; height: 34px;
display: inline-block;
float: left;
margin-left: 15px;
&.dimmerOn #dimmer-switch { &.dimmerOn #dimmer-switch {
opacity: 0; opacity: 0;
} }
#dimmer-switch { }
background: url(images/lightswitch.png) -14px 0px;
width: 14px; #dimmer-switch {
height: 34px; background: url(images/lightswitch.png) -14px 0px;
transition: opacity 0.4s; width: 14px;
float: left; height: 34px;
opacity: 1; transition: opacity 0.4s;
} float: left;
opacity: 1;
} }

View file

@ -12,6 +12,13 @@
#hue-controls { #hue-controls {
max-width: 1200px; max-width: 1200px;
position: relative; position: relative;
min-height: 100vh;
md-progress-circular {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
} }
// preload images // preload images

View file

@ -1,7 +1,6 @@
{ {
"name": "huegasm", "name": "huegasm",
"dependencies": { "dependencies": {
"HackTimer": "https://github.com/turuslan/HackTimer.git#~1.1.0",
"JavaScript-ID3-Reader": "https://github.com/aadsm/JavaScript-ID3-Reader.git", "JavaScript-ID3-Reader": "https://github.com/aadsm/JavaScript-ID3-Reader.git",
"bootstrap-sass": "^3.3.5", "bootstrap-sass": "^3.3.5",
"ember": "beta", "ember": "beta",

View file

@ -5,7 +5,7 @@ module.exports = function(environment) {
modulePrefix: 'huegasm_mobile', modulePrefix: 'huegasm_mobile',
podModulePrefix: 'huegasm_mobile/pods', podModulePrefix: 'huegasm_mobile/pods',
environment: environment, environment: environment,
rootURL: '/', rootURL: '',
locationType: 'hash', locationType: 'hash',
EmberENV: { EmberENV: {
FEATURES: { FEATURES: {

View file

@ -4,12 +4,8 @@ var EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) { module.exports = function(defaults) {
var app = new EmberApp(defaults); var app = new EmberApp(defaults);
app.import('bower_components/HackTimer/HackTimer.js');
app.import('vendor/dancer.js'); app.import('vendor/dancer.js');
app.import('bower_components/bootstrap-sass/assets/javascripts/bootstrap/tooltip.js');
app.import('bower_components/bootstrap-sass/assets/javascripts/bootstrap/popover.js');
app.import('bower_components/intro.js/intro.js'); app.import('bower_components/intro.js/intro.js');
app.import('bower_components/intro.js/introjs.css'); app.import('bower_components/intro.js/introjs.css');
app.import('bower_components/JavaScript-ID3-Reader/dist/id3-minimized.js'); app.import('bower_components/JavaScript-ID3-Reader/dist/id3-minimized.js');

View file

@ -89,5 +89,4 @@
</platform> </platform>
<engine name="android" spec="~5.2.2" /> <engine name="android" spec="~5.2.2" />
<preference name="ShowSplashScreenSpinner" value="false" /> <preference name="ShowSplashScreenSpinner" value="false" />
<plugin name="com.jiliac.systemvolume" spec="https://github.com/hoboman313/phonegap-plugin-systemvolume" />
</widget> </widget>

View file

@ -89,7 +89,9 @@ export default Component.extend({
updateLightData(){ updateLightData(){
let fail = ()=>{ let fail = ()=>{
if(this.get('displayFailure')){ if(isNone(this.get('lightsData'))) {
this.send('clearBridge');
} else if(this.get('displayFailure')){
this.get('notify').warning({html: '<div class="alert alert-warning" role="alert">Error retrieving data from your lights. Yikes.</div>'}); this.get('notify').warning({html: '<div class="alert alert-warning" role="alert">Error retrieving data from your lights. Yikes.</div>'});
this.set('displayFailure', false); this.set('displayFailure', false);

View file

@ -1,7 +1,9 @@
{{#if ready}} {{#if ready}}
<div id="navigation"> <div id="navigation">
<div id="dimmer" class={{dimmerOnClass}} {{action "toggleDimmer"}}> <div id="dimmer-container" {{action "toggleDimmer"}}>
<div id="dimmer-switch"></div> <div id="dimmer" class={{dimmerOnClass}} >
<div id="dimmer-switch"></div>
</div>
</div> </div>
{{#each tabData as |tab|}} {{#each tabData as |tab|}}
@ -36,6 +38,8 @@
{{music-tab apiURL=apiURL lightsData=lightsData activeLights=activeLights active=musicTabSelected pauseLightUpdates=pauseLightUpdates dimmerOn=dimmerOn storage=storage colorLoopOn=colorLoopOn playing=playing action="startIntro"}} {{music-tab apiURL=apiURL lightsData=lightsData activeLights=activeLights active=musicTabSelected pauseLightUpdates=pauseLightUpdates dimmerOn=dimmerOn storage=storage colorLoopOn=colorLoopOn playing=playing action="startIntro"}}
</div> </div>
{{else}}
{{paper-progress-circular diameter=100}}
{{/if}} {{/if}}
{{ember-notify messageStyle='bootstrap' closeAfter=5000}} {{ember-notify messageStyle='bootstrap' closeAfter=5000}}

View file

@ -48,7 +48,7 @@
// Components w/ JavaScript // Components w/ JavaScript
//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/modals"; //@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/modals";
@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/tooltip"; @import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/tooltip";
@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/popovers"; //@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/popovers";
//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/carousel"; //@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/carousel";
// Utility classes // Utility classes

View file

@ -56,9 +56,6 @@ body.dimmerOn {
.add-new-music:hover { .add-new-music:hover {
background: darken($dimmerOnButtonColor, 5%); background: darken($dimmerOnButtonColor, 5%);
} }
.popover-content {
color: $blackish !important;
}
.md-bar { .md-bar {
background-color: darken(white, 60%) !important; background-color: darken(white, 60%) !important;
} }
@ -78,23 +75,28 @@ body.dimmerOn {
background-size: 40px 40px; background-size: 40px 40px;
} }
#dimmer-container {
float: left;
cursor: pointer;
padding: 5px 10px;
position: relative;
bottom: 5px;
}
#dimmer { #dimmer {
background: url(images/lightswitch.png) !important; background: url(images/lightswitch.png) !important;
width: 14px; width: 14px;
height: 34px; height: 34px;
display: inline-block;
float: left;
margin-left: 15px;
cursor: pointer;
&.dimmerOn #dimmer-switch { &.dimmerOn #dimmer-switch {
opacity: 0; opacity: 0;
} }
#dimmer-switch { }
background: url(images/lightswitch.png) -14px 0px;
width: 14px; #dimmer-switch {
height: 34px; background: url(images/lightswitch.png) -14px 0px;
transition: opacity 0.4s; width: 14px;
float: left; height: 34px;
opacity: 1; transition: opacity 0.4s;
} float: left;
opacity: 1;
} }

View file

@ -24,6 +24,13 @@
max-width: 1200px; max-width: 1200px;
position: relative; position: relative;
flex: 1; flex: 1;
min-height: 100vh;
md-progress-circular {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
} }
// preload images // preload images

View file

@ -1,7 +1,6 @@
{ {
"name": "huegasm", "name": "huegasm",
"dependencies": { "dependencies": {
"HackTimer": "https://github.com/turuslan/HackTimer.git#~1.1.0",
"JavaScript-ID3-Reader": "https://github.com/aadsm/JavaScript-ID3-Reader.git", "JavaScript-ID3-Reader": "https://github.com/aadsm/JavaScript-ID3-Reader.git",
"bootstrap-sass": "^3.3.5", "bootstrap-sass": "^3.3.5",
"ember": "beta", "ember": "beta",

View file

@ -4,12 +4,9 @@ var EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) { module.exports = function(defaults) {
var app = new EmberApp(defaults); var app = new EmberApp(defaults);
app.import('bower_components/HackTimer/HackTimer.js');
app.import('vendor/dancer.js'); app.import('vendor/dancer.js');
app.import('bower_components/bootstrap-sass/assets/javascripts/bootstrap/tooltip.js'); app.import('bower_components/bootstrap-sass/assets/javascripts/bootstrap/tooltip.js');
app.import('bower_components/bootstrap-sass/assets/javascripts/bootstrap/popover.js');
app.import('bower_components/intro.js/intro.js'); app.import('bower_components/intro.js/intro.js');
app.import('bower_components/intro.js/introjs.css'); app.import('bower_components/intro.js/introjs.css');
app.import('bower_components/JavaScript-ID3-Reader/dist/id3-minimized.js'); app.import('bower_components/JavaScript-ID3-Reader/dist/id3-minimized.js');