Compact chat view and unify header controls
This commit is contained in:
+29
-11
@@ -15,14 +15,22 @@
|
||||
.conversation-copy strong, .conversation-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.conversation-copy span { margin-top: 3px; color: var(--muted); font-size: .9rem; }
|
||||
.unread-badge { min-width: 26px; padding: 3px 7px; color: #fff; background: #b91c1c; border-radius: 999px; text-align: center; font-weight: 800; }
|
||||
.chat-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
|
||||
.chat-header h1 { margin: 0; }
|
||||
.chat-log { display: flex; flex-direction: column; gap: 9px; min-height: 260px; padding: 18px; background: #090909; border: 1px solid var(--border); border-radius: 15px; }
|
||||
body.chat-page { display: flex; flex-direction: column; width: 100%; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
|
||||
body.chat-page > header { position: relative; flex: 0 0 auto; }
|
||||
.chat-main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px; flex: 1 1 auto; width: 100%; min-height: 0; overflow: hidden; padding: 8px 20px max(8px, env(safe-area-inset-bottom)); }
|
||||
.chat-header { display: flex; align-items: center; min-width: 0; gap: 9px; margin: 0; }
|
||||
.chat-header h1 { overflow: hidden; margin: 0; font-size: 1.05rem; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.chat-partner-copy { min-width: 0; flex: 1 1 auto; }
|
||||
.chat-partner-copy a { display: block; overflow: hidden; color: var(--muted); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.chat-header .chat-avatar { width: 38px; height: 38px; flex-basis: 38px; }
|
||||
.chat-back { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; }
|
||||
.chat-log { display: flex; flex-direction: column; gap: 9px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px; background: #090909; border: 1px solid var(--border); border-radius: 15px; }
|
||||
.chat-bubble { align-self: flex-start; max-width: min(76%, 650px); padding: 10px 13px; background: #262020; border-radius: 4px 13px 13px 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
|
||||
.chat-bubble.mine { align-self: flex-end; background: #5f1515; border-radius: 13px 4px 13px 13px; }
|
||||
.chat-time { display: block; margin-top: 5px; color: #a8a29e; font-size: .72rem; }
|
||||
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 12px; max-width: none; }
|
||||
.chat-form textarea { min-height: 76px; margin: 0; resize: vertical; }
|
||||
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; margin: 0; max-width: none; }
|
||||
.chat-form textarea { height: 46px; min-height: 46px; max-height: 96px; margin: 0; overflow-y: auto; resize: none; }
|
||||
.chat-form .button { min-height: 44px; }
|
||||
.empty-chat { color: var(--muted); text-align: center; margin: auto; }
|
||||
.message-notifications { margin-bottom: 24px; padding: 16px; background: rgba(69,10,10,.45); border: 1px solid #7f1d1d; border-radius: 14px; }
|
||||
.message-notifications h2, .conversation-heading { margin: 0 0 12px; font-size: 1.15rem; }
|
||||
@@ -36,18 +44,25 @@
|
||||
.notification-actions .button { padding: 7px 10px; font-size: .82rem; }
|
||||
.notification-link { color: #fca5a5; white-space: nowrap; }
|
||||
.conversation-heading { margin-top: 20px; }
|
||||
@media (max-width: 600px) { .chat-form { grid-template-columns: 1fr; } .chat-bubble { max-width: 90%; } }
|
||||
@media (max-width: 600px) {
|
||||
.chat-main { padding: 6px 12px max(6px, env(safe-area-inset-bottom)); }
|
||||
.chat-log { padding: 10px; }
|
||||
.chat-form { grid-template-columns: minmax(0, 1fr) auto; }
|
||||
.chat-form textarea { width: 100%; }
|
||||
.chat-bubble { max-width: 90%; }
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="/static/css/language.css">
|
||||
</head>
|
||||
<body>
|
||||
<header><div class="header-inner"><a href="/" class="logo"><img class="brand-logo" src="/static/images/metalcircle-full.png" alt="MetalCircle"></a>{% include '_user_menu.html' %}</div> {% include '_language_switch.html' %}
|
||||
<body class="{% if partner %}chat-page{% endif %}">
|
||||
<header><div class="header-inner"><a href="/" class="logo"><img class="brand-logo" src="/static/images/metalcircle-full.png" alt="MetalCircle"></a>{% include '_header_controls.html' %}</div>
|
||||
</header>
|
||||
<main>
|
||||
<main class="{% if partner %}chat-main{% endif %}">
|
||||
{% if partner %}
|
||||
<div class="chat-header">
|
||||
{% if partner.avatar_path %}<img class="chat-avatar" src="{{ partner.avatar_path }}" alt="">{% else %}<span class="chat-avatar">{{ partner.display_name[:1] }}</span>{% endif %}
|
||||
<div><h1>{{ partner.display_name }}</h1><a href="/users/{{ partner.username }}">@{{ partner.username }}</a></div>
|
||||
<div class="chat-partner-copy"><h1>{{ partner.display_name }}</h1><a href="/users/{{ partner.username }}">@{{ partner.username }}</a></div>
|
||||
<a class="button button-secondary chat-back" href="/messages" aria-label="{{ _('← Alle Nachrichten') }}" title="{{ _('← Alle Nachrichten') }}">←</a>
|
||||
</div>
|
||||
<div class="chat-log">
|
||||
{% for message in messages %}<div class="chat-bubble{% if message.from_me %} mine{% endif %}"{% if loop.last %} id="latest"{% endif %}>{{ message.body }}<span class="chat-time">{{ message.created_at }}</span></div>
|
||||
@@ -57,7 +72,6 @@
|
||||
<textarea name="body" maxlength="2000" required placeholder="{{ _('Nachricht schreiben …') }}" aria-label="{{ _('Nachricht') }}"></textarea>
|
||||
<button class="button" type="submit">{{ _('Senden') }}</button>
|
||||
</form>
|
||||
<p><a class="button button-secondary" href="/messages">{{ _('← Alle Nachrichten') }}</a></p>
|
||||
{% else %}
|
||||
<div class="page-title"><h1>{{ _('🤘 Nachrichten') }}</h1><p>{{ _('Private Chats mit deinen Freunden.') }}</p></div>
|
||||
{% if friend_requests or event_invitations %}
|
||||
@@ -91,5 +105,9 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
</main>
|
||||
{% if partner %}<script>
|
||||
const chatLog = document.querySelector('.chat-log');
|
||||
if (chatLog) chatLog.scrollTop = chatLog.scrollHeight;
|
||||
</script>{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user