Skip to content

Commit 6facbbe

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

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

chatgpt/autoclear-chatgpt-history/autoclear-chatgpt-history.user.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
// @description:zu Ziba itshala lokucabanga okuzoshintshwa ngokuzenzakalelayo uma ukubuka chatgpt.com
226226
// @author Adam Lui
227227
// @namespace https://github.com/adamlui
228-
// @version 2025.1.30.4
228+
// @version 2025.1.30.5
229229
// @license MIT
230230
// @icon https://assets.autoclearchatgpt.com/images/icons/openai/black/icon48.png?v=f461c06
231231
// @icon64 https://assets.autoclearchatgpt.com/images/icons/openai/black/icon64.png?v=f461c06
@@ -797,7 +797,7 @@
797797
}
798798

799799
// Update scheme/state
800-
this.update.scheme() ; this.update.state() // to opposite init state for animation on 1st load
800+
this.update.scheme() ; this.update.state()
801801

802802
// Add hover/click listeners
803803
this.div.onmouseover = this.div.onmouseout = event => // trigger OpenAI hover overlay
@@ -828,8 +828,7 @@
828828
+ `.${this.class} > input { display: none }` // hide checkbox
829829
+ `.${this.class} > span {` // switch span
830830
+ 'position: relative ; width: 30px ; height: 15px ; border-radius: 28px ;'
831-
+ `background-color: var(--switch-${ // init opposite final color
832-
config.autoclear ? 'disabled' : 'enabled' }-bg-color) ;`
831+
+ 'background-color: var(--switch-disabled-bg-color) ;'
833832
+ `bottom: ${ env.ui.firstLink ? 0 : -0.15 }em ;`
834833
+ `left: ${ env.browser.isMobile ? 169 : env.ui.firstLink ? 154 : 160 }px ;`
835834
+ 'transition: 0.4s ; -webkit-transition: 0.4s ; -moz-transition: 0.4s ;'
@@ -847,7 +846,6 @@
847846
+ 'position: absolute ; width: 12px ; height: 12px ; content: "" ; border-radius: 28px ;'
848847
+ 'background-color: white ; left: 3px ; bottom: 1.25px ;'
849848
+ 'box-shadow: var(--knob-box-shadow) ;' // make 3D
850-
+ `transform: translateX(${ config.autoclear ? 0 : 13 }px) ;` // init opposite final pos
851849
+ 'transition: 0.4s ; -webkit-transition: 0.4s ; -moz-transition: 0.4s ;'
852850
+ '-o-transition: 0.4s ; -ms-transition: 0.4s }'
853851
+ `.${this.class} > label {` // toggle label

0 commit comments

Comments
 (0)