Skip to content

Commit

Permalink
Made sidebar toggle only animate on not off ↞ [auto-sync from https:/…
Browse files Browse the repository at this point in the history
  • Loading branch information
kudo-sync-bot committed Jan 30, 2025
1 parent a1876e2 commit 6facbbe
Showing 1 changed file with 3 additions and 5 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 2025.1.30.4
// @version 2025.1.30.5
// @license MIT
// @icon https://assets.autoclearchatgpt.com/images/icons/openai/black/icon48.png?v=f461c06
// @icon64 https://assets.autoclearchatgpt.com/images/icons/openai/black/icon64.png?v=f461c06
Expand Down Expand Up @@ -797,7 +797,7 @@
}

// Update scheme/state
this.update.scheme() ; this.update.state() // to opposite init state for animation on 1st load
this.update.scheme() ; this.update.state()

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

0 comments on commit 6facbbe

Please sign in to comment.