Skip to content

Commit 992c21e

Browse files
committed
Emoji Panel UI Polish & Fixes
1 parent eaf5462 commit 992c21e

2 files changed

Lines changed: 26 additions & 17 deletions

File tree

src/js/picker.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ function _renderPackDetails(naddr, pack) {
876876
<div class="pack-details-title-block">
877877
<h3 class="pack-details-title">${title}</h3>
878878
<div class="pack-details-meta">
879-
<span class="emoji-count">${emojis.length}</span> emoji${emojis.length === 1 ? '' : 's'}
879+
<span class="emoji-count">${emojis.length}</span> Emoji${emojis.length === 1 ? '' : 's'}
880880
</div>
881881
</div>
882882
</div>
@@ -895,7 +895,10 @@ function _renderPackDetails(naddr, pack) {
895895
const img = document.createElement('img');
896896
img.alt = '';
897897
bindCachedEmojiImg(img, pack.image_url, 'emoji_pack_icon');
898-
img.addEventListener('load', () => fallback && fallback.remove(), { once: true });
898+
img.addEventListener('load', () => {
899+
fallback && fallback.remove();
900+
logo.style.backgroundColor = 'transparent';
901+
}, { once: true });
899902
logo.appendChild(img);
900903
}
901904

@@ -1767,7 +1770,7 @@ class PackCanvasGrid {
17671770
const cx = x + this.cellW / 2;
17681771
const cy = y + this.cellH / 2;
17691772

1770-
ctx.clearRect(x, y, this.cellW, this.cellH);
1773+
ctx.clearRect(x, y, this.cellW + PACK_CANVAS_GAP_PX, this.cellH + PACK_CANVAS_GAP_PX);
17711774

17721775
// Scale around the cell centre so the thumb grows in place
17731776
// instead of drifting toward a corner.
@@ -1787,7 +1790,7 @@ class PackCanvasGrid {
17871790
if (bgProgress > 0.01) {
17881791
const boxX = x + (this.cellW - PACK_CANVAS_BOX_PX) / 2;
17891792
const boxY = y + (this.cellH - PACK_CANVAS_BOX_PX) / 2;
1790-
ctx.fillStyle = `rgba(89, 252, 179, ${0.135 * bgProgress})`;
1793+
ctx.fillStyle = `rgba(255, 255, 255, ${0.10 * bgProgress})`;
17911794
_drawRoundedRect(ctx, boxX, boxY, PACK_CANVAS_BOX_PX, PACK_CANVAS_BOX_PX, 6);
17921795
ctx.fill();
17931796
}

src/styles.css

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,8 @@ html, body {
456456
.pack-details-close .icon {
457457
position: static;
458458
margin: 0;
459-
width: 11px;
460-
height: 11px;
459+
width: 14px;
460+
height: 14px;
461461
padding: 0;
462462
border-radius: 0;
463463
background-color: #fff;
@@ -3262,7 +3262,7 @@ body.chat-bg-disabled .chat-messages::before {
32623262
overflow: hidden;
32633263
position: relative;
32643264
height: calc(100% - 50px);
3265-
background-color: transparent;
3265+
background-color: #0a0a0a;
32663266
}
32673267

32683268
.emoji-sidebar {
@@ -3336,12 +3336,12 @@ body.chat-bg-disabled .chat-messages::before {
33363336
padding: 8px;
33373337
padding-right: 5px;
33383338
margin-left: 50px;
3339-
height: 300px;
3339+
height: 280px;
33403340
overflow-y: auto;
33413341
overflow-x: hidden;
33423342
background-color: #0a0a0a;
33433343
border-top-right-radius: 12px;
3344-
border-bottom-right-radius: 12px;
3344+
border-bottom-right-radius: 0px;
33453345
box-sizing: border-box;
33463346
}
33473347

@@ -3450,11 +3450,11 @@ body.chat-bg-disabled .chat-messages::before {
34503450
text-align: center;
34513451
padding: 5px;
34523452
border-radius: 6px;
3453-
transition: all 0.2s ease;
3453+
transition: background-color 0.15s ease;
34543454
}
34553455

34563456
.emoji-grid span:hover {
3457-
background-color: rgba(89, 252, 179, 0.15);
3457+
background-color: rgba(255, 255, 255, 0.10);
34583458
transform: scale(1.125);
34593459
}
34603460

@@ -3601,7 +3601,8 @@ body.chat-bg-disabled .chat-messages::before {
36013601
align-items: center;
36023602
justify-content: center;
36033603
padding: 4px !important;
3604-
background-color: rgba(255, 255, 255, 0.02);
3604+
border-radius: 6px;
3605+
background-color: transparent;
36053606
transition: background-color 0.15s ease !important;
36063607
}
36073608

@@ -3616,10 +3617,15 @@ body.chat-bg-disabled .chat-messages::before {
36163617
re-rasterise during transform: scale, so dropping the hover-scale that
36173618
stock emoji grids use here saves significant paint on hover-over. */
36183619
.emoji-pack-emoji:hover {
3619-
background-color: rgba(89, 252, 179, 0.18) !important;
3620+
background-color: rgba(255, 255, 255, 0.08) !important;
3621+
border-radius: 6px !important;
36203622
transform: none !important;
36213623
}
36223624

3625+
#emoji-recents-grid .emoji-pack-emoji:hover {
3626+
transform: scale(1.125) !important;
3627+
}
3628+
36233629
/* Inline custom emoji. Carries the shared `emoji` class for sizing, so this
36243630
rule only adds the custom-specific behaviour. */
36253631
.custom-emoji-inline {
@@ -3639,14 +3645,14 @@ body.chat-bg-disabled .chat-messages::before {
36393645
uniformly across every render surface (inline chat emoji, reaction
36403646
chip, preview thumb, pack tab, editor cell, modal, etc.). */
36413647
img.emoji-img-loading {
3642-
background-color: rgba(89, 252, 179, 0.10);
3648+
background-color: rgba(255, 255, 255, 0.05);
36433649
border-radius: 4px;
36443650
animation: emoji-img-loading-pulse 1.4s ease-in-out infinite;
36453651
}
36463652

36473653
@keyframes emoji-img-loading-pulse {
3648-
0%, 100% { background-color: rgba(89, 252, 179, 0.08); }
3649-
50% { background-color: rgba(89, 252, 179, 0.20); }
3654+
0%, 100% { background-color: rgba(255, 255, 255, 0.04); }
3655+
50% { background-color: rgba(255, 255, 255, 0.10); }
36503656
}
36513657

36523658
/* NIP-30 custom emoji inside a reaction chip — small enough to sit
@@ -4928,7 +4934,7 @@ img.emoji-img-loading {
49284934
padding: 6px;
49294935
width: 30px;
49304936
height: 30px;
4931-
border-radius: 100%;
4937+
border-radius: 6px;
49324938
display: inline-block;
49334939
}
49344940

0 commit comments

Comments
 (0)