style chat grid

This commit is contained in:
marlon-erler
2024-07-20 13:30:01 +02:00
parent d9f0f400f8
commit 6b269719a1
6 changed files with 79 additions and 5 deletions
+30
View File
@@ -23,6 +23,12 @@
overflow: scroll; overflow: scroll;
scroll-snap-align: center; scroll-snap-align: center;
} }
#home-page #chat-grid {
margin-top: var(--content-padding);
display: grid;
gap: var(--gap-between-tiles);
grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
}
@media (min-width: 640px) { @media (min-width: 640px) {
#home-page #overview-section { #home-page #overview-section {
width: 20rem; width: 20rem;
@@ -37,8 +43,32 @@
#home-page > div { #home-page > div {
gap: 8rem; gap: 8rem;
} }
#home-page #chat-grid {
margin-top: 3rem;
}
#home-page #overview-section { #home-page #overview-section {
width: var(--max-input-width); width: var(--max-input-width);
min-width: var(--max-input-width); min-width: var(--max-input-width);
} }
} }
/* src/View/Components/chatEntry.css */
.chat-entry {
position: relative;
display: flex;
align-items: flex-end !important;
justify-content: start;
height: 8rem;
overflow: hidden;
}
.chat-entry h2 {
margin: 0px;
}
.chat-entry .shadow {
position: absolute;
left: -15px;
bottom: -45px;
font-size: 6rem;
opacity: 0.1;
white-space: nowrap;
}
+2 -2
View File
@@ -928,7 +928,7 @@
// src/View/Components/chatEntry.tsx // src/View/Components/chatEntry.tsx
function ChatEntry(chatModel) { function ChatEntry(chatModel) {
return /* @__PURE__ */ createElement("div", { class: "tile flex-column justify-end align-start" }, /* @__PURE__ */ createElement("h2", null, chatModel.info.primaryChannel)); return /* @__PURE__ */ createElement("button", { class: "chat-entry tile" }, /* @__PURE__ */ createElement("span", { class: "shadow" }, chatModel.info.primaryChannel), /* @__PURE__ */ createElement("h2", null, chatModel.info.primaryChannel));
} }
var ChatModelToChatEntry = (chatModel) => { var ChatModelToChatEntry = (chatModel) => {
return ChatEntry(chatModel); return ChatEntry(chatModel);
@@ -1024,7 +1024,7 @@
)), /* @__PURE__ */ createElement( )), /* @__PURE__ */ createElement(
"div", "div",
{ {
class: "grid gap", id: "chat-grid",
"children:append": [chatListViewModel2.chatModels, ChatModelToChatEntry] "children:append": [chatListViewModel2.chatModels, ChatModelToChatEntry]
} }
)); ));
+28
View File
@@ -0,0 +1,28 @@
.chat-entry {
position: relative;
display: flex;
align-items: flex-end !important;
justify-content: start;
height: 8rem;
overflow: hidden;
}
.chat-entry h2 {
margin: 0px;
}
.chat-entry .shadow {
position: absolute;
left: -15px;
bottom: -45px;
font-size: 6rem;
opacity: 0.1;
white-space: nowrap;
}
+5 -2
View File
@@ -1,12 +1,15 @@
import "./chatEntry.css";
import * as React from "bloatless-react"; import * as React from "bloatless-react";
import { ChatModel } from "../../Model/chatModel"; import { ChatModel } from "../../Model/chatModel";
export function ChatEntry(chatModel: ChatModel) { export function ChatEntry(chatModel: ChatModel) {
return ( return (
<div class="tile flex-column justify-end align-start"> <button class="chat-entry tile">
<span class="shadow">{chatModel.info.primaryChannel}</span>
<h2>{chatModel.info.primaryChannel}</h2> <h2>{chatModel.info.primaryChannel}</h2>
</div> </button>
); );
} }
+13
View File
@@ -30,6 +30,15 @@
scroll-snap-align: center; scroll-snap-align: center;
} }
#home-page #chat-grid {
margin-top: var(--content-padding);
display: grid;
gap: var(--gap-between-tiles);
grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
}
@media (min-width: 640px) { @media (min-width: 640px) {
#home-page #overview-section { #home-page #overview-section {
width: 20rem; width: 20rem;
@@ -47,6 +56,10 @@
gap: 8rem; gap: 8rem;
} }
#home-page #chat-grid {
margin-top: 3rem;
}
#home-page #overview-section { #home-page #overview-section {
width: var(--max-input-width); width: var(--max-input-width);
min-width: var(--max-input-width); min-width: var(--max-input-width);
+1 -1
View File
@@ -166,7 +166,7 @@ export function HomePage(
</div> </div>
<div <div
class="grid gap" id="chat-grid"
children:append={[chatListViewModel.chatModels, ChatModelToChatEntry]} children:append={[chatListViewModel.chatModels, ChatModelToChatEntry]}
></div> ></div>
</div> </div>