diff --git a/index.html b/index.html index f8f1c52..53e44d2 100644 --- a/index.html +++ b/index.html @@ -11,7 +11,7 @@ - + Mercury diff --git a/src/App.vue b/src/App.vue index 9afc2ae..599bd1c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,10 +11,8 @@ -
-
- -
+
+
@@ -23,12 +21,19 @@ import { onMounted, ref, watch } from 'vue' import { Modal } from 'bootstrap' import { useMercuryStore } from './stores/mercuryStore' import UserSettings from './components/userSettings/UserSettings.vue' +import { useWindowSize } from '@vueuse/core'; const mercuryStore = useMercuryStore() const configured = mercuryStore.configured() const settingsModal = ref() +const { width, height } = useWindowSize() +watch(width, () => { + mercuryStore.mobile = window.innerWidth < 768 ? true : false + mercuryStore.showSidebar = !mercuryStore.mobile +}, { immediate: true }) + onMounted(() => { const modal = new Modal(settingsModal.value) @@ -44,9 +49,39 @@ onMounted(() => { }, { immediate: true }) }) +visualViewport.addEventListener('resize', () => { + window.scrollTo(0, 0) + document.querySelector('#app').style.height = `${window.visualViewport.height}px` +}) + +document.addEventListener('gesturestart', (e) => { + e.preventDefault() +}) + +document.addEventListener('touchmove', (e) => { + e.preventDefault() +}) + \ No newline at end of file + diff --git a/src/components/common/Key.vue b/src/components/common/Key.vue index 540aa17..6db7b00 100644 --- a/src/components/common/Key.vue +++ b/src/components/common/Key.vue @@ -21,4 +21,4 @@ onBeforeRouteUpdate(() => { i { cursor: pointer; } - \ No newline at end of file + diff --git a/src/components/userlist/User.vue b/src/components/common/User.vue similarity index 97% rename from src/components/userlist/User.vue rename to src/components/common/User.vue index b2510f0..3fbd934 100644 --- a/src/components/userlist/User.vue +++ b/src/components/common/User.vue @@ -16,4 +16,4 @@ const color = computed(() => { return user.color ?? Colors.Secondary }) span:hover { color: white !important; } - \ No newline at end of file + diff --git a/src/components/Content.vue b/src/components/content/Content.vue similarity index 60% rename from src/components/Content.vue rename to src/components/content/Content.vue index bc75750..2368732 100644 --- a/src/components/Content.vue +++ b/src/components/content/Content.vue @@ -1,20 +1,23 @@ @@ -40,9 +41,9 @@ import { onBeforeRouteUpdate, useRoute } from 'vue-router' import { useChannelStore } from '../stores/channelStore' import { useMessageStore } from '../stores/messageStore' import Sidebar from '../components/sidebar/Sidebar.vue' -import Content from '../components/Content.vue' +import Content from '../components/content/Content.vue' import Key from '../components/common/Key.vue' -import UserList from '../components/userList/UserList.vue' +import UserList from '../components/sidebar/UserList.vue' import Message from '../components/conversation/Message.vue' import MessageInput from '../components/conversation/MessageInput.vue' @@ -53,14 +54,13 @@ const messageStore = useMessageStore() const channel = computed(() => { return channelStore.getChannelById(route.params.channelId) }) const messages = computed(() => { return messageStore.getMessagesByChannelId(route.params.channelId) }) -// Show the key. -const locked = ref(false) -onBeforeRouteUpdate(async (to, from) => { locked.value = false }) -const abcdef = ref(null) +// Show the key in the header. +const keyHidden = ref(false) +onBeforeRouteUpdate(async (to, from) => { keyHidden.value = false }) \ No newline at end of file + diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 485f5a2..f468574 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -4,7 +4,7 @@ - \ No newline at end of file +