Lazy-load chat images; scroll to bottom on incoming message only when user has not scrolled up.

This commit is contained in:
天クマ 2026-07-17 15:22:26 -03:00
commit cad283e06b
3 changed files with 123 additions and 60 deletions

View file

@ -45,8 +45,8 @@ body {
background-color: var(--bg-main);
color: var(--text-primary);
background-image:
radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.12) 0px, transparent 50%);
radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.12) 0px, transparent 50%);
}
a {
@ -222,6 +222,7 @@ input:focus {
border: none;
font-size: 0.9rem;
transition: all 0.25s ease;
background-color: var(--bg-secondary);
}
#chat-search:focus {
@ -281,6 +282,9 @@ input:focus {
.chat-item:hover {
background: rgba(255, 255, 255, 0.04);
transform: scale(0.98) skewX(10deg);
filter: blur(.1px);
opacity: .6;
}
.chat-item-info {
@ -470,14 +474,46 @@ input:focus {
height: 100%;
position: relative;
overflow: hidden;
z-index: 0;
}
.active-chat-container::before {
content: "";
position: absolute;
inset: 0;
background-image: var(--background-image);
background-size: cover;
background-position: center;
background-repeat: no-repeat;
opacity: 0.4;
pointer-events: none;
z-index: 0;
}
.active-chat-container > * {
position: relative;
z-index: 1;
}
.chat-header {
padding: 16px 24px;
padding: .6em 1em;
display: flex;
justify-content: space-between;
align-items: center;
background: var(--bg-main);
position: relative;
}
.chat-header::before {
content: "";
position: absolute;
inset: 0;
pointer-events: none;
z-index: -1;
background: linear-gradient(
to bottom,
rgba(0, 0, 0, 0.75),
rgba(0, 0, 0, 0.35),
transparent
);
}
.active-contact-info {
@ -516,14 +552,14 @@ input:focus {
.messages-container {
flex: 1;
overflow-y: auto;
padding: 24px;
padding: 1rem;
padding-bottom: .6rem;
display: flex;
flex-direction: column;
gap: 16px;
user-select: text;
background-image:
radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.03) 0%, transparent 40%),
radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.03) 0%, transparent 40%);
radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.03) 0%, transparent 40%),
radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.03) 0%, transparent 40%);
}
.load-more-btn {
@ -539,6 +575,7 @@ input:focus {
}
.message-group {
margin-top: .8em;
display: flex;
flex-direction: column;
max-width: 65%;
@ -552,11 +589,14 @@ input:focus {
align-self: flex-end;
}
.message-group.same-sender {
margin-top: .4em;
}
.message-sender {
font-size: 0.75rem;
font-weight: 600;
color: var(--text-primary);
margin-bottom: 2px;
width: 100%;
display: flex;
}
@ -570,8 +610,7 @@ input:focus {
.message-bubble {
display: flex;
flex-direction: column;
gap: .4em;
padding: 12px 16px;
padding: 8px 10px;
font-size: 0.92rem;
line-height: 1.5;
position: relative;
@ -630,6 +669,7 @@ input:focus {
display: flex;
align-items: center;
gap: 16px;
background-color: var(--bg-main);
}
.alternate-panel {
@ -825,15 +865,15 @@ input:focus {
display: flex;
margin-right: 12px;
}
.message-group {
max-width: 90%;
}
.message-image-attachement {
max-height: 20em;
}
#desktop-aside {
display: none;
}