Skip to content

Commit

Permalink
Disabled button animations when FG Animations setting disabled ↞ [aut…
Browse files Browse the repository at this point in the history
…o-sync from `adamlui/chatgpt-apps`]
  • Loading branch information
adamlui authored and kudo-sync-bot committed Sep 11, 2024
1 parent 684e3f9 commit 6bde0e4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions greasemonkey/bravegpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
// @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!)
// @author KudoAI
// @namespace https://kudoai.com
// @version 2024.9.11.3
// @version 2024.9.11.4
// @license MIT
// @icon https://media.bravegpt.com/images/icons/bravegpt/icon48.png?0a9e287
// @icon64 https://media.bravegpt.com/images/icons/bravegpt/icon64.png?0a9e287
Expand Down Expand Up @@ -2250,9 +2250,10 @@
else if (btn.id == 'arrows-btn') btn.onclick = () => toggle.expandedMode()
if (!browser.isMobile && btn.id != 'pin-btn') // add hover listeners for tooltips
btn.onmouseover = btn.onmouseout = toggle.tooltip
if (!/wsb|pin/.test(btn.id)) btn.onmouseup = () => { // add zoom/fade-out
if (!/wsb|pin/.test(btn.id)) btn.onmouseup = () => { // add zoom/fade-out except to WSB/pin btns
if (config.fgAnimationsDisabled) return
if (!(btn.id == 'font-size-btn' && appDiv.querySelector('#font-size-slider-track')?.classList.contains('active')))
btn.style.animation = 'btn-zoom-fade-out .220s ease-out'
btn.style.animation = 'btn-zoom-fade-out .220s ease-out' // animate except when dismissing Font Size slider
setTimeout(() => { // hide btn after animation nears completion
Object.assign(btn.style, { opacity: '0', visibility: 'hidden', animation: '' })
setTimeout(() => // show btn after short delay
Expand Down Expand Up @@ -3227,6 +3228,7 @@
if (!browser.isMobile) toggle.tooltip(event) // show copied status in tooltip
}
copySpan.onmouseup = () => { // zoom/fade-out
if (config.fgAnimationsDisabled) return
const copySVG = copySpan.querySelector('#copy-icon')
if (!copySVG) return // since clicking on copied icon
copySpan.style.animation = `btn-zoom-fade-out .${fadeDuration}s ease-out`
Expand Down

0 comments on commit 6bde0e4

Please sign in to comment.