improve home page layout
This commit is contained in:
+26
-33
@@ -1,15 +1,27 @@
|
|||||||
|
#home-page {
|
||||||
|
overflow: auto;
|
||||||
|
padding: var(--content-padding);
|
||||||
|
|
||||||
|
min-width: unset;
|
||||||
|
max-width: 1000px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#home-page > h1 {
|
||||||
|
font-size: 3rem;
|
||||||
|
font-family: IBM Plex Sans Thin;
|
||||||
|
}
|
||||||
|
|
||||||
#home-page > div {
|
#home-page > div {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
flex-wrap: wrap;
|
||||||
gap: var(--large-gap);
|
|
||||||
|
|
||||||
scroll-snap-type: x mandatory;
|
|
||||||
scroll-behavior: smooth;
|
|
||||||
overflow: hidden;
|
|
||||||
overflow-x: scroll;
|
|
||||||
|
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
|
|
||||||
|
height: auto;
|
||||||
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
#home-page > div > div {
|
#home-page > div > div {
|
||||||
@@ -18,22 +30,9 @@
|
|||||||
justify-content: start;
|
justify-content: start;
|
||||||
|
|
||||||
gap: var(--gap-between-tiles);
|
gap: var(--gap-between-tiles);
|
||||||
padding: var(--content-padding);
|
|
||||||
padding-top: calc(var(--header-height) + var(--content-margin));
|
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-width: 100%;
|
min-width: 100%;
|
||||||
height: 100%;
|
|
||||||
overflow-y: auto;
|
|
||||||
|
|
||||||
scroll-snap-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
#home-page #overview-section,
|
|
||||||
#home-page #chat-section {
|
|
||||||
padding-bottom: calc(
|
|
||||||
var(--content-padding) + var(--header-height) + var(--safe-area-bottom)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#home-page #chat-grid {
|
#home-page #chat-grid {
|
||||||
@@ -47,7 +46,7 @@
|
|||||||
|
|
||||||
@media (min-width: 640px) {
|
@media (min-width: 640px) {
|
||||||
#home-page > div {
|
#home-page > div {
|
||||||
overflow-x: hidden;
|
gap: var(--content-padding);
|
||||||
}
|
}
|
||||||
|
|
||||||
#home-page #overview-section {
|
#home-page #overview-section {
|
||||||
@@ -61,19 +60,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 1200px) {
|
@media (min-width: 1000px) {
|
||||||
#home-page #overview-section,
|
#home-page > div {
|
||||||
#home-page #chat-section {
|
gap: var(--large-gap);
|
||||||
padding-left: 3rem;
|
|
||||||
padding-right: 3rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#home-page #chat-grid {
|
#home-page > h1 {
|
||||||
margin-top: 3rem;
|
padding-top: 3rem;
|
||||||
}
|
padding-bottom: 1rem;
|
||||||
|
|
||||||
#home-page #overview-section {
|
|
||||||
width: var(--max-input-width);
|
|
||||||
min-width: var(--max-input-width);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-23
@@ -18,11 +18,11 @@ export function HomePage(
|
|||||||
fileTransferViewModel: FileTransferViewModel,
|
fileTransferViewModel: FileTransferViewModel,
|
||||||
chatListViewModel: ChatListViewModel,
|
chatListViewModel: ChatListViewModel,
|
||||||
) {
|
) {
|
||||||
|
const greeting = React.createProxyState([settingsViewModel.username], ()=>coreViewModel.translations.homePage.greeting(settingsViewModel.username.value));
|
||||||
|
|
||||||
// sections
|
// sections
|
||||||
const overviewSection = (
|
const overviewSection = (
|
||||||
<div id="overview-section">
|
<div id="overview-section">
|
||||||
<h2>{coreViewModel.translations.homePage.overviewHeadline}</h2>
|
|
||||||
|
|
||||||
<label class="tile flex-no">
|
<label class="tile flex-no">
|
||||||
<span class="icon">cell_tower</span>
|
<span class="icon">cell_tower</span>
|
||||||
<div>
|
<div>
|
||||||
@@ -116,24 +116,13 @@ export function HomePage(
|
|||||||
<span subscribe:innerText={coreViewModel.updateText}></span>
|
<span subscribe:innerText={coreViewModel.updateText}></span>
|
||||||
<span class="icon">update</span>
|
<span class="icon">update</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="mobile-only">
|
<hr class="mobile-only"></hr>
|
||||||
<hr></hr>
|
|
||||||
|
|
||||||
<div class="flex-row justify-end">
|
|
||||||
<button class="ghost width-50" on:click={scrollToChat}>
|
|
||||||
{coreViewModel.translations.homePage.scrollToChatButton}
|
|
||||||
<span class="icon">arrow_forward</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
const chatSection = (
|
const chatSection = (
|
||||||
<div id="chat-section">
|
<div id="chat-section">
|
||||||
<h2>{coreViewModel.translations.homePage.chatsHeadline}</h2>
|
|
||||||
|
|
||||||
<div class="flex-row width-input">
|
<div class="flex-row width-input">
|
||||||
<input
|
<input
|
||||||
placeholder={
|
placeholder={
|
||||||
@@ -155,7 +144,9 @@ export function HomePage(
|
|||||||
>
|
>
|
||||||
<span class="icon">add</span>
|
<span class="icon">add</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<hr></hr>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
id="chat-grid"
|
id="chat-grid"
|
||||||
@@ -163,18 +154,14 @@ export function HomePage(
|
|||||||
chatListViewModel.chatViewModels,
|
chatListViewModel.chatViewModels,
|
||||||
ChatViewModelToChatEntry,
|
ChatViewModelToChatEntry,
|
||||||
]}
|
]}
|
||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
// methods
|
|
||||||
function scrollToChat() {
|
|
||||||
chatSection.scrollIntoView();
|
|
||||||
}
|
|
||||||
|
|
||||||
// final
|
// final
|
||||||
return (
|
return (
|
||||||
<article id="home-page">
|
<article id="home-page">
|
||||||
|
<h1 subscribe:innerText={greeting}></h1>
|
||||||
<div>
|
<div>
|
||||||
{overviewSection}
|
{overviewSection}
|
||||||
{chatSection}
|
{chatSection}
|
||||||
|
|||||||
+554
-572
File diff suppressed because it is too large
Load Diff
+2
-3
@@ -9,9 +9,8 @@
|
|||||||
/* Gradient */
|
/* Gradient */
|
||||||
#background-wrapper {
|
#background-wrapper {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset: 0px;
|
inset: -80px;
|
||||||
|
|
||||||
transform: scale(1.2);
|
|
||||||
filter: blur(40px);
|
filter: blur(40px);
|
||||||
|
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
@@ -144,6 +143,6 @@ body[theme="dark"] #background-wrapper #grass-2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
body[keystroke-active] [ctkeystroke]::after {
|
body[keystroke-active] [ctkeystroke]::after {
|
||||||
opacity: 1;
|
opacity: .7;
|
||||||
transform: translateY(0px);
|
transform: translateY(0px);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user