refactor: change the client from table to flexbox

this makes the server, channel, and member list a constant size, making the text messages take up the entire remaining width
this also fixes the text wrapping you have already fixed on one of your branches

this change is required if we want to make the member list toggelable, or channel list resizable
This commit is contained in:
Twig 2025-07-09 00:25:52 +02:00
parent 13971eff94
commit 9c08db29d5
No known key found for this signature in database
3 changed files with 46 additions and 58 deletions

View file

@ -30,7 +30,7 @@ const isCurrentChannel = props.uuid == props.currentUuid;
.channel-list-link-container { .channel-list-link-container {
text-align: left; text-align: left;
display: flex; display: flex;
height: 4dvh; height: 1.5em;
white-space: nowrap; white-space: nowrap;
align-items: center; align-items: center;
} }

View file

@ -8,6 +8,7 @@
</marquee> </marquee>
</div> </div>
</div> </div>
<div id = "page-content">
<div id="left-column"> <div id="left-column">
<NuxtLink id="home-button" href="/"> <NuxtLink id="home-button" href="/">
<img class="sidebar-icon" src="/public/icon.svg"/> <img class="sidebar-icon" src="/public/icon.svg"/>
@ -24,6 +25,7 @@
</div> </div>
<slot /> <slot />
</div> </div>
</div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -36,11 +38,10 @@ const guilds: GuildResponse[] | undefined = await fetchWithApi("/me/guilds");
<style> <style>
#client-root { #client-root {
/* border: 1px solid white; */
height: 100dvh; height: 100dvh;
display: grid; width: 100dvw;
grid-template-columns: 1fr 4fr 18fr 4fr; display: flex;
grid-template-rows: 4dvh auto; flex-direction: column;
text-align: center; text-align: center;
} }
@ -50,17 +51,17 @@ const guilds: GuildResponse[] | undefined = await fetchWithApi("/me/guilds");
.visible { .visible {
opacity: 100%; opacity: 100%;
transition-duration: 500ms; transition: opacity 500ms;
} }
#homebar { #homebar {
grid-row: 1; min-height: 4dvh;
grid-column: 1 / -1;
display: flex; display: flex;
justify-content: space-evenly; justify-content: space-evenly;
align-items: center; align-items: center;
background: var(--optional-topbar-background); background: var(--optional-topbar-background);
background-color: var(--topbar-background-color); background-color: var(--topbar-background-color);
border-bottom: 1px solid var(--padding-color);
padding-left: 5dvw; padding-left: 5dvw;
padding-right: 5dvw; padding-right: 5dvw;
@ -70,32 +71,11 @@ const guilds: GuildResponse[] | undefined = await fetchWithApi("/me/guilds");
width: 100dvw; width: 100dvw;
} }
#client-root>div:nth-child(-n+4) { #page-content {
border-bottom: 1px solid var(--padding-color);
}
#__nuxt {
display: flex; display: flex;
flex-flow: column; flex-direction: row;
} flex-grow: 1;
overflow: auto;
.grid-column {
padding-top: 1dvh;
}
#home {
padding-left: .5dvw;
padding-right: .5dvw;
}
.sidebar-icon {
width: 3rem;
height: 3rem;
}
#current-info {
grid-column: 2;
grid-row: 1;
} }
#left-column { #left-column {
@ -110,10 +90,25 @@ const guilds: GuildResponse[] | undefined = await fetchWithApi("/me/guilds");
padding-top: 1.5dvh; padding-top: 1.5dvh;
} }
#servers-list {
display: flex;
flex-direction: column;
gap: 1dvh;
width: 3.2rem;
}
#middle-left-column { #middle-left-column {
padding-left: 1dvw; padding-left: 1dvw;
padding-right: 1dvw; padding-right: 1dvw;
border-right: 1px solid var(--padding-color); border-right: 1px solid var(--padding-color);
min-width: 10rem;
overflow-y: scroll;
overflow-x: hidden;
}
.sidebar-icon {
width: 3rem;
height: 3rem;
} }
#home-button { #home-button {
@ -126,10 +121,4 @@ const guilds: GuildResponse[] | undefined = await fetchWithApi("/me/guilds");
bottom: .25dvh bottom: .25dvh
} }
#servers-list {
display: flex;
flex-direction: column;
gap: 1dvh;
}
</style> </style>

View file

@ -91,9 +91,8 @@ function handleMemberClick(member: GuildMemberResponse) {
} }
#members-container { #members-container {
padding-top: 1dvh; min-width: 12rem;
padding-left: 1dvw; padding-top: 1em;
padding-right: 1dvw;
border-left: 1px solid var(--padding-color); border-left: 1px solid var(--padding-color);
background: var(--optional-member-list-background); background: var(--optional-member-list-background);
} }
@ -103,14 +102,14 @@ function handleMemberClick(member: GuildMemberResponse) {
flex-direction: column; flex-direction: column;
overflow-y: scroll; overflow-y: scroll;
max-height: 92dvh; max-height: 92dvh;
padding-left: 1dvw; padding-left: 1.3em;
padding-right: 1dvw; padding-right: 1.3em;
margin-top: 1dvh; margin-top: 1dvh;
} }
.member-item { .member-item {
display: grid; display: grid;
grid-template-columns: 2dvw 1fr; grid-template-columns: 1.5em 1fr;
margin-top: .5em; margin-top: .5em;
margin-bottom: .5em; margin-bottom: .5em;
gap: 1em; gap: 1em;
@ -122,7 +121,7 @@ function handleMemberClick(member: GuildMemberResponse) {
#channels-list { #channels-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1dvh; gap: .5em;
} }
.member-avatar { .member-avatar {