Skip to content

Commit 804a7ed

Browse files
committed
Added dark scheme styles to state word in notify() ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/autoclear-chatgpt-history]
1 parent 5fad5d3 commit 804a7ed

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

chatgpt/autoclear-chatgpt-history/autoclear-chatgpt-history.user.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
// @description:zu Ziba itshala lokucabanga okuzoshintshwa ngokuzenzakalelayo uma ukubuka chatgpt.com
226226
// @author Adam Lui
227227
// @namespace https://github.com/adamlui
228-
// @version 2025.1.29
228+
// @version 2025.1.29.1
229229
// @license MIT
230230
// @icon https://assets.autoclearchatgpt.com/images/icons/openai/black/icon48.png?v=f461c06
231231
// @icon64 https://assets.autoclearchatgpt.com/images/icons/openai/black/icon64.png?v=f461c06
@@ -463,7 +463,6 @@
463463
// Define FEEDBACK functions
464464

465465
function notify(msg, pos = '', notifDuration = '', shadow = '') {
466-
if (config.notifDisabled && !msg.includes(app.msgs.menuLabel_modeNotifs)) return
467466

468467
// Strip state word to append colored one later
469468
const foundState = menu.state.words.find(word => msg.includes(word))
@@ -475,10 +474,18 @@
475474

476475
// Append styled state word
477476
if (foundState) {
477+
const stateStyles = {
478+
on: {
479+
light: 'color: #5cef48 ; text-shadow: rgba(255,250,169,0.38) 2px 1px 5px',
480+
dark: 'color: #5cef48 ; text-shadow: rgb(55, 255, 0) 3px 0 10px'
481+
},
482+
off: {
483+
light: 'color: #ef4848 ; text-shadow: rgba(255,169,225,0.44) 2px 1px 5px',
484+
dark: 'color: #ef4848 ; text-shadow: rgba(255, 116, 116, 0.87) 3px 0 9px'
485+
}
486+
}
478487
const styledStateSpan = document.createElement('span')
479-
styledStateSpan.style.cssText = `color: ${
480-
foundState == menu.state.words[0] ? '#ef4848 ; text-shadow: rgba(255,169,225,0.44) 2px 1px 5px'
481-
: '#5cef48 ; text-shadow: rgba(255,250,169,0.38) 2px 1px 5px' }`
488+
styledStateSpan.style.cssText = stateStyles[foundState == menu.state.words[0] ? 'off' : 'on'][env.ui.scheme]
482489
styledStateSpan.append(foundState) ; notif.append(styledStateSpan)
483490
}
484491
}

0 commit comments

Comments
 (0)