Skip to content

Commit

Permalink
Added 2nd layer shadow to dark mode toggle for more depth
Browse files Browse the repository at this point in the history
± Moved assignment to `insertToggle()` to sync w/ scheme changes
  • Loading branch information
adamlui authored Aug 11, 2024
1 parent a213718 commit 1da4bb7
Showing 1 changed file with 4 additions and 3 deletions.
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 2024.8.9
// @version 2024.8.10
// @license MIT
// @icon https://media.autoclearchatgpt.com/images/icons/openai/black/icon48.png?a8868ef
// @icon64 https://media.autoclearchatgpt.com/images/icons/openai/black/icon64.png?a8868ef
Expand Down Expand Up @@ -568,6 +568,8 @@
// Tweak styles
navToggleDiv.style.flexGrow = 'unset' // overcome OpenAI .grow
navToggleDiv.style.paddingLeft = '8px'
document.getElementById('autoclear-toggle-knob-span').style.boxShadow = (
'rgba(0, 0, 0, .3) 0 1px 2px 0' + ( chatgpt.isDarkMode() ? ', rgba(0, 0, 0, .15) 0 3px 6px 2px' : '' ))
document.getElementById('autoclear-toggle-navicon').src = `${ // update navicon color in case scheme changed
config.mediaHostURL}images/icons/incognito/`
+ `${ chatgpt.isDarkMode() ? 'white' : 'black' }/icon32.png?${config.latestAssetCommitHash}`
Expand Down Expand Up @@ -606,8 +608,7 @@
width: `${knobWidth}px`, height: `${knobWidth}px`, content: '""', borderRadius: '28px',
transform: toggleInput.checked ? // init opposite final pos
'translateX(0)' : 'translateX(13px) translateY(0)',
backgroundColor: 'white', '-webkit-transition': '0.4s', transition: '0.4s',
boxShadow: 'rgba(0, 0, 0, .3) 0 1px 2px 0'
backgroundColor: 'white', '-webkit-transition': '0.4s', transition: '0.4s'
}
Object.assign(knobSpan.style, knobStyles) ; switchSpan.append(knobSpan)

Expand Down

0 comments on commit 1da4bb7

Please sign in to comment.