Skip to content

Commit a9cb30d

Browse files
committed
User Profile: Add Share Button, Copy, Multi-Theme Support
1 parent 168b0c7 commit a9cb30d

File tree

9 files changed

+46
-5
lines changed

9 files changed

+46
-5
lines changed

src/icons/share.svg

Lines changed: 3 additions & 0 deletions
Loading

src/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,10 @@ <h3 id="profile-secondary-name" class="chat-contact-with-status btn"></h3>
510510
<span class="icon icon-volume-mute navbar-icon"></span>
511511
<p class="navbar-text">Mute</p>
512512
</div>
513+
<div id="profile-option-share" class="profile-option">
514+
<span class="icon icon-share navbar-icon"></span>
515+
<p class="navbar-text">Share</p>
516+
</div>
513517
</div>
514518
<span id="profile-description" class="chat-contact-status" style="width: 90%; white-space: pre-line; overflow-y: auto; max-height: 225px; font-style: normal; margin-top: 10px;"></span>
515519
<textarea id="profile-description-editor" class="chat-contact-status profile-description-editor" style="display: none; margin-top: 10px;"></textarea>

src/main.js

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const domProfileOptions = document.getElementById('profile-option-list');
5050
const domProfileOptionMute = document.getElementById('profile-option-mute');
5151
const domProfileOptionMessage = document.getElementById('profile-option-message');
5252
const domProfileOptionNickname = document.getElementById('profile-option-nickname');
53+
const domProfileOptionShare = document.getElementById('profile-option-share');
5354
const domProfileId = document.getElementById('profile-id');
5455

5556
const domGroupOverview = document.getElementById('group-overview');
@@ -426,6 +427,13 @@ function showToast(message) {
426427
left: 50%;
427428
transform: translateX(-50%);
428429
background: rgba(0, 0, 0, 0.8);
430+
backdrop-filter: blur(20px);
431+
-webkit-backdrop-filter: blur(10px);
432+
border: 1px solid var(--toast-border-color);
433+
box-shadow:
434+
0 0 4px rgba(0, 0, 0, 0.8),
435+
0 0 12px rgba(0, 0, 0, 0.6),
436+
0 0 30px rgba(0, 0, 0, 0.4);
429437
color: white;
430438
padding: 12px 24px;
431439
border-radius: 8px;
@@ -6556,9 +6564,9 @@ function renderProfileTab(cProfile) {
65566564
const npub = document.getElementById('profile-npub')?.textContent;
65576565
if (npub) {
65586566
// Copy the full profile URL for easy sharing
6559-
const profileUrl = `https://vectorapp.io/profile/${npub}`;
6560-
navigator.clipboard.writeText(profileUrl).then(() => {
6561-
const copyBtn = e.target.closest('.profile-npub-copy');
6567+
navigator.clipboard.writeText(npub).then(() => {
6568+
showToast('Copied');
6569+
const copyBtn = e.target.closest('#profile-npub-copy');
65626570
if (copyBtn) {
65636571
copyBtn.innerHTML = '<span class="icon icon-check"></span>';
65646572
setTimeout(() => {
@@ -6625,6 +6633,21 @@ function renderProfileTab(cProfile) {
66256633
await invoke('set_nickname', { npub: cProfile.id, nickname: nick });
66266634
}
66276635

6636+
// Setup Share option
6637+
domProfileOptionShare.onclick = () => {
6638+
const npub = document.getElementById('profile-npub')?.textContent;
6639+
if (npub) {
6640+
const profileUrl = `https://vectorapp.io/profile/${npub}`;
6641+
navigator.clipboard.writeText(profileUrl).then(() => {
6642+
// Brief visual feedback
6643+
const icon = domProfileOptionShare.querySelector('span');
6644+
showToast('Profile Link Copied!');
6645+
icon.classList.replace('icon-share', 'icon-check');
6646+
setTimeout(() => icon.classList.replace('icon-check', 'icon-share'), 2000);
6647+
});
6648+
}
6649+
};
6650+
66286651
// Hide edit buttons
66296652
document.querySelector('.profile-avatar-edit').style.display = 'none';
66306653
document.querySelector('.profile-banner-edit').style.display = 'none';

src/styles.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@
192192
mask-image: url("./icons/send.svg");
193193
}
194194

195+
.icon-share {
196+
mask-image: url("./icons/share.svg");
197+
-webkit-mask-image: url("./icons/share.svg");
198+
background-color: var(--icon-color-primary);
199+
}
200+
195201
.icon-withdraw {
196202
mask-image: url("./icons/withdraw.svg");
197203
}
@@ -703,9 +709,9 @@ html, body {
703709
height: 50px;
704710
width: 50px;
705711
border-radius: 12px;
706-
border-color: #393b3c;
712+
border-color: #393B3C;
707713
border-style: solid;
708-
border-width: 1px;
714+
border-width: 2px;
709715
color: #b2b2b2;
710716
background-color: #060606;
711717
cursor: pointer;

src/themes/chatstr/dark.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
--icon-color-primary: #b188e2;
77
--voice-progress-secondary: rgba(177, 136, 226, 0.4);
88
--reply-highlight-border: #CD3DD3;
9+
--toast-border-color: #b188e2;
910
}
1011

1112
.sync-line {

src/themes/gifverse/dark.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
--icon-color-primary: #F7FFAE;
77
--voice-progress-secondary: #F7FFAE40;
88
--reply-highlight-border: #FFAECE;
9+
--toast-border-color: #F7FFAE;
910
}
1011

1112
.sync-line {

src/themes/pivx/dark.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
--icon-color-primary: #B359FC;
77
--voice-progress-secondary: rgba(177, 136, 226, 0.4);
88
--reply-highlight-border: #a128fd;
9+
--toast-border-color: #B359FC;
910
--chat-bg-opacity: 0.04;
1011
}
1112

src/themes/satoshi/dark.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
--icon-color-primary: #F7931A;
77
--voice-progress-secondary: #F7931A40;
88
--reply-highlight-border: #F9AA4B;
9+
--toast-border-color: #F7931A;
910
}
1011

1112
.sync-line {

src/themes/vector/dark.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
--voice-frequency-glow: rgba(89, 252, 179, 0.8);
66
--icon-color-primary: #59fcb3;
77
--reply-highlight-border: #33DB98;
8+
--toast-border-color: #33DB98;
89
}
910

1011
.sync-line {

0 commit comments

Comments
 (0)