Skip to content

Commit 2b90059

Browse files
committed
Changed Settings toggles to only init opposite enabled state + unstaggered animations on modal open ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/duckduckgpt]
1 parent 52b171e commit 2b90059

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

chatgpt/duckduckgpt/duckduckgpt.user.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!)
149149
// @author KudoAI
150150
// @namespace https://kudoai.com
151-
// @version 2025.1.30.3
151+
// @version 2025.1.30.4
152152
// @license MIT
153153
// @icon https://assets.ddgpt.com/images/icons/duckduckgpt/icon48.png?v=06af076
154154
// @icon64 https://assets.ddgpt.com/images/icons/duckduckgpt/icon64.png?v=06af076
@@ -1334,19 +1334,16 @@
13341334
const switchSpan = document.createElement('span')
13351335
Object.assign(switchSpan.style, {
13361336
position: 'relative', left: '-1px', bottom:'-5.5px', float: 'right',
1337-
backgroundColor: settingToggle.checked ? '#ccc' : '#AD68FF', // init opposite final color
1338-
width: '26px', height: '13px', borderRadius: '28px',
1337+
backgroundColor: '#ccc', width: '26px', height: '13px', borderRadius: '28px',
13391338
transition: '0.4s', '-webkit-transition': '0.4s', '-moz-transition': '0.4s',
13401339
'-o-transition': '0.4s', '-ms-transition': '0.4s'
13411340
})
13421341

13431342
// Create/stylize knob
13441343
const knobSpan = document.createElement('span')
13451344
Object.assign(knobSpan.style, {
1346-
position: 'absolute', left: '1px', bottom: '1px', backgroundColor: 'white',
1347-
width: '11px', height: '11px', content: '""', borderRadius: '28px',
1348-
transform: settingToggle.checked ? // init opposite final pos
1349-
'translateX(0)' : 'translateX(14px) translateY(0)',
1345+
position: 'absolute', left: '1px', bottom: '1px', backgroundColor: 'white', content: '""',
1346+
width: '11px', height: '11px', borderRadius: '28px', transform: 'translateX(0)',
13501347
transition: '0.2s', '-webkit-transition': '0.2s', '-moz-transition': '0.2s',
13511348
'-o-transition': '0.2s', '-ms-transition': '0.2s'
13521349
})
@@ -1355,7 +1352,7 @@
13551352
switchSpan.append(knobSpan) ; settingItem.append(settingToggle, switchSpan)
13561353

13571354
// Update visual state w/ animation
1358-
setTimeout(() => modals.settings.toggle.updateStyles(settingToggle), idx *25 -25)
1355+
setTimeout(() => modals.settings.toggle.updateStyles(settingToggle), +155)
13591356

13601357
// Add click listener
13611358
settingItem.onclick = () => {

0 commit comments

Comments
 (0)