Better tablet (width >= 768px) support

Framework7
Skylar Ittner 6 years ago
parent c2916076ad
commit 02f8c97b44

@ -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 { @media screen and (max-width: 767px) {
min-height: 56px; .navbar, .navbar-brand {
height: 56px; min-height: 56px;
} height: 56px;
}
.navbar-brand { .navbar-brand {
font-size: 20px; font-size: 20px;
margin-top: -4px; margin-top: -4px;
} }
.navbar-toggle { .navbar-toggle {
border: 0px solid white; border: 0px solid white;
margin-top: 11px; margin-top: 11px;
margin-bottom: 11px; margin-bottom: 11px;
} }
@media screen and (max-width: 767px) {
#navbar-collapse { #navbar-collapse {
display: none; display: none;
} }
@ -57,101 +47,101 @@
.navbar-header .navbar-brand img { .navbar-header .navbar-brand img {
display: none; display: none;
} }
}
#swipe-nav { #swipe-nav {
display: none; display: none;
visibility: visible; visibility: visible;
overflow-y: scroll; overflow-y: scroll;
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
bottom: 0; bottom: 0;
width: 60%; width: 60%;
z-index: 9999999; z-index: 9999999;
max-width: 300px; max-width: 300px;
min-width: 200px; min-width: 200px;
background-color: #fafafa; background-color: #fafafa;
box-shadow: 5px 0px 15px 0px rgba(0,0,0,0.5); box-shadow: 5px 0px 15px 0px rgba(0,0,0,0.5);
} }
#swipe-nav #swipe-header { #swipe-nav #swipe-header {
height: 150px; height: 150px;
background-color: #eeeeee; background-color: #eeeeee;
position: relative; position: relative;
} }
#swipe-nav #swipe-header #swipe-username { #swipe-nav #swipe-header #swipe-username {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
padding-left: 10px; padding-left: 10px;
padding-bottom: 10px; padding-bottom: 10px;
font-size: 110%; font-size: 110%;
} }
#swipe-nav #swipe-header #swipe-appicon { #swipe-nav #swipe-header #swipe-appicon {
position: absolute; position: absolute;
top: 0; top: 0;
padding-left: 20px; padding-left: 20px;
padding-top: 20px; padding-top: 20px;
height: 80px; height: 80px;
} }
#swipe-nav #swipe-header #swipe-username .fa { #swipe-nav #swipe-header #swipe-username .fa {
font-size: 120%; font-size: 120%;
} }
#swipe-nav ul { #swipe-nav ul {
margin-bottom: 10px; margin-bottom: 10px;
padding-left: 2px; padding-left: 2px;
list-style-type: none; list-style-type: none;
padding: 3px; padding: 3px;
} }
#swipe-nav ul li { #swipe-nav ul li {
color: #424242; color: #424242;
padding-top: 5px; padding-top: 5px;
padding-bottom: 5px; padding-bottom: 5px;
} }
#swipe-nav ul li a:focus,a:active { #swipe-nav ul li a:focus,a:active {
background-color: #e0e0e0; background-color: #e0e0e0;
} }
#swipe-nav ul li i.fa { #swipe-nav ul li i.fa {
font-size: 120%; font-size: 120%;
margin-right: 10px; margin-right: 10px;
margin-left: 5px; margin-left: 5px;
} }
#swipe-nav ul li a { #swipe-nav ul li a {
display: inline-block; display: inline-block;
color: #424242; color: #424242;
font-size: 110%; font-size: 110%;
text-decoration: none; text-decoration: none;
width: 100%; width: 100%;
padding-top: 10px; padding-top: 10px;
padding-bottom: 10px; padding-bottom: 10px;
} }
#swipe-nav ul li a:hover { #swipe-nav ul li a:hover {
text-decoration: none; text-decoration: none;
} }
#swipe-nav #swipe-pages { #swipe-nav #swipe-pages {
padding-bottom: 10px; padding-bottom: 10px;
border-bottom: 1px solid #eeeeee; border-bottom: 1px solid #eeeeee;
} }
#swipe-shader { #swipe-shader {
position: fixed; position: fixed;
display: none; display: none;
visibility: visible; visibility: visible;
top: 0; top: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
left: 0; left: 0;
background-color: rgba(0,0,0,0.5); background-color: rgba(0,0,0,0.5);
z-index: 9999998; z-index: 9999998;
}
} }

@ -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", "#");

@ -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) {

Loading…
Cancel
Save