diff --git a/website/public/js/admin.js b/website/public/js/admin.js index 140c99a..36347c2 100644 --- a/website/public/js/admin.js +++ b/website/public/js/admin.js @@ -60,7 +60,6 @@ function adminSearch() { "API/adminSearchUsers.php", $("#admin-searchform").serialize() ).done(function (data) { - console.log(data); $("#usertable").html(data); }) } diff --git a/website/public/js/chat.js b/website/public/js/chat.js index 014d723..e35f85c 100644 --- a/website/public/js/chat.js +++ b/website/public/js/chat.js @@ -54,16 +54,25 @@ function addMessages(messages) { type = "chat-message-other"; } if (i == 0) { + if (thisDate > previousDate) { + previousDate = thisDate; + messagesText += '\ +
\ +
\ + ' + days[thisDate.getDay()] + " " + thisDate.getDate() + " " + months[thisDate.getMonth()] + " " + thisDate.getFullYear() + '\ +
\ +
'; + } messagesText += '
'; } else if (type != previousType || thisTime != previousTime || thisDate > previousDate) { messagesText += '
\ ' + thisTime + '\
'; - previousDate = thisDate; previousTime = thisTime; previousType = type; if (thisDate > previousDate) { + previousDate = thisDate; messagesText += '\
\
\ diff --git a/website/public/js/friendButtons.js b/website/public/js/friendButtons.js index d62e919..47c476a 100644 --- a/website/public/js/friendButtons.js +++ b/website/public/js/friendButtons.js @@ -48,9 +48,6 @@ function placeFriendButtons() { text2 = "Weiger"; icon2 = "fa-times"; break; - default: - console.log(friendshipStatus); - break; } $buttonContainer.append( diff --git a/website/public/js/header.js b/website/public/js/header.js index bdf5fe3..13e3e12 100644 --- a/website/public/js/header.js +++ b/website/public/js/header.js @@ -1,25 +1,37 @@ $(document).ready(function() { // Toggle menu $("#own-profile-picture, #open-notifications").click(function() { - if ($("#notification-center").css('right') == "-256px") { - // Make the menu visible and move the content to the left. - $("#chat-history").width("calc(100% - 587px)"); - $(".modal").width("calc(100% - 512px)"); - $(".content").css("margin-right", "256px"); - $("#notification-center").css("right", "0px"); + if ($("#notification-center").css('display') == "none") { + // Make the menu visible and move the content to the left. + $(".modal").width("calc(100% - 512px)"); + $(".content").css("margin-right", "256px"); + $("#notification-center").css("right", "0px"); + $("#notification-center").css("display", "block"); + $("#contact-menu").css("display", "block"); - // Add cookie so the menu stays open on other pages - document.cookie = "menu=open; path=/"; - } else { - // Make the menu invisible and move the content to the right. - $("#chat-history").width("calc(100% - 331px)"); - $(".modal").width("calc(100% - 256px)"); - $(".content").css("margin-right", "0px"); - $("#notification-center").css("right", "-256px"); + // Add cookie so the menu stays open on other pages + if (window.innerWidth > 1080) { + $("#chat-history").width("calc(100% - 587px)"); + document.cookie = "menu=open; path=/"; + } else { + document.cookie = "menu=closed; path=/"; + } + } else { + $(".modal").width("calc(100% - 256px)"); + $(".content").css("margin-right", "0px"); + $("#notification-center").css("display", "none"); - // Change menu cookie to close - document.cookie = "menu=closed; path=/"; - } + if (window.innerWidth > 1080) { + $("#chat-history").width("calc(100% - 331px)"); + } else { + // Make the menu invisible and move the content to the right. + $("#contact-menu").css("display", "none"); + } + + // Change menu cookie to close + document.cookie = "menu=closed; path=/"; + + } }); if (getCookie("menu") == "open") { diff --git a/website/public/styles/chat.css b/website/public/styles/chat.css index 47b0639..cb0f19f 100644 --- a/website/public/styles/chat.css +++ b/website/public/styles/chat.css @@ -144,4 +144,22 @@ body { .chat-message-other .chat-time { text-align: right; +} + +@media only screen and (max-width: 1080px) { + .chat-message-self, .chat-message-other { + max-width: 75%; + } + .chat { + left: 0; + width: 100%; + } + #chat-recent-panel { + left: 0; + width: 320px; + } + #chat-history { + left: 50%; + width: calc(100% - 390px); + } } \ No newline at end of file diff --git a/website/public/styles/header.css b/website/public/styles/header.css index 70e8c80..61727eb 100644 --- a/website/public/styles/header.css +++ b/website/public/styles/header.css @@ -26,7 +26,8 @@ header { } #header-search { - padding-left: 42px; + margin: 24px 0 24px 32px; + vertical-align: middle; } @@ -49,4 +50,10 @@ header div { #open-notifications { padding: 5px 20px 5px 0px; +} + +@media only screen and (max-width: 1080px) { + #header-logo { + display: none; + } } \ No newline at end of file diff --git a/website/public/styles/main.css b/website/public/styles/main.css index abb1604..baff345 100644 --- a/website/public/styles/main.css +++ b/website/public/styles/main.css @@ -293,4 +293,14 @@ div[data-title]:hover:after { -webkit-border-radius: 20px; border-radius: 20px; background: #4CAF50; +} + +@media only screen and (max-width: 1080px) { + body { + font-size: 28px!important; + } + button { + font-size: 28px; + } + } \ No newline at end of file diff --git a/website/public/styles/menu.css b/website/public/styles/menu.css index 303b9bc..a862d12 100644 --- a/website/public/styles/menu.css +++ b/website/public/styles/menu.css @@ -86,4 +86,18 @@ height: 100%; padding: 0; text-align: left; +} + +@media only screen and (max-width: 1080px) { + #contact-menu, #notification-center { + display: none; + background: rgba(0, 0, 0, 0.4); + width: calc(50% - 20px); + } + .content { + margin-left: 0; + } + #quick-links i { + font-size: 48px!important; + } } \ No newline at end of file diff --git a/website/public/styles/mobilefriendly.css b/website/public/styles/mobilefriendly.css new file mode 100644 index 0000000..86ffab8 --- /dev/null +++ b/website/public/styles/mobilefriendly.css @@ -0,0 +1,47 @@ +/* MAIN */ +body { + font-size: 28px!important; +} +button { + font-size: 28px; +} + +/* HEADER */ +#header-logo { + display: none; +} + +/* PROFILE */ +.post-box { + width: calc(100% - 65px); +} + +/* MENU */ +#contact-menu, #notification-center { + display: none; + background: rgba(0, 0, 0, 0.4); + width: calc(50% - 20px); +} +.content { + margin-left: 0; +} +#quick-links i { + font-size: 48px!important; +} + +/* CHAT */ +.chat-message-self, .chat-message-other { + max-width: 75%; +} +.chat { + left: 0; + width: 100%; +} +#chat-recent-panel { + left: 0; + width: 320px; +} +#chat-history { + left: 50%; + width: calc(100% - 390px); +} \ No newline at end of file diff --git a/website/public/styles/profile.css b/website/public/styles/profile.css index 03ab19f..37aaaa1 100644 --- a/website/public/styles/profile.css +++ b/website/public/styles/profile.css @@ -116,7 +116,7 @@ div.posts .post form textarea.newpost { } /* mobile */ -@media only screen and (max-width: 1000px) { +@media only screen and (max-width: 1080px) { .post-box { width: calc(100% - 65px); } diff --git a/website/views/head.php b/website/views/head.php index eb86d56..6e8ca0a 100644 --- a/website/views/head.php +++ b/website/views/head.php @@ -12,6 +12,8 @@ @import url("styles/header.css"); @import url("styles/menu.css"); @import url("styles/footer.css"); + + @import url("styles/mobilefriendly.css") screen and (orientation: portrait); +