diff --git a/index.html b/index.html index 09f089b..e24f39a 100644 --- a/index.html +++ b/index.html @@ -130,6 +130,7 @@

SETTINGS

diff --git a/js/app.js b/js/app.js index a274c37..10b4934 100644 --- a/js/app.js +++ b/js/app.js @@ -13,6 +13,10 @@ document.addEventListener('DOMContentLoaded', async () => { elements.inputApiKey.value = config.apiKey; elements.inputWahaUrl.value = config.wahaUrl; elements.inputSession.value = config.session; + elements.inputBackgroundImage.value = config.bgImg; + elements.inputBackgroundOpacity.value = config.bgOpacity; + elements.activeChatContainer.style.setProperty('--background-image', `URL("${config.bgImg}")`); + elements.activeChatContainer.style.setProperty('--background-opacity', `${config.bgOpacity}`); await updateOnlineStatus(); setupEventListeners(); try { @@ -369,7 +373,9 @@ function saveSettings() { config.save( elements.inputWahaUrl.value, elements.inputSession.value, - elements.inputApiKey.value + elements.inputApiKey.value, + elements.inputBackgroundImage.value, + elements.inputBackgroundOpacity.value ); location.reload(); loadChats(); diff --git a/js/config.js b/js/config.js index a571dbb..edb15f6 100644 --- a/js/config.js +++ b/js/config.js @@ -4,14 +4,20 @@ export const config = { wahaUrl: localStorage.getItem('waha_url') || 'http://inspiran.beetal-castor.ts.net:3100', session: localStorage.getItem('waha_session') || 'session_01kxc62bk5fs8vh4v127k88a7j', apiKey: localStorage.getItem('waha_api_key') || '', + bgImg: localStorage.getItem('background_image') || '', + bgOpacity: localStorage.getItem('background_opacity') || '0.4', - save(url, session, apiKey) { + save(url, session, apiKey, bgImg, bgOpacity) { this.wahaUrl = url.trim().replace(/\/$/, ""); this.session = session.trim(); this.apiKey = apiKey.trim(); + this.bgImg = bgImg.trim(); + this.bgOpacity = bgOpacity.trim(); localStorage.setItem('waha_url', this.wahaUrl); localStorage.setItem('waha_session', this.session); localStorage.setItem('waha_api_key', this.apiKey); + localStorage.setItem('background_image', this.bgImg); + localStorage.setItem('background_opacity', this.bgOpacity); } }; diff --git a/js/ui.js b/js/ui.js index 0ee54e2..698cd6a 100644 --- a/js/ui.js +++ b/js/ui.js @@ -24,6 +24,8 @@ export const elements = { inputWahaUrl: document.getElementById('settings-waha-url'), inputSession: document.getElementById('settings-session'), inputApiKey: document.getElementById('settings-api-key'), + inputBackgroundImage: document.getElementById('settings-background-image'), + inputBackgroundOpacity: document.getElementById('settings-background-opacity'), loggedUserName: document.getElementById('pandora-username'), chatBottomBar: document.getElementById('chat-bottom-bar'), chatBottomBarBtn: document.getElementById('chat-bottom-bar-btn'), diff --git a/style.css b/style.css index 831eae1..f5f85e0 100644 --- a/style.css +++ b/style.css @@ -19,6 +19,7 @@ --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1); --glass-blur: blur(20px); + --high-box-shadow: 2px 7px 5px rgba(0, 0, 0, 0.3), 0px -4px 10px rgba(0, 0, 0, 0.3); } * { @@ -65,7 +66,7 @@ button:hover { } input { - background: var(--bg-main); + background: var(--bg-secondary); color: var(--accent); border: none; padding: 1em; @@ -485,7 +486,7 @@ input:focus { background-size: cover; background-position: center; background-repeat: no-repeat; - opacity: 0.4; + opacity: var(--background-opacity); pointer-events: none; z-index: 0; } @@ -564,9 +565,10 @@ input:focus { .load-more-btn { margin: auto; - background-color: var(--bg-secondary); + background-color: rgba(255, 255, 255, 0.1); padding: .4em; cursor: pointer; + box-shadow: var(--high-box-shadow); } .load-more-btn:hover { @@ -904,6 +906,11 @@ input:focus { height: 100%; } +.modal-body h3 { + font-size: xx-large; + font-weight: 100; +} + .modal-header { display: flex; justify-content: space-between;