Hide invites card until invite; slow pulse until handled

This commit is contained in:
Clay 2026-12-02 23:21:03 -05:00
parent fdcf2a5a51
commit ca45b90dfa
3 changed files with 19 additions and 4 deletions

View file

@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Web OSCAR Chat</title>
<link rel="stylesheet" href="/style.css?v=20">
<link rel="stylesheet" href="/style.css?v=21">
</head>
<body>
<div id="app">
@ -50,7 +50,7 @@
</form>
</div>
<div class="card sidebar-section">
<div id="invitesCard" class="card sidebar-section hidden">
<h2>Invites</h2>
<ul id="invites" class="list"></ul>
</div>
@ -86,6 +86,6 @@
</main>
</div>
<script type="module" src="/app.js?v=20"></script>
<script type="module" src="/app.js?v=21"></script>
</body>
</html>

View file

@ -162,9 +162,15 @@ export function renderBuddies(buddies, onOpen) {
export function renderInvites(invites, onAccept, onIgnore) {
const list = document.getElementById('invites');
const card = document.getElementById('invitesCard');
if (!list) return;
clear(list);
for (const inv of invites || []) {
const items = invites || [];
if (card) {
card.classList.toggle('hidden', items.length === 0);
card.classList.toggle('invite-attention', items.length > 0);
}
for (const inv of items) {
const li = document.createElement('li');
li.className = 'invite';
const title = document.createElement('div');

View file

@ -263,3 +263,12 @@ main { padding: 1rem; max-width: 1600px; margin: 0 auto; }
.sidebar { order: 2; overflow: visible; }
.chat-panel { min-height: 55vh; height: 70vh; }
}
#invitesCard.invite-attention {
animation: invite-pulse 2.4s ease-in-out infinite;
border-color: rgba(255, 209, 102, 0.7);
}
@keyframes invite-pulse {
0%, 100% { box-shadow: 0 0 0 rgba(255, 209, 102, 0); border-color: rgba(255, 209, 102, 0.35); }
50% { box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.12), 0 0 18px rgba(255, 209, 102, 0.18); border-color: rgba(255, 209, 102, 0.9); }
}