From 0a3a8fbd71f26c5eb1ac53df314570d803ce8d5f Mon Sep 17 00:00:00 2001 From: Kuchizu Date: Wed, 23 Sep 2026 22:13:41 +0300 Subject: [PATCH 1/3] Adapt layout for mobile and tablet screens --- @codexteam/ui/src/styles/typography.pcss | 4 +-- .../ui/src/vue/components/card/Card.vue | 24 ++++++++++++++-- .../src/vue/components/card/CardSkeleton.vue | 15 ++++++++-- .../ui/src/vue/components/editor/Editor.vue | 7 +++++ .../ui/src/vue/components/input/Input.vue | 4 +++ .../ui/src/vue/components/popup/Popup.vue | 21 ++++++++++++++ @codexteam/ui/src/vue/components/row/Row.vue | 15 ++++++++++ .../ui/src/vue/components/tabbar/Tab.vue | 28 ++++++++++++++++++- .../components/vertical-menu/VerticalMenu.vue | 4 +++ .../ui/src/vue/layout/navbar/Navbar.vue | 4 +++ .../src/vue/layout/page-block/PageBlock.vue | 22 +++++++++++++++ src/App.vue | 1 + .../components/note-header/NoteHeader.vue | 15 ++++++++++ .../components/note-list/NoteList.vue | 16 ++++++++++- src/presentation/pages/AuthorizationPage.vue | 3 +- src/presentation/pages/Join.vue | 3 +- src/presentation/pages/Note.vue | 22 ++++++++++++++- src/presentation/pages/NoteSettings.vue | 4 +++ 18 files changed, 199 insertions(+), 13 deletions(-) diff --git a/@codexteam/ui/src/styles/typography.pcss b/@codexteam/ui/src/styles/typography.pcss index 195f0140..f0656d69 100644 --- a/@codexteam/ui/src/styles/typography.pcss +++ b/@codexteam/ui/src/styles/typography.pcss @@ -32,7 +32,7 @@ * Should be used only for content (user-written text), not for UI elements. */ --text-h1 { - font-size: 2.8rem; + font-size: clamp(2rem, 1.17rem + 3.17vw, 2.8rem); line-height: 110%; font-weight: 700; margin: 0; @@ -41,7 +41,7 @@ --text-h2 { font-weight: 700; line-height: 120%; - font-size: 1.8rem; + font-size: clamp(1.5rem, 1.19rem + 1.19vw, 1.8rem); } --text-h3 { diff --git a/@codexteam/ui/src/vue/components/card/Card.vue b/@codexteam/ui/src/vue/components/card/Card.vue index 93bfafb3..8e638501 100644 --- a/@codexteam/ui/src/vue/components/card/Card.vue +++ b/@codexteam/ui/src/vue/components/card/Card.vue @@ -79,8 +79,6 @@ withDefaults( diff --git a/@codexteam/ui/src/vue/components/popup/Popup.vue b/@codexteam/ui/src/vue/components/popup/Popup.vue index 2cb38604..8245b7c1 100644 --- a/@codexteam/ui/src/vue/components/popup/Popup.vue +++ b/@codexteam/ui/src/vue/components/popup/Popup.vue @@ -94,6 +94,27 @@ withDefaults( color: var(--base--text); } } + + @media (max-width: 768px) { + grid-template-columns: minmax(0, 1fr); + justify-items: center; + padding: var(--spacing-ml); + overflow-y: auto; + + &__container { + grid-column: 1; + grid-row: 2; + max-width: 100%; + box-sizing: border-box; + } + + &__icon { + grid-column: 1; + grid-row: 1; + justify-self: end; + margin: 0 0 var(--spacing-s); + } + } } diff --git a/@codexteam/ui/src/vue/components/row/Row.vue b/@codexteam/ui/src/vue/components/row/Row.vue index 1f84e7e8..54735481 100644 --- a/@codexteam/ui/src/vue/components/row/Row.vue +++ b/@codexteam/ui/src/vue/components/row/Row.vue @@ -103,6 +103,7 @@ defineProps<{ &__center { flex: 1; + min-width: 0; display: flex; flex-direction: column; gap: var(--spacing-very-x); @@ -112,5 +113,19 @@ defineProps<{ display: flex; align-items: center; } + + @media (max-width: 768px) { + &__body-inner { + flex-wrap: wrap; + } + + &__center { + flex-basis: 8rem; + } + + &__right { + margin-left: auto; + } + } } diff --git a/@codexteam/ui/src/vue/components/tabbar/Tab.vue b/@codexteam/ui/src/vue/components/tabbar/Tab.vue index 28952bc3..2533f28b 100644 --- a/@codexteam/ui/src/vue/components/tabbar/Tab.vue +++ b/@codexteam/ui/src/vue/components/tabbar/Tab.vue @@ -43,6 +43,7 @@ diff --git a/@codexteam/ui/src/vue/components/vertical-menu/VerticalMenu.vue b/@codexteam/ui/src/vue/components/vertical-menu/VerticalMenu.vue index 4c61e412..4e47dfab 100644 --- a/@codexteam/ui/src/vue/components/vertical-menu/VerticalMenu.vue +++ b/@codexteam/ui/src/vue/components/vertical-menu/VerticalMenu.vue @@ -29,5 +29,9 @@ defineProps<{ gap: var(--spacing-very-x); background-color: var(--base--bg-secondary); width: max-content; + + @media (max-width: 768px) { + width: auto; + } } diff --git a/@codexteam/ui/src/vue/layout/navbar/Navbar.vue b/@codexteam/ui/src/vue/layout/navbar/Navbar.vue index 328e1f97..54127e6b 100644 --- a/@codexteam/ui/src/vue/layout/navbar/Navbar.vue +++ b/@codexteam/ui/src/vue/layout/navbar/Navbar.vue @@ -26,5 +26,9 @@ &__right { margin-left: auto; } + + @media (max-width: 768px) { + padding: var(--spacing-ms) var(--spacing-m); + } } diff --git a/@codexteam/ui/src/vue/layout/page-block/PageBlock.vue b/@codexteam/ui/src/vue/layout/page-block/PageBlock.vue index 3d5c382f..b155cd91 100644 --- a/@codexteam/ui/src/vue/layout/page-block/PageBlock.vue +++ b/@codexteam/ui/src/vue/layout/page-block/PageBlock.vue @@ -79,4 +79,26 @@ defineProps({ padding: var(--spacing-xxl) var(--spacing-ml); } } + +@media (max-width: 1300px) { + .page-block__sidebar:empty { + display: none; + } +} + +@media (max-width: 768px) { + .page-block { + flex-direction: column; + } + + .page-block__content { + max-width: none; + padding: var(--spacing-l) var(--spacing-ml); + } + + .page-block__sidebar { + width: auto; + padding: var(--spacing-l) var(--spacing-ml) 0; + } +} diff --git a/src/App.vue b/src/App.vue index 70751eb9..9e8c495d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -46,5 +46,6 @@ body { -moz-osx-font-smoothing: grayscale; display: grid; grid-template-rows: auto 1fr; + grid-template-columns: minmax(0, 1fr); } diff --git a/src/presentation/components/note-header/NoteHeader.vue b/src/presentation/components/note-header/NoteHeader.vue index 1d26df61..631ba6e6 100644 --- a/src/presentation/components/note-header/NoteHeader.vue +++ b/src/presentation/components/note-header/NoteHeader.vue @@ -21,6 +21,7 @@ opacity: var(--opacity); transition: opacity 100ms; justify-content: space-between; + gap: var(--spacing-s); padding: var(--spacing-s) var(--spacing-m); position: sticky; top: var(--layout-navbar-height); @@ -28,11 +29,25 @@ z-index: var(--z-note-header); &__left { + flex: 1 1 0; + min-width: 0; color: var(--base--text-secondary); + + @media (max-width: 768px) { + overflow-x: auto; + white-space: nowrap; + scrollbar-width: none; + + &::-webkit-scrollbar { + display: none; + } + } } &__right { display: flex; + flex-wrap: wrap; + justify-content: flex-end; gap: var(--spacing-s); align-items: center; } diff --git a/src/presentation/components/note-list/NoteList.vue b/src/presentation/components/note-list/NoteList.vue index b70626aa..5182e6e4 100644 --- a/src/presentation/components/note-list/NoteList.vue +++ b/src/presentation/components/note-list/NoteList.vue @@ -86,12 +86,26 @@ function getSubtitle(note: Note): string | undefined { diff --git a/src/presentation/pages/Note.vue b/src/presentation/pages/Note.vue index d04c68a5..139d9887 100644 --- a/src/presentation/pages/Note.vue +++ b/src/presentation/pages/Note.vue @@ -44,7 +44,10 @@
-