Skip to content

Commit 82c3606

Browse files
committed
Made sidebar toggle only animate on not off ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/chatgpt-auto-talk]
1 parent 6facbbe commit 82c3606

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

chatgpt/chatgpt-auto-talk/chatgpt-auto-talk.user.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
// @description:zu Dlala izimpendulo ze-ChatGPT ngokuzenzakalela
226226
// @author Adam Lui
227227
// @namespace https://github.com/adamlui
228-
// @version 2025.1.30.3
228+
// @version 2025.1.30.4
229229
// @license MIT
230230
// @icon https://assets.chatgptautotalk.com/images/icons/openai/black/icon48.png?v=9f1ed3c
231231
// @icon64 https://assets.chatgptautotalk.com/images/icons/openai/black/icon64.png?v=9f1ed3c
@@ -782,7 +782,7 @@
782782
}
783783

784784
// Update scheme/state
785-
this.update.scheme() ; this.update.state() // to opposite init state for animation on 1st load
785+
this.update.scheme() ; this.update.state()
786786

787787
// Add hover/click listeners
788788
this.div.onmouseover = this.div.onmouseout = event => // trigger OpenAI hover overlay
@@ -814,8 +814,7 @@
814814
+ `.${this.class} > input { display: none }` // hide checkbox
815815
+ `.${this.class} > span {` // switch span
816816
+ 'position: relative ; width: 30px ; height: 15px ; border-radius: 28px ;'
817-
+ `background-color: var(--switch-${ // init opposite final color
818-
!config.autoTalkDisabled ? 'disabled' : 'enabled' }-bg-color) ;`
817+
+ 'background-color: var(--switch-disabled-bg-color) ;'
819818
+ `bottom: ${ env.ui.firstLink ? 0 : -0.15 }em ;`
820819
+ `left: ${ env.browser.isMobile ? 169 : env.ui.firstLink ? 154 : 160 }px ;`
821820
+ 'transition: 0.4s ; -webkit-transition: 0.4s ; -moz-transition: 0.4s ;'
@@ -833,7 +832,6 @@
833832
+ 'position: absolute ; width: 12px ; height: 12px ; content: "" ; border-radius: 28px ;'
834833
+ 'background-color: white ; left: 3px ; bottom: 1.25px ;'
835834
+ 'box-shadow: var(--knob-box-shadow) ;' // make 3D
836-
+ `transform: translateX(${ !config.autoTalkDisabled ? 0 : 13 }px) ;` // init opposite final pos
837835
+ 'transition: 0.4s ; -webkit-transition: 0.4s ; -moz-transition: 0.4s ;'
838836
+ '-o-transition: 0.4s ; -ms-transition: 0.4s }'
839837
+ `.${this.class} > label {` // toggle label

0 commit comments

Comments
 (0)