From 610fd74e89b4111179b75ee26865dde5679837d1 Mon Sep 17 00:00:00 2001 From: eiiko6 Date: Mon, 29 Dec 2025 10:47:36 +0100 Subject: [PATCH] improved mobile layout --- src/App.vue | 5 +-- src/api/client.ts | 2 +- src/api/friends.ts | 2 +- src/api/messages.ts | 2 +- src/api/rooms.ts | 2 +- src/base.css | 26 +++++++++++++++ src/components/ChatWindow.vue | 4 ++- src/components/CreateRoomModal.vue | 2 +- src/components/MessageList.vue | 2 +- src/components/Navbar.vue | 24 ++++++++------ src/components/RoomList.vue | 10 ++++-- src/main.ts | 8 ++--- src/pages/ChatPage.vue | 14 +++++--- src/pages/FriendListPage.vue | 2 +- src/pages/LoginPage.vue | 2 +- src/router.ts | 52 ++++++++++++++++++++++++++++++ src/router/index.ts | 40 ----------------------- src/{stores/auth.ts => store.ts} | 18 +++++++++-- src/{types/api.ts => types.ts} | 0 19 files changed, 144 insertions(+), 73 deletions(-) create mode 100644 src/router.ts delete mode 100644 src/router/index.ts rename src/{stores/auth.ts => store.ts} (75%) rename src/{types/api.ts => types.ts} (100%) diff --git a/src/App.vue b/src/App.vue index a8e8a5f..0eecf19 100644 --- a/src/App.vue +++ b/src/App.vue @@ -42,11 +42,12 @@ footer { @media (max-width: 720px) { #content { - padding: 1.2rem; + padding: 12px; + padding-top: 30px; } footer { - padding-bottom: 16px; + padding-bottom: 56px; } } diff --git a/src/api/client.ts b/src/api/client.ts index 51776dc..9ff4a9c 100644 --- a/src/api/client.ts +++ b/src/api/client.ts @@ -1,4 +1,4 @@ -import { initAuth, logout } from '../stores/auth.ts' +import { initAuth, logout } from '../store.ts' import { API } from '../main.ts' import router from '../router' diff --git a/src/api/friends.ts b/src/api/friends.ts index 9917ef9..b976343 100644 --- a/src/api/friends.ts +++ b/src/api/friends.ts @@ -1,5 +1,5 @@ import { apiFetch } from './client' -import type { Friend, FriendRequest } from '../types/api' +import type { Friend, FriendRequest } from '../api' export function fetchFriends() { return apiFetch('/friends') diff --git a/src/api/messages.ts b/src/api/messages.ts index 9abb18a..27549a9 100644 --- a/src/api/messages.ts +++ b/src/api/messages.ts @@ -1,5 +1,5 @@ import { apiFetch } from './client' -import type { Message } from '../types/api' +import type { Message } from '../api' export function fetchMessages(roomUuid: string) { return apiFetch(`/messages/${roomUuid}`) diff --git a/src/api/rooms.ts b/src/api/rooms.ts index 05db338..aaa3d31 100644 --- a/src/api/rooms.ts +++ b/src/api/rooms.ts @@ -1,5 +1,5 @@ import { apiFetch } from './client' -import type { Room } from '../types/api' +import type { Room } from '../api' export function fetchRooms(userUuid: string) { return apiFetch(`/rooms/${userUuid}`) diff --git a/src/base.css b/src/base.css index 41a41f6..291fbe1 100644 --- a/src/base.css +++ b/src/base.css @@ -150,3 +150,29 @@ i:hover { .btn { outline: none; } + +@media (hover: hover) { + i:hover { + color: var(--text); + } + + button:hover, .button:hover { + background: var(--accent-hover); + } + + input[type="checkbox"]:hover { + border-color: var(--accent); + } + + ::-webkit-scrollbar-thumb:hover { + filter: brightness(1.2); + } +} + +button:active, .nav-item:active { + opacity: 0.7; +} + +* { + -webkit-tap-highlight-color: transparent; +} diff --git a/src/components/ChatWindow.vue b/src/components/ChatWindow.vue index d5d2c5b..e05f18a 100644 --- a/src/components/ChatWindow.vue +++ b/src/components/ChatWindow.vue @@ -21,7 +21,7 @@ diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index 0e932b9..c74e23a 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -18,7 +18,7 @@ diff --git a/src/pages/FriendListPage.vue b/src/pages/FriendListPage.vue index b414a0d..70ae9bb 100644 --- a/src/pages/FriendListPage.vue +++ b/src/pages/FriendListPage.vue @@ -43,7 +43,7 @@