Hide invites card until invite; slow pulse until handled
This commit is contained in:
parent
fdcf2a5a51
commit
ca45b90dfa
3 changed files with 19 additions and 4 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>Web OSCAR Chat</title>
|
<title>Web OSCAR Chat</title>
|
||||||
<link rel="stylesheet" href="/style.css?v=20">
|
<link rel="stylesheet" href="/style.css?v=21">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card sidebar-section">
|
<div id="invitesCard" class="card sidebar-section hidden">
|
||||||
<h2>Invites</h2>
|
<h2>Invites</h2>
|
||||||
<ul id="invites" class="list"></ul>
|
<ul id="invites" class="list"></ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -86,6 +86,6 @@
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="module" src="/app.js?v=20"></script>
|
<script type="module" src="/app.js?v=21"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -162,9 +162,15 @@ export function renderBuddies(buddies, onOpen) {
|
||||||
|
|
||||||
export function renderInvites(invites, onAccept, onIgnore) {
|
export function renderInvites(invites, onAccept, onIgnore) {
|
||||||
const list = document.getElementById('invites');
|
const list = document.getElementById('invites');
|
||||||
|
const card = document.getElementById('invitesCard');
|
||||||
if (!list) return;
|
if (!list) return;
|
||||||
clear(list);
|
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');
|
const li = document.createElement('li');
|
||||||
li.className = 'invite';
|
li.className = 'invite';
|
||||||
const title = document.createElement('div');
|
const title = document.createElement('div');
|
||||||
|
|
|
||||||
|
|
@ -263,3 +263,12 @@ main { padding: 1rem; max-width: 1600px; margin: 0 auto; }
|
||||||
.sidebar { order: 2; overflow: visible; }
|
.sidebar { order: 2; overflow: visible; }
|
||||||
.chat-panel { min-height: 55vh; height: 70vh; }
|
.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); }
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue