Skip to content

Commit

Permalink
Added dark scheme styles to state word in notify() ↞ [auto-sync from
Browse files Browse the repository at this point in the history
  • Loading branch information
kudo-sync-bot committed Jan 29, 2025
1 parent 433f11c commit 44281d3
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions greasemonkey/autoclear-chatgpt-history.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
// @description:zu Ziba itshala lokucabanga okuzoshintshwa ngokuzenzakalelayo uma ukubuka chatgpt.com
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2025.1.29
// @version 2025.1.29.1
// @license MIT
// @icon https://assets.autoclearchatgpt.com/images/icons/openai/black/icon48.png?v=f461c06
// @icon64 https://assets.autoclearchatgpt.com/images/icons/openai/black/icon64.png?v=f461c06
Expand Down Expand Up @@ -463,7 +463,6 @@
// Define FEEDBACK functions

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

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

// Append styled state word
if (foundState) {
const stateStyles = {
on: {
light: 'color: #5cef48 ; text-shadow: rgba(255,250,169,0.38) 2px 1px 5px',
dark: 'color: #5cef48 ; text-shadow: rgb(55, 255, 0) 3px 0 10px'
},
off: {
light: 'color: #ef4848 ; text-shadow: rgba(255,169,225,0.44) 2px 1px 5px',
dark: 'color: #ef4848 ; text-shadow: rgba(255, 116, 116, 0.87) 3px 0 9px'
}
}
const styledStateSpan = document.createElement('span')
styledStateSpan.style.cssText = `color: ${
foundState == menu.state.words[0] ? '#ef4848 ; text-shadow: rgba(255,169,225,0.44) 2px 1px 5px'
: '#5cef48 ; text-shadow: rgba(255,250,169,0.38) 2px 1px 5px' }`
styledStateSpan.style.cssText = stateStyles[foundState == menu.state.words[0] ? 'off' : 'on'][env.ui.scheme]
styledStateSpan.append(foundState) ; notif.append(styledStateSpan)
}
}
Expand Down

0 comments on commit 44281d3

Please sign in to comment.