CSS mejorado para mobiles en login y panel izquierdo

This commit is contained in:
Juan Ferrer Toribio 2016-10-18 23:54:52 +02:00
parent 0b28eace4c
commit e488a7cc94
5 changed files with 51 additions and 68 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.363-deb8) stable; urgency=low hedera-web (1.370-deb8) stable; urgency=low
* Initial Release. * Initial Release.

View File

@ -8,7 +8,7 @@
.vn-gui .user-info, .vn-gui .user-info,
.vn-gui .menu-title, .vn-gui .menu-title,
.vn-gui .main-menu a .vn-gui .main-menu
{ {
font-size: 1.1em; font-size: 1.1em;
} }
@ -31,8 +31,6 @@
transition-property: left, background-color, transform; transition-property: left, background-color, transform;
transition-duration: 200ms; transition-duration: 200ms;
transition-timing-function: ease-in-out; transition-timing-function: ease-in-out;
/* transition: transform 100ms ease-in-out;
-webkit-transition: transform 100ms ease-in-out;*/
} }
.vn-gui .menu-button .vn-gui .menu-button
{ {
@ -214,7 +212,8 @@
/* Menu */ /* Menu */
.vn-gui .main-menu .vn-gui .main-menu,
.vn-gui ul.submenu
{ {
list-style-type: none; list-style-type: none;
padding: 0; padding: 0;
@ -223,47 +222,40 @@
.vn-gui .main-menu > li .vn-gui .main-menu > li
{ {
display: block; display: block;
float: left;
clear: both;
padding: 0; padding: 0;
margin: 0; margin: 0;
width: 100%; width: 100%;
} }
.vn-gui .main-menu > li > a
{
line-height: 2.8em;
width: 70%;
padding: 0 15%;
}
.vn-gui .main-menu a .vn-gui .main-menu a
{ {
float: left; width: 70%;
padding: 0 15%;
display: block;
line-height: 2.8em;
} }
.vn-gui .main-menu a:hover .vn-gui .main-menu a:hover
{ {
background-color: #DDD /* #AC6 */; background-color: rgba(1, 1, 1, 0.1);
} }
.vn-gui .main-menu a.selected .vn-gui .main-menu a.selected
{ {
background-color: #EEE; background-color: rgba(1, 1, 1, 0.05);
} }
.vn-gui ul.submenu .vn-gui ul.submenu
{ {
display: none; display: none;
}
.vn-gui ul.submenu.popup
{
display: inline;
position: fixed; position: fixed;
border: none; border: none;
border-radius: 1px; border-radius: 1px;
background-color: white; background-color: white;
box-shadow: 0 .2em .2em #CCC; box-shadow: 0 .2em .2em #CCC;
z-index: 50; z-index: 50;
list-style-type: none;
padding-left: 0;
width: 15em; width: 15em;
} max-height: 30em;
.vn-gui ul.submenu a
{
width: 60%;
padding: 0.7em 20%;
} }
/* Social */ /* Social */
@ -316,10 +308,6 @@
{ {
margin-left: -3em; margin-left: -3em;
} }
.vn-gui ul.submenu.show
{
display: inline;
}
} }
/* Mobile */ /* Mobile */
@ -365,13 +353,20 @@
.vn-gui ul.submenu .vn-gui ul.submenu
{ {
display: block; display: block;
position: relative; background-color: #777;
border: none; color:white;
border-radius: 0; box-shadow: inset 0 0 .2em rgba(1, 1, 1, 0.2);
background-color: white; overflow: hidden;
box-shadow: none;
width: auto; max-height: 0;
transition: max-height 300ms ease-out;
webkit-transition: max-height 300ms ease-out;
} }
.vn-gui .main-menu li:hover > ul.submenu
{
max-height: 20em;
}
.htk-toast .htk-toast
{ {
margin-left: -10.5em; margin-left: -10.5em;

View File

@ -70,7 +70,7 @@ module.exports = new Class
this._shown = true; this._shown = true;
Vn.includeCss ('js/hedera/gui.css'); Vn.includeCss ('js/hedera/gui.css');
document.body.appendChild (this.node); this.doc.body.appendChild (this.node);
if (Vn.isMobile ()) if (Vn.isMobile ())
{ {
@ -211,22 +211,27 @@ module.exports = new Class
{ {
res.row = sections[i]; res.row = sections[i];
var li = document.createElement ('li'); var li = this.createElement ('li');
ul.appendChild (li); ul.appendChild (li);
var text = this.createTextNode (_(res.get ('description')));
var a = document.createElement ('a'); var a = this.createElement ('a');
a.href = Vn.Hash.make ({'form': res.get ('path')});
this.menuOptions[res.get ('path')] = a; if (res.get ('path'))
li.appendChild (a); {
a.href = Vn.Hash.make ({'form': res.get ('path')});
this.menuOptions[res.get ('path')] = a;
}
var text = document.createTextNode (_(res.get ('description')));
a.appendChild (text); a.appendChild (text);
li.appendChild (a);
var formId = res.get ('id'); var formId = res.get ('id');
if (sectionMap[formId]) if (sectionMap[formId])
{ {
var submenu = document.createElement ('ul'); var submenu = this.createElement ('ul');
submenu.className = 'submenu'; submenu.className = 'submenu';
li.appendChild (submenu); li.appendChild (submenu);
@ -249,7 +254,7 @@ module.exports = new Class
this.activeSubmenu = submenu; this.activeSubmenu = submenu;
var rect = parent.getBoundingClientRect (); var rect = parent.getBoundingClientRect ();
Vn.Node.addClass (submenu, 'show'); Vn.Node.addClass (submenu, 'popup');
submenu.style.left = rect.right +'px'; submenu.style.left = rect.right +'px';
submenu.style.top = rect.top +'px'; submenu.style.top = rect.top +'px';
} }
@ -265,9 +270,9 @@ module.exports = new Class
if (submenu) if (submenu)
{ {
Vn.Node.removeClass (submenu, 'show'); Vn.Node.removeClass (submenu, 'popup');
submenu.style.left = 'initial'; submenu.style.left = '';
submenu.style.top = 'initial'; submenu.style.top = '';
clearTimeout (this.timeout); clearTimeout (this.timeout);
this.activeSubmenu = null; this.activeSubmenu = null;
this.timeout = 0; this.timeout = 0;
@ -281,7 +286,7 @@ module.exports = new Class
this.menuShown = true; this.menuShown = true;
this.hideMenuCallback = this.hideMenu.bind (this); this.hideMenuCallback = this.hideMenu.bind (this);
document.addEventListener ('click', this.hideMenuCallback); this.doc.addEventListener ('click', this.hideMenuCallback);
} }
,hideMenu: function () ,hideMenu: function ()
@ -293,7 +298,7 @@ module.exports = new Class
Vn.Node.removeClass (this.$('left-panel'), 'show'); Vn.Node.removeClass (this.$('left-panel'), 'show');
this.menuShown = false; this.menuShown = false;
document.removeEventListener ('click', this.hideMenuCallback); this.doc.removeEventListener ('click', this.hideMenuCallback);
this.hideMenuCallback = null; this.hideMenuCallback = null;
} }

View File

@ -25,8 +25,8 @@
<p id="supplanted"/> <p id="supplanted"/>
</div> </div>
</div> </div>
<a id="test-link" class="test-link" href="#"></a> <a id="test-link" class="test-link" href="#"/>
<ul id="main-menu" class="main-menu"></ul> <ul id="main-menu" class="main-menu"/>
</div> </div>
<div class="social"> <div class="social">
<htk-social-bar id="social-bar" priority="2"/> <htk-social-bar id="social-bar" priority="2"/>

View File

@ -36,6 +36,7 @@
.vn-login .column .vn-login .column
{ {
position: relative; position: relative;
overflow: auto;
margin: 0 auto; margin: 0 auto;
max-width: 40em; max-width: 40em;
height: 100%; height: 100%;
@ -47,33 +48,15 @@
.vn-login .login .vn-login .login
{ {
position: relative;
height: 100%;
max-width: 15em; max-width: 15em;
margin: 0 auto; margin: 0 auto;
padding-top: 6em;
} }
.vn-login form .vn-login form
{ {
position: absolute;
top: 50%;
margin-top: -20em;
width: 100%; width: 100%;
padding: 1em 0; padding: 1em 0;
} }
@media (max-height: 650px)
{
.vn-login,
.vn-login .login
{
height: auto;
}
.vn-login form
{
position: relative;
margin-top: 3.5em;
top: 0;
}
}
.vn-login form > div .vn-login form > div
{ {
margin: 1em 0; margin: 1em 0;