diff --git a/frontend/src/components/Chat.vue b/frontend/src/components/Chat.vue index 2e402ac..fc99835 100644 --- a/frontend/src/components/Chat.vue +++ b/frontend/src/components/Chat.vue @@ -1,21 +1,30 @@ @@ -34,9 +43,11 @@ export default { }, data: () => ({ messages: [], + toasts: [], text: '', spectators: 0, commands: [{cmd:'/debug', help:'Toggles the debug mode'}], + collapsed: false, }), computed: { commandSuggestion() { @@ -97,6 +108,10 @@ export default { } else { // a chat message (new Audio(message_sfx)).play(); this.messages.push(msg); + if (this.collapsed || window.innerWidth < 1000) { + this.toasts.push(msg); + setTimeout(() => this.toasts.shift(), 5000); + } } let container = this.$el.querySelector("#chatbox"); container.scrollTop = container.scrollHeight; @@ -151,7 +166,7 @@ input { .std-text { color: var(--font-color); } -.chat { +.chat, .cont { display: flex; flex-direction: column; } @@ -169,7 +184,10 @@ input { transform: translateX(30px); } @media only screen and (min-width:1000px) { - .chat { + .chat-header { + margin-left: 10pt; + } + .chat, .cont { height: 90vh; margin-left: 10pt; } @@ -178,6 +196,12 @@ input { margin-right: -5pt; } } +#toast-chatbox { + position: fixed; + bottom: 30pt; + left: 0; + background: #ffffffcf; +} @media only screen and (max-width:1000px) { #msg-form { flex-direction: column;