@@ -22,6 +22,11 @@ const domLoginImport = document.getElementById('login-import');
2222const domLoginInput = document . getElementById ( 'login-input' ) ;
2323const domLoginBtn = document . getElementById ( 'login-btn' ) ;
2424
25+ const domLoginImportError = document . getElementById ( 'login-import-error' ) ;
26+
27+ const domLoginBackBar = document . getElementById ( 'login-back-bar' ) ;
28+ const domLoginBackBtn = document . getElementById ( 'login-back-btn' ) ;
29+
2530const domLoginInvite = document . getElementById ( 'login-invite' ) ;
2631const domInviteInput = document . getElementById ( 'invite-input' ) ;
2732const domInviteBtn = document . getElementById ( 'invite-btn' ) ;
@@ -53,6 +58,7 @@ const domProfileOptions = document.getElementById('profile-option-list');
5358const domProfileOptionMute = document . getElementById ( 'profile-option-mute' ) ;
5459const domProfileOptionMessage = document . getElementById ( 'profile-option-message' ) ;
5560const domProfileOptionNickname = document . getElementById ( 'profile-option-nickname' ) ;
61+ const domProfileOptionShare = document . getElementById ( 'profile-option-share' ) ;
5662const domProfileId = document . getElementById ( 'profile-id' ) ;
5763
5864const domGroupOverview = document . getElementById ( 'group-overview' ) ;
@@ -131,7 +137,6 @@ const domChatInputContainer = document.querySelector('.chat-input-container');
131137
132138const domChatNew = document . getElementById ( 'chat-new' ) ;
133139const domChatNewBackBtn = document . getElementById ( 'chat-new-back-text-btn' ) ;
134- const domShareNpub = document . getElementById ( 'share-npub' ) ;
135140const domChatNewInput = document . getElementById ( 'chat-new-input' ) ;
136141const domChatNewStartBtn = document . getElementById ( 'chat-new-btn' ) ;
137142
@@ -429,6 +434,13 @@ function showToast(message) {
429434 left: 50%;
430435 transform: translateX(-50%);
431436 background: rgba(0, 0, 0, 0.8);
437+ backdrop-filter: blur(20px);
438+ -webkit-backdrop-filter: blur(10px);
439+ border: 1px solid var(--toast-border-color, #161616);
440+ box-shadow:
441+ 0 0 4px rgba(0, 0, 0, 0.8),
442+ 0 0 12px rgba(0, 0, 0, 0.6),
443+ 0 0 30px rgba(0, 0, 0, 0.4);
432444 color: white;
433445 padding: 12px 24px;
434446 border-radius: 8px;
@@ -441,14 +453,33 @@ function showToast(message) {
441453 document . body . appendChild ( toast ) ;
442454 }
443455
456+ let backdrop = document . getElementById ( 'toast-backdrop' ) ;
457+ if ( ! backdrop ) {
458+ backdrop = document . createElement ( 'div' ) ;
459+ backdrop . id = 'toast-backdrop' ;
460+ backdrop . style . cssText = `
461+ position:fixed;
462+ top:0;
463+ left:0;
464+ width:100%;
465+ height:100%;
466+ background:linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 50%, rgba(0,0,0,0.8) 100%);
467+ opacity:0;
468+ z-index:9999;pointer-events:none;
469+ transition:opacity 0.3s ease;
470+ ` ;
471+ document . body . appendChild ( backdrop ) ;
472+ }
444473 toast . textContent = message ;
445474 toast . style . opacity = '1' ;
475+ backdrop . style . opacity = '1' ;
446476
447- // Hide after 3 seconds
477+ // Hide after 1 second
448478 clearTimeout ( toast . _timeout ) ;
449479 toast . _timeout = setTimeout ( ( ) => {
480+ backdrop . style . opacity = '0' ;
450481 toast . style . opacity = '0' ;
451- } , 3000 ) ;
482+ } , 1000 ) ;
452483}
453484
454485/**
@@ -6500,9 +6531,6 @@ function renderCurrentProfile(cProfile) {
65006531 domAccountStatus . onclick = askForStatus ;
65016532 twemojify ( domAccountStatus ) ;
65026533
6503- /* Start Chat Tab */
6504- // Render our Share npub
6505- domShareNpub . textContent = strPubkey ;
65066534}
65076535
65086536/**
@@ -6637,13 +6665,15 @@ function renderProfileTab(cProfile) {
66376665 domProfileId . textContent = cProfile . id ;
66386666
66396667 // Add npub copy functionality
6640- document . getElementById ( 'profile-npub-copy' ) ?. addEventListener ( 'click' , ( e ) => {
6668+ document . getElementById ( 'profile-npub-copy' ) . onclick = ( e ) => {
66416669 const npub = document . getElementById ( 'profile-npub' ) ?. textContent ;
66426670 if ( npub ) {
66436671 // Copy the full profile URL for easy sharing
6644- const profileUrl = `https://vectorapp.io/profile/${ npub } ` ;
6645- navigator . clipboard . writeText ( profileUrl ) . then ( ( ) => {
6646- const copyBtn = e . target . closest ( '.profile-npub-copy' ) ;
6672+ navigator . clipboard . writeText ( npub ) . then ( ( ) => {
6673+ showToast ( 'Copied!' ) ;
6674+ } ) . catch ( ( ) => {
6675+ showToast ( 'Failed to copy' ) ;
6676+ const copyBtn = e . target . closest ( '#profile-npub-copy' ) ;
66476677 if ( copyBtn ) {
66486678 copyBtn . innerHTML = '<span class="icon icon-check"></span>' ;
66496679 setTimeout ( ( ) => {
@@ -6652,7 +6682,7 @@ function renderProfileTab(cProfile) {
66526682 }
66536683 } ) ;
66546684 }
6655- } ) ;
6685+ } ;
66566686
66576687 // If this is OUR profile: make the elements clickable, hide the "Contact Options"
66586688 if ( cProfile . mine ) {
@@ -6710,6 +6740,23 @@ function renderProfileTab(cProfile) {
67106740 await invoke ( 'set_nickname' , { npub : cProfile . id , nickname : nick } ) ;
67116741 }
67126742
6743+ // Setup Share option
6744+ domProfileOptionShare . onclick = ( ) => {
6745+ const npub = document . getElementById ( 'profile-npub' ) ?. textContent ;
6746+ if ( npub ) {
6747+ const profileUrl = `https://vectorapp.io/profile/${ npub } ` ;
6748+ navigator . clipboard . writeText ( profileUrl ) . then ( ( ) => {
6749+ // Brief visual feedback
6750+ const icon = domProfileOptionShare . querySelector ( 'span' ) ;
6751+ showToast ( 'Profile Link Copied' ) ;
6752+ icon . classList . replace ( 'icon-share' , 'icon-check' ) ;
6753+ setTimeout ( ( ) => icon . classList . replace ( 'icon-check' , 'icon-share' ) , 2000 ) ;
6754+ } ) . catch ( ( ) => {
6755+ showToast ( 'Failed to copy profile link' ) ;
6756+ } ) ;
6757+ }
6758+ } ;
6759+
67136760 // Hide edit buttons
67146761 document . querySelector ( '.profile-avatar-edit' ) . style . display = 'none' ;
67156762 document . querySelector ( '.profile-banner-edit' ) . style . display = 'none' ;
@@ -10580,6 +10627,16 @@ window.addEventListener("DOMContentLoaded", async () => {
1058010627 domLoginAccountBtn . onclick = ( ) => {
1058110628 domLoginImport . style . display = '' ;
1058210629 domLoginStart . style . display = 'none' ;
10630+ domLoginBackBar . style . display = '' ;
10631+ document . getElementById ( 'login-form' ) . classList . add ( 'has-back-bar' ) ;
10632+ } ;
10633+ domLoginBackBtn . onclick = ( ) => {
10634+ domLoginImport . style . display = 'none' ;
10635+ domLoginInvite . style . display = 'none' ;
10636+ domLoginBackBar . style . display = 'none' ;
10637+ domLoginStart . style . display = '' ;
10638+ domLoginInput . value = '' ;
10639+ document . getElementById ( 'login-form' ) . classList . remove ( 'has-back-bar' ) ;
1058310640 } ;
1058410641 domLoginBtn . onclick = async ( ) => {
1058510642 // Import and derive our keys
@@ -10628,6 +10685,16 @@ window.addEventListener("DOMContentLoaded", async () => {
1062810685 domChatNewStartBtn . click ( ) ;
1062910686 }
1063010687 } ;
10688+ domChatNewInput . addEventListener ( 'input' , function ( ) {
10689+ domChatNewStartBtn . style . display = this . value . length > 0 ? '' : 'none' ;
10690+ } ) ;
10691+
10692+ // Tooltip for help icon
10693+ document . querySelector ( '.chat-new-help-link' ) . addEventListener ( 'mouseenter' , function ( ) {
10694+ showGlobalTooltip ( 'Visit the Vector Privacy Docs' , this ) ;
10695+ } ) ;
10696+ document . querySelector ( '.chat-new-help-link' ) . addEventListener ( 'mouseleave' , hideGlobalTooltip ) ;
10697+
1063110698 domChatMessageInputCancel . onclick = ( ) => {
1063210699 // Cancel edit mode if active, otherwise cancel reply
1063310700 if ( strCurrentEditMessageId ) {
@@ -11312,24 +11379,6 @@ domChatMessageInput.oninput = async () => {
1131211379 popupConfirm ( 'PIVX Wallet Restored' , 'The PIVX Wallet has been restored to your Mini Apps panel.' , true ) ;
1131311380 } ;
1131411381 }
11315-
11316- // Add npub copy functionality for chat-new section
11317- document . getElementById ( 'chat-new-npub-copy' ) ?. addEventListener ( 'click' , ( e ) => {
11318- const npub = document . getElementById ( 'share-npub' ) ?. textContent ;
11319- if ( npub ) {
11320- // Copy the full profile URL for easy sharing
11321- const profileUrl = `https://vectorapp.io/profile/${ npub } ` ;
11322- navigator . clipboard . writeText ( profileUrl ) . then ( ( ) => {
11323- const copyBtn = e . target . closest ( '.profile-npub-copy' ) ;
11324- if ( copyBtn ) {
11325- copyBtn . innerHTML = '<span class="icon icon-check"></span>' ;
11326- setTimeout ( ( ) => {
11327- copyBtn . innerHTML = '<span class="icon icon-copy"></span>' ;
11328- } , 2000 ) ;
11329- }
11330- } ) ;
11331- }
11332- } ) ;
1133311382} ) ;
1133411383
1133511384// Listen for app-wide click interations
0 commit comments