diff --git a/public/css/style.less b/public/css/style.less index 62523bec79..5b5216cba7 100644 --- a/public/css/style.less +++ b/public/css/style.less @@ -35,6 +35,10 @@ body { padding-top: 70px; } + @media (max-width: 979px) + { + padding-bottom: 50px; + } } .none { @@ -521,4 +525,122 @@ body .navbar .nodebb-inline-block { .post-window { position: static; } +} + + +#mobile-menu { + position: fixed; + bottom: 0px; + height: 50px; + background: #333; + width: 100%; + left: 0px; +} + +#mobile-menu, #mobile-menu-overlay { + z-index: 999; + + @media (min-width: 979px) + { + display: none !important; + } +} + + +.btn-none, +.btn-none:active, +.btn-none[disabled] { + background-color: transparent; + background-image: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} + +.btn-none { + cursor: pointer; + border-color: transparent; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.btn-none:hover, +.btn-none:focus { + text-decoration: none; + background-color: transparent; +} + +.btn-none[disabled]:hover, +.btn-none[disabled]:focus { + text-decoration: none; +} + +.btn-none { + .icon-white { + color: white; + } +} + +#mobile-menu { + #mobile-menu-btn { + color: #eee; + padding: 10px; + text-shadow: none; + } +} + +#mobile-menu-overlay { + display: none; + + background: rgba(0, 0, 0, 0.85); + position: fixed; + top: 0px; + left: 0px; + height: 100%; + width: 100%; + //margin-top: 50px; + padding-top: 20px; + opacity: 0; + + -webkit-transition: opacity 150ms ease; + -moz-transition: opacity 150ms ease; + -ms-transition: opacity 150ms ease; + -o-transition: opacity 150ms ease; + transition: opacity 150ms ease; + + &.menu-visible { + display: block; + opacity: 1; + } + + .mobile-menu-icon { + color: white; + width: 20%; + min-width: 85px; + height: auto; + text-align: center; + padding: 10px; + display: inline-block; + cursor: pointer; + -webkit-tap-highlight-color: rgba(0,0,0,0); + + -webkit-transition: margin-top 250ms ease; + -moz-transition: margin-top 250ms ease; + -ms-transition: margin-top 250ms ease; + -o-transition: margin-top 250ms ease; + transition: margin-top 250ms ease; + + margin-top: 20%; + + + &.menu-visible { + margin-top: 0%; + } + + i { + width: 100%; + } + + } } \ No newline at end of file diff --git a/public/src/forum/account.js b/public/src/forum/account.js index edc08ed60d..72f59b0cd8 100644 --- a/public/src/forum/account.js +++ b/public/src/forum/account.js @@ -1,8 +1,7 @@ (function() { var yourid = templates.get('yourid'), - theirid = templates.get('theirid'); - - var isFriend = {isFriend}; + theirid = templates.get('theirid'), + isFriend = templates.get('isFriend'); $(document).ready(function() { diff --git a/public/src/forum/footer.js b/public/src/forum/footer.js index ed92ae6aa3..35a5aa6bc8 100644 --- a/public/src/forum/footer.js +++ b/public/src/forum/footer.js @@ -13,7 +13,7 @@ socket.emit('user.latest', {}); socket.on('user.latest', function(data) { if (data.username == '') { - latest_user.innerHTML = ''; + latest_user.innerHTML = '';y } else { latest_user.innerHTML = "The most recent user to register is " + data.username + "."; } @@ -112,4 +112,9 @@ document.querySelector('.notifications a i').className = 'icon-circle active'; }); socket.emit('api:notifications.counts'); + + + require(['mobileMenu'], function(mobileMenu) { + mobileMenu.init(); + }); }()); \ No newline at end of file diff --git a/public/src/modules/mobileMenu.js b/public/src/modules/mobileMenu.js new file mode 100644 index 0000000000..7f5183348f --- /dev/null +++ b/public/src/modules/mobileMenu.js @@ -0,0 +1,81 @@ +define(function() { + var mobileMenu = {}; + + + var categories = null, + overlay = null, + menuBtn = null; + + + function loadCategories(callback) { + if (categories) { + displayCategories(); + return; + } + + jQuery.getJSON('/api/home', function(data) { + categories = data.categories; + displayCategories(); + }); + } + + + function displayCategories() { + var baseIcon = document.createElement('a'), + baseImage = document.createElement('i'), + baseName = document.createElement('span'); + + baseIcon.className = 'mobile-menu-icon'; + + for (var i=0, ii=categories.length; i + \ No newline at end of file diff --git a/public/templates/footer.tpl b/public/templates/footer.tpl index e2fdae8734..818c79482b 100644 --- a/public/templates/footer.tpl +++ b/public/templates/footer.tpl @@ -11,6 +11,9 @@ +
+ +
diff --git a/public/templates/header.tpl b/public/templates/header.tpl index 2086f7c5d2..b0cb5f4a05 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -31,7 +31,9 @@ -