Skip to content

Commit 8a42ee0

Browse files
committed
Converted env.browser.isPhone to .isCompact ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/bravegpt]
1 parent b7c9a74 commit 8a42ee0

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

chatgpt/bravegpt/bravegpt.user.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!)
149149
// @author KudoAI
150150
// @namespace https://kudoai.com
151-
// @version 2025.10.21.2
151+
// @version 2025.10.21.3
152152
// @license MIT
153153
// @icon https://assets.bravegpt.com/images/icons/app/icon48.png?v=e8ca7c2
154154
// @icon64 https://assets.bravegpt.com/images/icons/app/icon64.png?v=e8ca7c2
@@ -262,7 +262,7 @@
262262
env.browser[`is${ platform == 'Firefox' ? 'FF' : platform }`] = chatgpt.browser['is' + platform]())
263263
Object.assign(env.browser, {
264264
get isPortrait() { return env.browser.isMobile && (innerWidth < innerHeight) },
265-
get isPhone() { return env.browser.isMobile && innerWidth <= 480 }
265+
get isCompact() { return innerWidth <= 480 }
266266
})
267267
env.userLocale = env.browser.language.includes('-') ? env.browser.language.split('-')[1].toLowerCase() : ''
268268
env.scriptManager.supportsStreaming = /Tampermonkey|ScriptCat/.test(env.scriptManager.name)
@@ -557,7 +557,7 @@
557557
color: #b6b8ba ; fill: #b6b8ba ; animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite }
558558
#${app.slug} section.loading { padding: 0 0 14px 5px ; font-size: 90% } /* pad loading status */
559559
#${app.slug}-font-size-slider-track {
560-
width: 98% ; height: 7px ; margin: -5px auto ${ env.browser.isPhone ? -4 : -9 }px ;
560+
width: 98% ; height: 7px ; margin: -5px auto ${ env.browser.isCompact ? -4 : -9 }px ;
561561
padding: 15px 0 ; background-color: #ccc ; box-sizing: content-box; background-clip: content-box ;
562562
-webkit-background-clip: content-box }
563563
#${app.slug}-font-size-slider-track::before { /* to add finger cursor to unpadded core only */
@@ -816,7 +816,7 @@
816816
},
817817

818818
bylineVisibility() {
819-
if (env.browser.isPhone) return // since byline hidden by app.styles
819+
if (env.browser.isCompact) return // since byline hidden by app.styles
820820

821821
// Init header elems
822822
const headerElems = { byline: app.div.querySelector('.byline') }
@@ -1885,7 +1885,7 @@
18851885
aboutModal.querySelector('h2').remove() // remove empty title h2
18861886
aboutModal.querySelector('p').style.cssText = `
18871887
overflow-wrap: anywhere ; line-height: 1.55 ;
1888-
margin: ${ env.browser.isPhone ? '15px 0 -21px' : '13px 0 -18px 11px' }`
1888+
margin: ${ env.browser.isCompact ? '15px 0 -21px' : '13px 0 -18px 11px' }`
18891889

18901890
// Hack buttons
18911891
aboutModal.querySelectorAll('button').forEach(btn => {
@@ -1946,7 +1946,7 @@
19461946
// Re-style elems
19471947
apiModal.querySelector('h2').style.justifySelf = 'center' // center title
19481948
const btnsDiv = apiModal.querySelector('.modal-buttons')
1949-
btnsDiv.style.cssText = `margin-top: 23px !important ; ${ env.browser.isPhone ? ''
1949+
btnsDiv.style.cssText = `margin-top: 23px !important ; ${ env.browser.isCompact ? ''
19501950
: 'flex-wrap: wrap ; justify-content: center ; gap: 9px' }` // gridify wide view btns
19511951
btnsDiv.querySelectorAll('button').forEach((btn, idx) => {
19521952
if (idx == 0) btn.style.display = 'none' // hide Dismiss button
@@ -1973,7 +1973,7 @@
19731973

19741974
// Re-style button cluster
19751975
const btnsDiv = feedbackModal.querySelector('.modal-buttons')
1976-
if (!env.browser.isPhone) // gridify wide view btns
1976+
if (!env.browser.isCompact) // gridify wide view btns
19771977
btnsDiv.style.cssText = 'flex-wrap: wrap ; justify-content: center ; gap: 3px'
19781978

19791979
// Hack buttons
@@ -2514,7 +2514,7 @@
25142514
}
25152515
.chatgpt-modal > div {
25162516
background-color: white !important ; color: #202124 ;
2517-
${ env.browser.isPhone ? 'padding: 25px 31px !important' : '' }
2517+
${ env.browser.isCompact ? 'padding: 25px 31px !important' : '' }
25182518
}
25192519
.chatgpt-modal p { margin: 14px 0 -20px 4px ; font-size: 18px } /* pos/size modal msg */
25202520
.chatgpt-modal a { color: #${ appScheme == 'dark' ? '00cfff' : '1e9ebb' } !important }
@@ -2600,7 +2600,7 @@
26002600
align-content: center ; /* for symmetrized gaps when odd num of entries */
26012601
list-style: none ; padding: 0 ; margin: 0 ; /* hide bullets, override Brave ul margins */
26022602
width: ${ env.browser.isPortrait ? 100 : 50 }% } /* set width based on column cnt */
2603-
${ env.browser.isPhone ? '' : `#${app.slug}-settings ul:first-of-type { /* color desktop middle sep */
2603+
${ env.browser.isCompact ? '' : `#${app.slug}-settings ul:first-of-type { /* color desktop middle sep */
26042604
border-right: 1px dotted ${ appScheme == 'dark' ? 'white' : 'black' }}`}
26052605
#${app.slug}-settings li {
26062606
color: ${ appScheme == 'dark' ? 'rgb(255,255,255,0.65)' : 'rgba(0,0,0,0.45)' };

0 commit comments

Comments
 (0)