Better tablet (width >= 768px) support

This commit is contained in:
Skylar Ittner 2017-12-23 01:18:11 -07:00
parent c2916076ad
commit 02f8c97b44
3 changed files with 105 additions and 113 deletions

View File

@ -2,16 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#swipe-nav {
display: none;
visibility: hidden;
}
#swipe-shader {
display: none;
visibility: hidden;
}
.mobile-app-hide { .mobile-app-hide {
display: none; display: none;
visibility: hidden; visibility: hidden;
@ -25,23 +15,23 @@
display: initial; display: initial;
} }
.navbar, .navbar-brand {
min-height: 56px;
height: 56px;
}
.navbar-brand {
font-size: 20px;
margin-top: -4px;
}
.navbar-toggle {
border: 0px solid white;
margin-top: 11px;
margin-bottom: 11px;
}
@media screen and (max-width: 767px) { @media screen and (max-width: 767px) {
.navbar, .navbar-brand {
min-height: 56px;
height: 56px;
}
.navbar-brand {
font-size: 20px;
margin-top: -4px;
}
.navbar-toggle {
border: 0px solid white;
margin-top: 11px;
margin-bottom: 11px;
}
#navbar-collapse { #navbar-collapse {
display: none; display: none;
} }
@ -58,100 +48,100 @@
.navbar-header .navbar-brand img { .navbar-header .navbar-brand img {
display: none; display: none;
} }
}
#swipe-nav {
display: none; #swipe-nav {
visibility: visible; display: none;
overflow-y: scroll; visibility: visible;
position: fixed; overflow-y: scroll;
top: 0; position: fixed;
left: 0; top: 0;
bottom: 0; left: 0;
width: 60%; bottom: 0;
z-index: 9999999; width: 60%;
max-width: 300px; z-index: 9999999;
min-width: 200px; max-width: 300px;
background-color: #fafafa; min-width: 200px;
box-shadow: 5px 0px 15px 0px rgba(0,0,0,0.5); background-color: #fafafa;
} box-shadow: 5px 0px 15px 0px rgba(0,0,0,0.5);
}
#swipe-nav #swipe-header {
height: 150px; #swipe-nav #swipe-header {
background-color: #eeeeee; height: 150px;
position: relative; background-color: #eeeeee;
} position: relative;
}
#swipe-nav #swipe-header #swipe-username {
position: absolute; #swipe-nav #swipe-header #swipe-username {
bottom: 0; position: absolute;
padding-left: 10px; bottom: 0;
padding-bottom: 10px; padding-left: 10px;
font-size: 110%; padding-bottom: 10px;
} font-size: 110%;
}
#swipe-nav #swipe-header #swipe-appicon {
position: absolute; #swipe-nav #swipe-header #swipe-appicon {
top: 0; position: absolute;
padding-left: 20px; top: 0;
padding-top: 20px; padding-left: 20px;
height: 80px; padding-top: 20px;
} height: 80px;
}
#swipe-nav #swipe-header #swipe-username .fa {
font-size: 120%; #swipe-nav #swipe-header #swipe-username .fa {
} font-size: 120%;
}
#swipe-nav ul {
margin-bottom: 10px; #swipe-nav ul {
padding-left: 2px; margin-bottom: 10px;
list-style-type: none; padding-left: 2px;
padding: 3px; list-style-type: none;
} padding: 3px;
}
#swipe-nav ul li {
color: #424242; #swipe-nav ul li {
padding-top: 5px; color: #424242;
padding-bottom: 5px; padding-top: 5px;
} padding-bottom: 5px;
}
#swipe-nav ul li a:focus,a:active {
background-color: #e0e0e0; #swipe-nav ul li a:focus,a:active {
} background-color: #e0e0e0;
}
#swipe-nav ul li i.fa {
font-size: 120%; #swipe-nav ul li i.fa {
margin-right: 10px; font-size: 120%;
margin-left: 5px; margin-right: 10px;
} margin-left: 5px;
}
#swipe-nav ul li a {
display: inline-block; #swipe-nav ul li a {
color: #424242; display: inline-block;
font-size: 110%; color: #424242;
text-decoration: none; font-size: 110%;
width: 100%; text-decoration: none;
padding-top: 10px; width: 100%;
padding-bottom: 10px; padding-top: 10px;
} padding-bottom: 10px;
}
#swipe-nav ul li a:hover {
text-decoration: none; #swipe-nav ul li a:hover {
} text-decoration: none;
}
#swipe-nav #swipe-pages {
padding-bottom: 10px; #swipe-nav #swipe-pages {
border-bottom: 1px solid #eeeeee; padding-bottom: 10px;
} border-bottom: 1px solid #eeeeee;
}
#swipe-shader {
position: fixed; #swipe-shader {
display: none; position: fixed;
visibility: visible; display: none;
top: 0; visibility: visible;
right: 0; top: 0;
bottom: 0; right: 0;
left: 0; bottom: 0;
background-color: rgba(0,0,0,0.5); left: 0;
z-index: 9999998; background-color: rgba(0,0,0,0.5);
} z-index: 9999998;
} }

View File

@ -53,13 +53,13 @@ function togglemenu() {
$(document).ready(function () { $(document).ready(function () {
$.fx.off = __JQUERYFXOFF__; $.fx.off = __JQUERYFXOFF__;
var pages = $('#navbar-collapse .navbar-nav').html(); var pages = $('#navbar-collapse .navbar-nav').html();
var user = $('#navbar-collapse .navbar-right').html(); var body = $('body');
var username = "__USERNAME__"; var username = "__USERNAME__";
var menucolor = $('.navbar').css('backgroundColor'); var menucolor = $('.navbar').css('backgroundColor');
var textcolor = $('.navbar .navbar-nav > li > a').css('color'); var textcolor = $('.navbar .navbar-nav > li > a').css('color');
var logo = "__LOGO__"; var logo = "__LOGO__";
$('body').append("<div id='swipe-nav'><div id='swipe-header' style='background-color: " + menucolor + "; color: " + textcolor + "'><a href='./app.php'><img id='swipe-appicon' src='" + logo + "' /></a> <div id='swipe-username'><i class='fa fa-user fa-fw'></i> " + username + "</div></div>\n<ul id='swipe-pages'>" + pages + "</ul><ul><li><a onclick='quitapp()'><i class='fa fa-sign-out fa-fw'></i> Back to Menu</a></li></ul></div>"); body.append("<div id='swipe-nav'><div id='swipe-header' style='background-color: " + menucolor + "; color: " + textcolor + "'><a href='./app.php'><img id='swipe-appicon' src='" + logo + "' /></a> <div id='swipe-username'><i class='fa fa-user fa-fw'></i> " + username + "</div></div>\n<ul id='swipe-pages'>" + pages + "</ul><ul><li><a onclick='quitapp()'><i class='fa fa-sign-out fa-fw'></i> Back to Menu</a></li></ul></div>");
$('body').append("<div id='swipe-shader'></div>"); body.append("<div id='swipe-shader'></div>");
$(".navbar-brand").attr("href", "#"); $(".navbar-brand").attr("href", "#");

View File

@ -37,6 +37,8 @@
$('#appframe').on("load", function () { $('#appframe').on("load", function () {
$("#loadframe").fadeOut(300); $("#loadframe").fadeOut(300);
historyctr++; historyctr++;
// Do this right away so it's a bit harder to glitch
$('#appframe').contents().find('.navbar-right').html("<li><a onclick='quitapp()'><i class='fa fa-sign-out fa-fw'></i> Back to Menu</a></li>");
$.get("css/sidemenu.css", function (style) { $.get("css/sidemenu.css", function (style) {
$('#appframe').contents().find('head').append("<style>" + style + "</style>"); $('#appframe').contents().find('head').append("<style>" + style + "</style>");
$.get("js/jquery-ui.min.js", function (script) { $.get("js/jquery-ui.min.js", function (script) {