Skip to content

Commit c6bdfd9

Browse files
committed
Added dark scheme styles to state word in notify() ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/chatgpt-widescreen]
1 parent 14cebe8 commit c6bdfd9

File tree

3 files changed

+39
-13
lines changed

3 files changed

+39
-13
lines changed

chromium/extension/content.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,19 @@
6060

6161
// Append styled state word
6262
if (foundState) {
63-
const styledStateSpan = dom.create.elem('span')
64-
styledStateSpan.style.cssText = `color: ${
65-
foundState == 'OFF' ? '#ef4848 ; text-shadow: rgba(255,169,225,0.44) 2px 1px 5px'
66-
: '#5cef48 ; text-shadow: rgba(255,250,169,0.38) 2px 1px 5px' }`
63+
const stateStyles = {
64+
on: {
65+
light: 'color: #5cef48 ; text-shadow: rgba(255,250,169,0.38) 2px 1px 5px',
66+
dark: 'color: #5cef48 ; text-shadow: rgb(55, 255, 0) 3px 0 10px'
67+
},
68+
off: {
69+
light: 'color: #ef4848 ; text-shadow: rgba(255,169,225,0.44) 2px 1px 5px',
70+
dark: 'color: #ef4848 ; text-shadow: rgba(255, 116, 116, 0.87) 3px 0 9px'
71+
}
72+
}
73+
const styledStateSpan = document.createElement('span')
74+
styledStateSpan.style.cssText = stateStyles[
75+
foundState == chrome.i18n.getMessage('state_off').toUpperCase() ? 'off' : 'on'][env.ui.scheme]
6776
styledStateSpan.append(foundState) ; notif.append(styledStateSpan)
6877
}
6978
}

firefox/extension/content.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,19 @@
6060

6161
// Append styled state word
6262
if (foundState) {
63-
const styledStateSpan = dom.create.elem('span')
64-
styledStateSpan.style.cssText = `color: ${
65-
foundState == 'OFF' ? '#ef4848 ; text-shadow: rgba(255,169,225,0.44) 2px 1px 5px'
66-
: '#5cef48 ; text-shadow: rgba(255,250,169,0.38) 2px 1px 5px' }`
63+
const stateStyles = {
64+
on: {
65+
light: 'color: #5cef48 ; text-shadow: rgba(255,250,169,0.38) 2px 1px 5px',
66+
dark: 'color: #5cef48 ; text-shadow: rgb(55, 255, 0) 3px 0 10px'
67+
},
68+
off: {
69+
light: 'color: #ef4848 ; text-shadow: rgba(255,169,225,0.44) 2px 1px 5px',
70+
dark: 'color: #ef4848 ; text-shadow: rgba(255, 116, 116, 0.87) 3px 0 9px'
71+
}
72+
}
73+
const styledStateSpan = document.createElement('span')
74+
styledStateSpan.style.cssText = stateStyles[
75+
foundState == chrome.i18n.getMessage('state_off').toUpperCase() ? 'off' : 'on'][env.ui.scheme]
6776
styledStateSpan.append(foundState) ; notif.append(styledStateSpan)
6877
}
6978
}

greasemonkey/chatgpt-widescreen-mode.user.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
// @description:zu Thuthukisa iChatGPT ngemodi zesikrini ezibanzi/egcwele/ephezulu + imodi yokuvimbela i-spam. Futhi isebenza ku-perplexity.ai + poe.com!
236236
// @author Adam Lui
237237
// @namespace https://github.com/adamlui
238-
// @version 2025.1.29
238+
// @version 2025.1.29.1
239239
// @license MIT
240240
// @icon https://assets.chatgptwidescreen.com/images/icons/widescreen-robot-emoji/icon48.png?v=844b16e
241241
// @icon64 https://assets.chatgptwidescreen.com/images/icons/widescreen-robot-emoji/icon64.png?v=844b16e
@@ -509,10 +509,18 @@
509509

510510
// Append styled state word
511511
if (foundState) {
512-
const styledStateSpan = dom.create.elem('span')
513-
styledStateSpan.style.cssText = `color: ${
514-
foundState == menu.state.words[0] ? '#ef4848 ; text-shadow: rgba(255,169,225,0.44) 2px 1px 5px'
515-
: '#5cef48 ; text-shadow: rgba(255,250,169,0.38) 2px 1px 5px' }`
512+
const stateStyles = {
513+
on: {
514+
light: 'color: #5cef48 ; text-shadow: rgba(255,250,169,0.38) 2px 1px 5px',
515+
dark: 'color: #5cef48 ; text-shadow: rgb(55, 255, 0) 3px 0 10px'
516+
},
517+
off: {
518+
light: 'color: #ef4848 ; text-shadow: rgba(255,169,225,0.44) 2px 1px 5px',
519+
dark: 'color: #ef4848 ; text-shadow: rgba(255, 116, 116, 0.87) 3px 0 9px'
520+
}
521+
}
522+
const styledStateSpan = document.createElement('span')
523+
styledStateSpan.style.cssText = stateStyles[foundState == menu.state.words[0] ? 'off' : 'on'][env.ui.scheme]
516524
styledStateSpan.append(foundState) ; notif.append(styledStateSpan)
517525
}
518526
}

0 commit comments

Comments
 (0)