From 1da4bb7aadce1a434e779a81e193b52a364320c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Lui=20=E5=88=98=E5=B1=95=E9=B9=8F?= Date: Sat, 10 Aug 2024 20:24:14 -0700 Subject: [PATCH] Added 2nd layer shadow to dark mode toggle for more depth MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ± Moved assignment to `insertToggle()` to sync w/ scheme changes --- .../autoclear-chatgpt-history.user.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chatgpt/autoclear-chatgpt-history/autoclear-chatgpt-history.user.js b/chatgpt/autoclear-chatgpt-history/autoclear-chatgpt-history.user.js index 55a0b83d8..cad3e0a16 100644 --- a/chatgpt/autoclear-chatgpt-history/autoclear-chatgpt-history.user.js +++ b/chatgpt/autoclear-chatgpt-history/autoclear-chatgpt-history.user.js @@ -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 @@ -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}` @@ -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)