Skip to content

Commit 1004cf8

Browse files
YuurinBeeJSKittyclaude
authored
Final v0.3.0 Frontend Polishes (#38)
* Final v0.3.0 Frontend Polishes * Add Nexus Logo * fix: PR review feedback - storage consistency and styling fixes - Fix indentation in chat background info click handler - Migrate chatBgEnabled from localStorage to database storage - Add loadChatBgEnabled() and saveChatBgEnabled() DB functions - Add --chat-bg-opacity CSS variable for configurability - Change Nexus icon from mask to background-image Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: JSKitty <mail@jskitty.cat> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent dc8d788 commit 1004cf8

13 files changed

Lines changed: 851 additions & 74 deletions

File tree

src-tauri/icons/Nexus.svg

Lines changed: 27 additions & 3 deletions
Loading

src/icons/nexus.svg

Lines changed: 19 additions & 3 deletions
Loading

src/index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ <h2 class="chat-new-subtitle">Select Members</h2>
717717
<h2 style="margin-top: 40px">Choose Theme</h2>
718718
<select id="theme-select">
719719
<option value="vector">Vector</option>
720+
<option value="satoshi">サトシ</option>
720721
<option value="chatstr">Chatstr</option>
721722
<option value="gifverse">Cosmic</option>
722723
<option value="pivx">Keep it Purple</option>
@@ -811,6 +812,14 @@ <h2>Display</h2>
811812
</label>
812813
</div>
813814

815+
<div class="form-group">
816+
<label class="toggle-container">
817+
<span><span id="chat-bg-info" class="icon icon-info btn" style="width: 18px; height: 18px; position: relative; display: inline-block; vertical-align: text-top; margin-left: 5px;"></span>Background Wallpaper</span>
818+
<input type="checkbox" id="chat-bg-toggle" checked>
819+
<span class="neon-toggle"></span>
820+
</label>
821+
</div>
822+
814823
<div class="form-group" id="restore-pivx-group" style="display: none;">
815824
<button id="restore-pivx-btn" class="btn cancel-btn">Restore PIVX Wallet</button>
816825
</div>

src/js/db.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,24 @@ async function saveTheme(theme) {
4343
return await invoke('set_sql_setting', { key: 'theme', value: theme });
4444
}
4545

46+
/**
47+
* Load the user's Chat Background Wallpaper setting
48+
* @returns {Promise<boolean>} - true if enabled (default), false if disabled
49+
*/
50+
async function loadChatBgEnabled() {
51+
const value = await invoke('get_sql_setting', { key: 'chat_bg_enabled' });
52+
if (value === null || value === undefined) return true; // Default: enabled
53+
return value === 'true' || value === '1';
54+
}
55+
56+
/**
57+
* Save the user's Chat Background Wallpaper setting
58+
* @param {boolean} enabled - true to enable, false to disable
59+
*/
60+
async function saveChatBgEnabled(enabled) {
61+
return await invoke('set_sql_setting', { key: 'chat_bg_enabled', value: enabled ? 'true' : 'false' });
62+
}
63+
4664
/**
4765
* Load the user's Whisper Auto Translate setting
4866
* @returns {Promise<boolean>}

src/js/settings.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ async function selectFile() {
680680
* @param {string} mode - The theme mode, i.e: light, dark
681681
*/
682682
function applyTheme(theme = 'vector', mode = 'dark') {
683-
document.body.classList.remove('vector-theme', 'chatstr-theme', 'gifverse-theme', 'pivx-theme');
683+
document.body.classList.remove('vector-theme', 'satoshi-theme', 'chatstr-theme', 'gifverse-theme', 'pivx-theme');
684684
document.body.classList.add(`${theme}-theme`);
685685

686686
domTheme.href = `/themes/${theme}/${mode}.css`;
@@ -1465,6 +1465,26 @@ async function initSettings() {
14651465
await saveDisplayImageTypes(e.target.checked);
14661466
});
14671467

1468+
// Background Wallpaper toggle (Chat Background)
1469+
const chatBgToggle = document.getElementById('chat-bg-toggle');
1470+
if (chatBgToggle) {
1471+
// Load saved preference from database (default: enabled)
1472+
const chatBgEnabled = await loadChatBgEnabled();
1473+
chatBgToggle.checked = chatBgEnabled;
1474+
if (!chatBgEnabled) document.body.classList.add('chat-bg-disabled');
1475+
1476+
// Handle toggle changes
1477+
chatBgToggle.addEventListener('change', async () => {
1478+
if (chatBgToggle.checked) {
1479+
document.body.classList.remove('chat-bg-disabled');
1480+
await saveChatBgEnabled(true);
1481+
} else {
1482+
document.body.classList.add('chat-bg-disabled');
1483+
await saveChatBgEnabled(false);
1484+
}
1485+
});
1486+
}
1487+
14681488
// Initialize notification sound settings (desktop only)
14691489
if (platformFeatures.notification_sounds) {
14701490
await initNotificationSettings();

src/main.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ const domSettingsPrivacyWebPreviewsInfo = document.getElementById('privacy-web-p
150150
const domSettingsPrivacyStripTrackingInfo = document.getElementById('privacy-strip-tracking-info');
151151
const domSettingsPrivacySendTypingInfo = document.getElementById('privacy-send-typing-info');
152152
const domSettingsDisplayImageTypesInfo = document.getElementById('display-image-types-info');
153+
const domSettingsChatBgInfo = document.getElementById('chat-bg-info');
153154
const domSettingsNotifMuteInfo = document.getElementById('notif-mute-info');
154155
const domSettingsDeepRescanInfo = document.getElementById('deep-rescan-info');
155156
const domSettingsExportAccountInfo = document.getElementById('export-account-info');
@@ -10907,6 +10908,11 @@ domChatMessageInput.oninput = async () => {
1090710908
e.stopPropagation();
1090810909
popupConfirm('Display Image Types', 'When enabled, images in chat will display a <b>small badge showing the file type</b> (e.g., PNG, GIF, WEBP) in the corner.<br><br>This helps identify image formats at a glance.', true);
1090910910
};
10911+
domSettingsChatBgInfo.onclick = (e) => {
10912+
e.preventDefault();
10913+
e.stopPropagation();
10914+
popupConfirm('Background Wallpaper', 'This feature enables and disables background images inside of Chats (Private & Group Chats).<br><br>Only applies to certain themes.', true);
10915+
};
1091010916
domSettingsNotifMuteInfo.onclick = (e) => {
1091110917
e.preventDefault();
1091210918
e.stopPropagation();
@@ -10949,7 +10955,7 @@ domChatMessageInput.oninput = async () => {
1094910955
domSettingsDonorsInfo.onclick = (e) => {
1095010956
e.preventDefault();
1095110957
e.stopPropagation();
10952-
popupConfirm('Donors & Contributors', 'The organisations listed below have contributed either <b>financially or resourcefully</b> (developers, infrastructure, etc) to Vector\'s development.<br><br>We extend our sincere thanks to these supporters for helping make Vector possible.', true);
10958+
popupConfirm('Donors & Contributors', 'Your support keeps Vector Privacy independent, open-source, and free. If you would be interested in donating, please visit our GitBook to learn more.<br><br>We extend our sincere gratitude to these supporters for helping make Vector possible.', true);
1095310959
};
1095410960

1095510961
// PIVX donor logo click - opens pivx.org

src/styles.css

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,11 @@
207207
}
208208

209209
.icon-nexus {
210-
-webkit-mask-image: url("./icons/nexus.svg");
211-
mask-image: url("./icons/nexus.svg");
210+
mask-image: none !important;
211+
-webkit-mask-image: none !important;
212+
background-color: transparent !important;
213+
background-image: url("./icons/nexus.svg");
214+
background-size: contain;
212215
background-repeat: no-repeat;
213216
background-position: center;
214217
}
@@ -1182,6 +1185,11 @@ html, body {
11821185
margin-bottom: 10px;
11831186
}
11841187

1188+
/* Chat background toggle */
1189+
body.chat-bg-disabled .chat-messages::before {
1190+
display: none;
1191+
}
1192+
11851193
.msg-inline-timestamp {
11861194
width: 100%;
11871195
text-align: center;
@@ -3846,7 +3854,8 @@ select:disabled:hover {
38463854
.chat-new-title {
38473855
margin-top: 25px;
38483856
margin-bottom: 5px;
3849-
text-align: left;
3857+
text-align: center;
3858+
align-items: center;
38503859
font-weight: 500;
38513860
letter-spacing: 1px;
38523861
}
@@ -3881,14 +3890,17 @@ select:disabled:hover {
38813890
}
38823891

38833892
.chat-new-subtitle {
3884-
margin-bottom: 10px;
3893+
margin-bottom: 0px;
38853894
letter-spacing: 1px;
3895+
text-align: center;
3896+
align-items: center;
38863897
}
38873898

38883899
.chat-new-subtitle-divider {
38893900
margin-top: 8px;
38903901
margin-bottom: 10px;
38913902
width: 325px;
3903+
margin: 0.5rem auto;
38923904
}
38933905

38943906
.chat-new-description {
@@ -6272,7 +6284,6 @@ hr {
62726284
.attachment-panel-marketplace-btn .icon-nexus {
62736285
width: 70% !important;
62746286
height: 70% !important;
6275-
background-color: #59fcb3 !important;
62766287
}
62776288

62786289
#attachment-panel-marketplace .attachment-panel-label {

0 commit comments

Comments
 (0)