Skip to content

Commit b8f047e

Browse files
committed
Replaced env.browser.isPortrait w/ .isCompact ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/bravegpt]
1 parent 0e074ee commit b8f047e

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

chatgpt/bravegpt/bravegpt.user.js

Lines changed: 10 additions & 13 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.11.3
151+
// @version 2025.11.5
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
@@ -260,10 +260,7 @@
260260
}
261261
} ; ['Chromium', 'Firefox', 'Chrome', 'Edge', 'Brave', 'Mobile'].forEach(platform =>
262262
env.browser[`is${ platform == 'Firefox' ? 'FF' : platform }`] = chatgpt.browser['is' + platform]())
263-
Object.assign(env.browser, {
264-
get isPortrait() { return env.browser.isMobile && (innerWidth < innerHeight) },
265-
get isCompact() { return innerWidth <= 480 }
266-
})
263+
Object.assign(env.browser, { get isCompact() { return innerWidth <= 480 }})
267264
env.userLocale = env.browser.language.includes('-') ? env.browser.language.split('-')[1].toLowerCase() : ''
268265
env.scriptManager.supportsStreaming = /Tampermonkey|ScriptCat/.test(env.scriptManager.name)
269266
env.scriptManager.supportsTooltips = env.scriptManager.name == 'Tampermonkey'
@@ -2224,8 +2221,8 @@
22242221

22252222
// Init logo
22262223
const settingsIcon = icons.bravegpt.create()
2227-
settingsIcon.style.cssText = `width: ${ env.browser.isPortrait ? 63 : 67 }px ; margin-bottom: 10px ;`
2228-
+ `position: relative ; top: -29px ; right: ${ env.browser.isPortrait ? -5 : 7 }px ;`
2224+
settingsIcon.style.cssText = `width: ${ env.browser.isCompact ? 63 : 67 }px ; margin-bottom: 10px ;`
2225+
+ `position: relative ; top: -29px ; right: ${ env.browser.isCompact ? -5 : 7 }px ;`
22292226
+ 'filter: drop-shadow(5px 5px 15px rgba(0,0,0,0.3))'
22302227

22312228
// Init title
@@ -2240,7 +2237,7 @@
22402237
const settingsLists = [], middleGap = 30 // px
22412238
const settingsListContainer = dom.create.elem('div')
22422239
const settingsListCnt = (
2243-
env.browser.isMobile && ( env.browser.isPortrait || settingsKeys.length < 8 )) ? 1 : 2
2240+
env.browser.isMobile && ( env.browser.isCompact || settingsKeys.length < 8 )) ? 1 : 2
22442241
const settingEntryCap = Math.floor(settingsKeys.length /2)
22452242
for (let i = 0 ; i < settingsListCnt ; i++) settingsLists.push(dom.create.elem('ul'))
22462243
settingsListContainer.style.width = '95%' // pad vs. parent
@@ -2260,7 +2257,7 @@
22602257
{ id: `${key}-settings-entry`, title: setting.helptip || '' })
22612258
const settingLabel = dom.create.elem('label', { textContent: setting.label })
22622259
settingEntry.append(settingLabel);
2263-
(settingsLists[env.browser.isPortrait ? 0 : +(idx >= settingEntryCap)]).append(settingEntry)
2260+
(settingsLists[env.browser.isCompact ? 0 : +(idx >= settingEntryCap)]).append(settingEntry)
22642261

22652262
// Create/prepend icons
22662263
const settingIcon = icons.create({ key: setting.icon })
@@ -2408,7 +2405,7 @@
24082405
this.styles.textContent = `
24092406
#${app.slug}-settings {
24102407
font-family: var(--brand-font) ;
2411-
min-width: ${ env.browser.isPortrait ? 288 : 758 }px ; max-width: 75vw ; margin: 12px 23px ;
2408+
min-width: ${ env.browser.isCompact ? 288 : 758 }px ; max-width: 75vw ; margin: 12px 23px ;
24122409
word-wrap: break-word ; border-radius: 15px ;
24132410
${ appScheme == 'dark' ? 'stroke: white ; fill: white' : 'stroke: black ; fill: black' };
24142411
--shadow: 0 30px 60px rgba(0,0,0,0.12) ; box-shadow: var(--shadow) ;
@@ -2419,13 +2416,13 @@
24192416
margin: 0 ${ env.browser.isMobile ? -31 : -6 }px -3px 0
24202417
}
24212418
#${app.slug}-settings-title h4 {
2422-
font-size: ${ env.browser.isPortrait ? 26 : 30 }px ; font-weight: bold ;
2419+
font-size: ${ env.browser.isCompact ? 26 : 30 }px ; font-weight: bold ;
24232420
margin: -31px 17px 7px 0
24242421
}
24252422
#${app.slug}-settings ul {
24262423
align-content: center ; /* for symmetrized gaps when odd num of entries */
24272424
list-style: none ; padding: 0 ; margin: 0 ; /* hide bullets, override Brave ul margins */
2428-
width: ${ env.browser.isPortrait ? 100 : 50 }% /* set width based on column cnt */
2425+
width: ${ env.browser.isCompact ? 100 : 50 }% /* set width based on column cnt */
24292426
}
24302427
${ env.browser.isCompact ? '' : `#${app.slug}-settings ul:first-of-type { /* color desktop middle sep */
24312428
border-right: 1px dotted ${ appScheme == 'dark' ? 'white' : 'black' }}`}
@@ -2479,7 +2476,7 @@
24792476
}
24802477
#about-settings-entry span { color: ${ appScheme == 'dark' ? '#28ee28' : 'green' }}
24812478
#about-settings-entry > span { /* outer About status span */
2482-
width: ${ env.browser.isPortrait ? '15vw' : '95px' }; height: 20px ; overflow: hidden ;
2479+
width: ${ env.browser.isCompact ? '15vw' : '95px' }; height: 20px ; overflow: hidden ;
24832480
${ config.fgAnimationsDisabled ? '' : // fade edges
24842481
`mask-image: linear-gradient(
24852482
to right, transparent, black 20%, black 89%, transparent) ;

0 commit comments

Comments
 (0)