proper sticky footer
This commit is contained in:
parent
df88aa7c8b
commit
36465a858c
13 changed files with 80 additions and 40 deletions
40
web/app/pods/application/controller.js
Normal file
40
web/app/pods/application/controller.js
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
import Ember from 'ember';
|
||||||
|
|
||||||
|
const {
|
||||||
|
Controller,
|
||||||
|
isEmpty
|
||||||
|
} = Ember;
|
||||||
|
|
||||||
|
export default Controller.extend({
|
||||||
|
dimmerOn: false,
|
||||||
|
|
||||||
|
init(){
|
||||||
|
this._super(...arguments);
|
||||||
|
|
||||||
|
let storage = new window.Locally.Store({compress: true}),
|
||||||
|
dimmerOn = storage.get('huegasm.dimmerOn');
|
||||||
|
this.set('storage', storage);
|
||||||
|
|
||||||
|
if (!isEmpty(dimmerOn) && dimmerOn) {
|
||||||
|
this.send('toggleDimmer');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
actions: {
|
||||||
|
toggleDimmer(){
|
||||||
|
this.toggleProperty('dimmerOn');
|
||||||
|
|
||||||
|
let dimmerOn = this.get('dimmerOn');
|
||||||
|
|
||||||
|
if (dimmerOn) {
|
||||||
|
$('body').addClass('dimmerOn');
|
||||||
|
$('html').addClass('dimmerOn');
|
||||||
|
} else {
|
||||||
|
$('body').removeClass('dimmerOn');
|
||||||
|
$('html').removeClass('dimmerOn');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.get('storage').set('huegasm.dimmerOn', dimmerOn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
@ -1 +1,3 @@
|
||||||
{{huegasm-app}}
|
{{huegasm-app action="toggleDimmer" dimmerOn=dimmerOn storage=storage}}
|
||||||
|
|
||||||
|
{{huegasm-footer action="toggleDimmer" dimmerOn=dimmerOn storage=storage}}
|
||||||
|
|
@ -115,7 +115,7 @@ export default Component.extend({
|
||||||
location.reload();
|
location.reload();
|
||||||
},
|
},
|
||||||
toggleDimmer() {
|
toggleDimmer() {
|
||||||
this.sendAction("toggleDimmer");
|
this.sendAction();
|
||||||
},
|
},
|
||||||
clearAllSettings() {
|
clearAllSettings() {
|
||||||
this.get('storage').clear();
|
this.get('storage').clear();
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,8 @@
|
||||||
{{light-group lightsData=lightsData activeLights=activeLights syncLight=syncLight apiURL=apiURL dimmerOn=dimmerOn storage=storage}}
|
{{light-group lightsData=lightsData activeLights=activeLights syncLight=syncLight apiURL=apiURL dimmerOn=dimmerOn storage=storage}}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{{lights-tab apiURL=apiURL lightsData=lightsData activeLights=activeLights syncLight=syncLight trial=trial active=lightsTabSelected colorLoopOn=colorLoopOn dimmerOn=dimmerOn strobeOn=pauseLightUpdates toggleDimmer="toggleDimmer"}}
|
{{lights-tab apiURL=apiURL lightsData=lightsData activeLights=activeLights syncLight=syncLight trial=trial active=lightsTabSelected colorLoopOn=colorLoopOn dimmerOn=dimmerOn strobeOn=pauseLightUpdates}}
|
||||||
|
|
||||||
{{music-tab apiURL=apiURL lightsData=lightsData activeLights=activeLights active=musicTabSelected pauseLightUpdates=pauseLightUpdates dimmerOn=dimmerOn storage=storage colorLoopOn=colorLoopOn toggleDimmer="toggleDimmer" action="startIntro"}}
|
{{music-tab apiURL=apiURL lightsData=lightsData activeLights=activeLights active=musicTabSelected pauseLightUpdates=pauseLightUpdates dimmerOn=dimmerOn storage=storage colorLoopOn=colorLoopOn action="startIntro"}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
@ -2,28 +2,18 @@ import Ember from 'ember';
|
||||||
|
|
||||||
const {
|
const {
|
||||||
Component,
|
Component,
|
||||||
isEmpty,
|
isEmpty
|
||||||
isNone,
|
|
||||||
$
|
|
||||||
} = Ember;
|
} = Ember;
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
bridgeIp: null,
|
|
||||||
bridgeUsername: null,
|
|
||||||
trial: false,
|
trial: false,
|
||||||
dimmerOn: false,
|
|
||||||
ready: false,
|
ready: false,
|
||||||
|
elementId: 'huegasm',
|
||||||
|
|
||||||
init(){
|
init(){
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
|
||||||
let storage = new window.Locally.Store({compress: true}),
|
let storage = this.get('storage');
|
||||||
dimmerOn = storage.get('huegasm.dimmerOn');
|
|
||||||
this.set('storage', storage);
|
|
||||||
|
|
||||||
if (!isNone(dimmerOn) && dimmerOn) {
|
|
||||||
this.send('toggleDimmer');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isEmpty(storage.get('huegasm.bridgeIp')) && !isEmpty(storage.get('huegasm.bridgeUsername'))) {
|
if (!isEmpty(storage.get('huegasm.bridgeIp')) && !isEmpty(storage.get('huegasm.bridgeUsername'))) {
|
||||||
this.setProperties({
|
this.setProperties({
|
||||||
|
|
@ -35,19 +25,7 @@ export default Component.extend({
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
toggleDimmer(){
|
toggleDimmer(){
|
||||||
this.toggleProperty('dimmerOn');
|
this.sendAction();
|
||||||
|
|
||||||
let dimmerOn = this.get('dimmerOn');
|
|
||||||
|
|
||||||
if (dimmerOn) {
|
|
||||||
$('body').addClass('dimmerOn');
|
|
||||||
$('html').addClass('dimmerOn');
|
|
||||||
} else {
|
|
||||||
$('body').removeClass('dimmerOn');
|
|
||||||
$('html').removeClass('dimmerOn');
|
|
||||||
}
|
|
||||||
|
|
||||||
this.get('storage').set('huegasm.dimmerOn', dimmerOn);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
isReady(){
|
isReady(){
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{{#if bridgeUsername}}
|
{{#if bridgeUsername}}
|
||||||
{{hue-controls bridgeIp=bridgeIp bridgeUsername=bridgeUsername trial=trial dimmerOn=dimmerOn storage=storage toggleDimmer="toggleDimmer"}}
|
{{hue-controls bridgeIp=bridgeIp bridgeUsername=bridgeUsername trial=trial dimmerOn=dimmerOn storage=storage action="toggleDimmer"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#if ready}}
|
{{#if ready}}
|
||||||
{{bridge-finder bridgeIp=bridgeIp bridgeUsername=bridgeUsername trial=trial storage=storage}}
|
{{bridge-finder bridgeIp=bridgeIp bridgeUsername=bridgeUsername trial=trial storage=storage}}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ export default Component.extend({
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
toggleDimmer(){
|
toggleDimmer(){
|
||||||
this.sendAction('toggleDimmer');
|
this.sendAction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -41,5 +41,3 @@
|
||||||
{{paper-switch value=colorLoopOn onChange=(action (mut colorLoopOn)) disabled=trial skipProxy=trial label=colorloopOnTxt}}
|
{{paper-switch value=colorLoopOn onChange=(action (mut colorLoopOn)) disabled=trial skipProxy=trial label=colorloopOnTxt}}
|
||||||
{{/paper-item}}
|
{{/paper-item}}
|
||||||
{{/paper-list}}
|
{{/paper-list}}
|
||||||
|
|
||||||
{{huegasm-footer toggleDimmer="toggleDimmer"}}
|
|
||||||
|
|
@ -218,5 +218,3 @@
|
||||||
{{ember-notify messageStyle='bootstrap' closeAfter=5000}}
|
{{ember-notify messageStyle='bootstrap' closeAfter=5000}}
|
||||||
|
|
||||||
{{music-tab/add-soundcloud-sound-modal action="handleNewSoundCloudURL" isShowingModal=isShowingAddSoundCloudModal}}
|
{{music-tab/add-soundcloud-sound-modal action="handleNewSoundCloudURL" isShowingModal=isShowingAddSoundCloudModal}}
|
||||||
|
|
||||||
{{huegasm-footer toggleDimmer="toggleDimmer"}}
|
|
||||||
|
|
@ -16,10 +16,20 @@
|
||||||
@import 'music-tab';
|
@import 'music-tab';
|
||||||
@import 'noui-slider';
|
@import 'noui-slider';
|
||||||
|
|
||||||
|
body > .ember-view {
|
||||||
|
display: flex;
|
||||||
|
min-height: 100vh;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
body, button {
|
body, button {
|
||||||
font-family: 'Slabo 27px', serif;
|
font-family: 'Slabo 27px', serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#huegasm {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
.ember-app {
|
.ember-app {
|
||||||
padding-bottom: 50px;
|
padding-bottom: 50px;
|
||||||
}
|
}
|
||||||
|
|
@ -34,6 +44,7 @@ body, button {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: relative;
|
position: relative;
|
||||||
bottom: 10px;
|
bottom: 10px;
|
||||||
|
font-size: 18px;
|
||||||
a {
|
a {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
#hue-controls {
|
#hue-controls {
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// preload images
|
// preload images
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "ember server",
|
"start": "ember server",
|
||||||
"build": "ember build",
|
"build": "ember build --env=production",
|
||||||
"test": "ember test"
|
"test": "ember test"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
|
||||||
12
web/tests/unit/pods/application/controller-test.js
Normal file
12
web/tests/unit/pods/application/controller-test.js
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { moduleFor, test } from 'ember-qunit';
|
||||||
|
|
||||||
|
moduleFor('controller:application', 'Unit | Controller | application', {
|
||||||
|
// Specify the other units that are required for this test.
|
||||||
|
// needs: ['controller:foo']
|
||||||
|
});
|
||||||
|
|
||||||
|
// Replace this with your real tests.
|
||||||
|
test('it exists', function(assert) {
|
||||||
|
let controller = this.subject();
|
||||||
|
assert.ok(controller);
|
||||||
|
});
|
||||||
Reference in a new issue