more mobile improvements

This commit is contained in:
lone-cloud 2016-10-19 23:29:02 -07:00
parent 36dbc0fe61
commit 009363dd87
14 changed files with 67 additions and 183 deletions

View file

@ -21,9 +21,25 @@ export default Component.extend({
lightsTabSelected: computed.equal('selectedTab', 0), lightsTabSelected: computed.equal('selectedTab', 0),
musicTabSelected: computed.equal('selectedTab', 1), musicTabSelected: computed.equal('selectedTab', 1),
dimmerOn: false,
dimmerOnClass: computed('dimmerOn', function(){ dimmerOnClass: computed('dimmerOn', function(){
return this.get('dimmerOn') ? 'dimmerOn md-menu-origin' : 'md-menu-origin'; let dimmerOn = this.get('dimmerOn'),
storage = this.get('storage'),
dimmerOnClass = 'md-menu-origin';
if (dimmerOn) {
$('body').addClass('dimmerOn');
$('html').addClass('dimmerOn');
dimmerOnClass += ' dimmerOn';
} else {
$('body').removeClass('dimmerOn');
$('html').removeClass('dimmerOn');
}
storage.set('huegasm.dimmerOn', dimmerOn);
return dimmerOnClass;
}), }),
ready: computed('lightsData', 'trial', function() { ready: computed('lightsData', 'trial', function() {
@ -53,11 +69,17 @@ export default Component.extend({
init() { init() {
this._super(...arguments); this._super(...arguments);
let storage = this.get('storage');
if(!this.get('trial')) { if(!this.get('trial')) {
this.updateLightData(); this.updateLightData();
this.set('lightsDataIntervalHandle', setInterval(this.updateLightData.bind(this), 2000)); this.set('lightsDataIntervalHandle', setInterval(this.updateLightData.bind(this), 2000));
} }
if (!isNone(storage.get('huegasm.dimmerOn'))) {
this.set('dimmerOn', storage.get('huegasm.dimmerOn'));
}
if (!isNone(this.get('storage').get('huegasm.selectedTab'))) { if (!isNone(this.get('storage').get('huegasm.selectedTab'))) {
this.set('selectedTab', this.get('storage').get('huegasm.selectedTab')); this.set('selectedTab', this.get('storage').get('huegasm.selectedTab'));
} }
@ -217,7 +239,7 @@ export default Component.extend({
onFinish(); onFinish();
dimmer.popover({ dimmer.popover({
trigger: 'manual', trigger: 'manual',
placement: 'top', placement: 'right',
content: 'Click on this icon to toggle the dark theme.' content: 'Click on this icon to toggle the dark theme.'
}).popover('show'); }).popover('show');
@ -237,6 +259,9 @@ export default Component.extend({
$('.introjs-tooltip').velocity('scroll'); $('.introjs-tooltip').velocity('scroll');
}, 500); }, 500);
}).onexit(onExit).oncomplete(onFinish).start(); }).onexit(onExit).oncomplete(onFinish).start();
},
toggleDimmer(){
this.toggleProperty('dimmerOn');
} }
} }
}); });

View file

@ -1,8 +1,11 @@
{{#if ready}} {{#if ready}}
<div id="navigation"> <div id="navigation">
<div id="dimmer" {{action "toggleDimmer"}} class={{dimmerOnClass}}></div>
{{#each tabData as |tab|}} {{#each tabData as |tab|}}
<span class="navigation-item text-uppercase {{if tab.selected "active"}}" {{action "changeTab" tab.name}}>{{tab.name}}</span> <span class="navigation-item text-uppercase {{if tab.selected "active"}}" {{action "changeTab" tab.name}}>{{tab.name}}</span>
{{/each}} {{/each}}
<div id="settings"> <div id="settings">
<span data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="settings-itemSettings"> <span data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="settings-itemSettings">
{{paper-icon "settings" class=dimmerOnClass id="settings-icon" size=28}} {{paper-icon "settings" class=dimmerOnClass id="settings-icon" size=28}}

View file

@ -2,10 +2,7 @@ import Ember from 'ember';
const { const {
Component, Component,
computed, isEmpty
isEmpty,
isNone,
$
} = Ember; } = Ember;
export default Component.extend({ export default Component.extend({
@ -13,31 +10,6 @@ export default Component.extend({
bridgeUsername: null, bridgeUsername: null,
trial: false, trial: false,
storage: null, storage: null,
dimmerOn: false,
ready: false,
year: computed(function(){
return new Date().getFullYear();
}),
dimmerOnClass: computed('dimmerOn', function(){
let dimmerOn = this.get('dimmerOn'),
storage = this.get('storage'),
dimmerOnClass = null;
if (dimmerOn) {
$('body').addClass('dimmerOn');
$('html').addClass('dimmerOn');
dimmerOnClass = 'active';
} else {
$('body').removeClass('dimmerOn');
$('html').removeClass('dimmerOn');
}
storage.set('huegasm.dimmerOn', dimmerOn);
return dimmerOnClass;
}),
init(){ init(){
this._super(...arguments); this._super(...arguments);
@ -45,24 +17,11 @@ export default Component.extend({
let storage = new window.Locally.Store({compress: true}); let storage = new window.Locally.Store({compress: true});
this.set('storage', storage); this.set('storage', storage);
if (!isNone(storage.get('huegasm.dimmerOn'))) {
this.set('dimmerOn', storage.get('huegasm.dimmerOn'));
}
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({
bridgeIp: storage.get('huegasm.bridgeIp'), bridgeIp: storage.get('huegasm.bridgeIp'),
bridgeUsername: storage.get('huegasm.bridgeUsername') bridgeUsername: storage.get('huegasm.bridgeUsername')
}); });
} }
},
actions: {
toggleDimmer(){
this.toggleProperty('dimmerOn');
},
isReady(){
this.set('ready', true);
}
} }
}); });

View file

@ -1,39 +1,5 @@
{{#if bridgeUsername}} {{#if bridgeUsername}}
{{hue-controls bridgeIp=bridgeIp bridgeUsername=bridgeUsername trial=trial dimmerOn=dimmerOn storage=storage}} {{hue-controls bridgeIp=bridgeIp bridgeUsername=bridgeUsername trial=trial dimmerOn=dimmerOn storage=storage}}
{{else}} {{else}}
{{#if ready}} {{bridge-finder bridgeIp=bridgeIp bridgeUsername=bridgeUsername trial=trial storage=storage}}
{{bridge-finder bridgeIp=bridgeIp bridgeUsername=bridgeUsername trial=trial storage=storage}} {{/if}}
{{else}}
<div class="ready-block">
<div class="title">
<img src="assets/images/logo.png" alt="Huegasm">
</div>
<p id="intro">
Your lights, meet your music. Huegasm.
</p>
<p id="intro-paragraph">
Huegasm is a free web application for managing and synchronizing your <a target="_blank" href="http://www2.meethue.com">Philips Hue lights</a> with the beat of your music.
</p>
<div class="embed-container-wrapper">
<div class="embed-container">
<iframe width="560" height="315" src="https://www.youtube.com/embed/zi9J6Qg-MPw" frameborder="0" allowfullscreen></iframe>
</div>
</div>
{{paper-button raised=true primary=true onClick=(action "isReady") class="go-button center-block" label="Go!"}}
</div>
{{/if}}
{{/if}}
<footer id="footer">
<div id="dimmer" {{action "toggleDimmer"}} class={{dimmerOnClass}}></div>
<div id="footer-text">
© {{year}}
<a href="http://www.egorphilippov.me" target="_blank" rel="noopener noreferrer">
Egor Philippov
</a>
</div>
</footer>

View file

@ -4,10 +4,8 @@ const {
A, A,
Component, Component,
computed, computed,
isEmpty,
isNone, isNone,
observer, observer
$
} = Ember; } = Ember;
export default Component.extend({ export default Component.extend({

View file

@ -16,55 +16,24 @@
@import 'music-tab'; @import 'music-tab';
@import 'noui-slider'; @import 'noui-slider';
html { [data-ember-action] {
min-height: 100%; cursor: pointer;
height: auto; text-decoration: none;
} }
body { -webkit-tap-highlight-color {
margin-bottom: $footerHeight; rgba: (0, 0, 0, 0);
position: static;
} }
body, button { body, button {
font-family: 'Slabo 27px', serif; font-family: 'Slabo 27px', serif;
} }
.ember-app {
padding-bottom: 50px;
}
#footer {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
text-align: center;
height: $footerHeight;
}
#footer-text {
display: inline-block;
position: relative;
bottom: 10px;
a {
margin-left: 5px;
}
}
.alert { .alert {
margin-bottom: 0; margin-bottom: 0;
border: none; border: none;
} }
.title {
margin-bottom: 20px;
img {
width: 200px;
}
}
button.md-warn { button.md-warn {
background: $secondaryThemeColor; background: $secondaryThemeColor;
} }
@ -80,12 +49,18 @@ div.ember-modal-dialog {
} }
} }
.title {
margin-bottom: 30px;
img {
width: 200px;
}
}
.dropdown-menu { .dropdown-menu {
font-size: 14px; font-size: 14px;
a { a {
line-height: 2 !important; line-height: 2 !important;
} }
} }
// fancy webkit scrollbars // fancy webkit scrollbars
::-webkit-scrollbar { ::-webkit-scrollbar {

View file

@ -15,16 +15,7 @@
margin: 30px auto; margin: 30px auto;
} }
#intro { #bridge-finder {
font-size: 22px;
}
#intro-paragraph {
margin-bottom: 20px;
font-size: 16px;
}
#bridge-finder, .ready-block {
text-align: center; text-align: center;
padding: 10px 15px 0; padding: 10px 15px 0;
font-size: 16px; font-size: 16px;
@ -33,41 +24,3 @@
#bridge-finder .md-bar { #bridge-finder .md-bar {
background-color: $secondaryThemeColor !important; background-color: $secondaryThemeColor !important;
} }
// preloading image
.ready-block:after {
display: none;
content: url(images/pressButtonBridge.png);
}
.embed-container {
position:relative;
padding-bottom:56.25%;
padding-top:30px;
height:0;
overflow:hidden;
}
.embed-container-wrapper {
max-width: 550px;
margin: auto;
}
.embed-container iframe, .embed-container object, .embed-container embed {
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
}
.go-button {
margin: 20px 0;
border-radius: 100% !important;
width: 100px;
height: 100px;
font-size: 28px;
&:hover {
background: darken(#3f51b5, 10%) !important;
}
}

View file

@ -69,7 +69,6 @@ body.dimmerOn {
} }
} }
.paper-icon.dimmerOn { .paper-icon.dimmerOn {
color: inherit !important; color: inherit !important;
text-shadow: $glowingText; text-shadow: $glowingText;
@ -77,9 +76,9 @@ body.dimmerOn {
} }
#dimmer { #dimmer {
display: inline-block; float: left;
width: 40px; width: 30px;
height: 40px; height: 30px;
background: url(images/huegasm.png) center center no-repeat; background: url(images/huegasm.png) center center no-repeat !important;
background-size: 40px 40px; background-size: 30px 30px !important;
} }

View file

@ -1,6 +1,5 @@
$playerHeight: 400px; $playerHeight: 400px;
$playerDefaultIconColor: #BBBBBB; $playerDefaultIconColor: #BBBBBB;
$footerHeight: 50px;
$playerBottomHeight: 255px; $playerBottomHeight: 255px;
$secondaryThemeColor: #F12B24; $secondaryThemeColor: #F12B24;
$glowingText: 0 0 2px #fff, 0 0 4px #fff, 0 0 20px #228DFF; $glowingText: 0 0 2px #fff, 0 0 4px #fff, 0 0 20px #228DFF;

View file

@ -9,13 +9,11 @@
#light-option { #light-option {
text-align: left !important; text-align: left !important;
top: 20%; top: 20%;
-webkit-transform: translateY(-20%);
transform: translateY(-20%);
} }
#music-tab { #music-tab {
padding: 0; padding: 0;
margin: 10px 0 $footerHeight + 20px; margin: 10px 0 20px;
} }
#slide-toggle { #slide-toggle {
@ -369,4 +367,8 @@
.beat-option { .beat-option {
text-align: center !important; text-align: center !important;
} }
#save-beat-preferences-star {
right: 5px;
left: initial;
}
} }

View file

@ -45,6 +45,6 @@ md-switch.md-default-theme.md-checked .md-thumb {
@media(max-width:500px) { @media(max-width:500px) {
md-checkbox .md-label { md-checkbox .md-label {
width: 100px; width: 70px;
} }
} }

View file

@ -10,7 +10,7 @@
</div> </div>
<p id="intro"> <p id="intro">
Your lights, meet your music. Huegasm. Your lights meet your music.
</p> </p>
<p id="intro-paragraph"> <p id="intro-paragraph">
Huegasm is a free web application for managing and synchronizing your <a target="_blank" href="http://www2.meethue.com">Philips Hue lights</a> with the beat of your music. Huegasm is a free web application for managing and synchronizing your <a target="_blank" href="http://www2.meethue.com">Philips Hue lights</a> with the beat of your music.

View file

@ -9,8 +9,6 @@
#light-option { #light-option {
text-align: left !important; text-align: left !important;
top: 20%; top: 20%;
-webkit-transform: translateY(-20%);
transform: translateY(-20%);
.tooltip { .tooltip {
margin-top: 5px !important; margin-top: 5px !important;
} }
@ -404,4 +402,8 @@
.close { .close {
display: block; display: block;
} }
#save-beat-preferences-star {
right: 5px;
left: initial;
}
} }

View file

@ -57,6 +57,9 @@ md-switch.md-default-theme.md-checked .md-thumb {
@media(max-width:500px) { @media(max-width:500px) {
md-checkbox .md-label { md-checkbox .md-label {
width: 100px; width: 70px;
}
#save-beat-preferences-star {
right: 5px;
} }
} }