Skip to content

Commit d026396

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

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

chatgpt/duckduckgpt/duckduckgpt.user.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (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.ddgpt.com/images/icons/app/icon48.png?v=533ce0f
154154
// @icon64 https://assets.ddgpt.com/images/icons/app/icon64.png?v=533ce0f
@@ -261,10 +261,7 @@
261261
}
262262
} ; ['Chromium', 'Firefox', 'Chrome', 'Edge', 'Brave', 'Mobile'].forEach(platform =>
263263
env.browser[`is${ platform == 'Firefox' ? 'FF' : platform }`] = chatgpt.browser['is' + platform]())
264-
Object.assign(env.browser, {
265-
get isPortrait() { return env.browser.isMobile && (innerWidth < innerHeight) },
266-
get isCompact() { return innerWidth <= 480 }
267-
})
264+
Object.assign(env.browser, { get isCompact() { return innerWidth <= 480 }})
268265
env.userLocale = env.browser.language.includes('-') ? env.browser.language.split('-')[1].toLowerCase() : ''
269266
env.scriptManager.supportsStreaming = /Tampermonkey|ScriptCat/.test(env.scriptManager.name)
270267
env.scriptManager.supportsTooltips = env.scriptManager.name == 'Tampermonkey'
@@ -2244,7 +2241,7 @@
22442241
const settingsLists = [], middleGap = 30 // px
22452242
const settingsListContainer = dom.create.elem('div')
22462243
const settingsListCnt = (
2247-
env.browser.isMobile && ( env.browser.isPortrait || settingsKeys.length < 8 )) ? 1 : 2
2244+
env.browser.isMobile && ( env.browser.isCompact || settingsKeys.length < 8 )) ? 1 : 2
22482245
const settingEntryCap = Math.floor(settingsKeys.length /2)
22492246
for (let i = 0 ; i < settingsListCnt ; i++) settingsLists.push(dom.create.elem('ul'))
22502247
settingsListContainer.style.width = '95%' // pad vs. parent
@@ -2264,7 +2261,7 @@
22642261
{ id: `${key}-settings-entry`, title: setting.helptip || '' })
22652262
const settingLabel = dom.create.elem('label', { textContent: setting.label })
22662263
settingEntry.append(settingLabel);
2267-
(settingsLists[env.browser.isPortrait ? 0 : +(idx >= settingEntryCap)]).append(settingEntry)
2264+
(settingsLists[env.browser.isCompact ? 0 : +(idx >= settingEntryCap)]).append(settingEntry)
22682265

22692266
// Create/prepend icons
22702267
const settingIcon = icons.create({ key: setting.icon })
@@ -2411,7 +2408,7 @@
24112408
if (!this.styles?.isConnected) document.head.append(this.styles ||= dom.create.style())
24122409
this.styles.textContent = `
24132410
#${app.slug}-settings {
2414-
min-width: ${ env.browser.isPortrait ? 288 : 698 }px ; max-width: 75vw ;
2411+
min-width: ${ env.browser.isCompact ? 288 : 698 }px ; max-width: 75vw ;
24152412
word-wrap: break-word ; border-radius: 15px ;
24162413
${ appScheme == 'dark' ? 'stroke: white ; fill: white' : 'stroke: black ; fill: black' };
24172414
--shadow: 0 30px 60px rgba(0,0,0,0.12) ; box-shadow: var(--shadow) ;
@@ -2420,11 +2417,11 @@
24202417
#${app.slug}-settings-title {
24212418
font-weight: bold ; line-height: 19px ; text-align: center ; margin: 0 3px -3px 0 }
24222419
#${app.slug}-settings-title h4 {
2423-
font-size: ${ env.browser.isPortrait ? 26 : 31 }px ; font-weight: bold ; margin-top: -39px }
2420+
font-size: ${ env.browser.isCompact ? 26 : 31 }px ; font-weight: bold ; margin-top: -39px }
24242421
#${app.slug}-settings ul {
24252422
align-content: center ; /* for symmetrized gaps when odd num of entries */
24262423
list-style: none ; padding: 0 ; margin-bottom: 2px ; /* hide bullets, close bottom gap */
2427-
width: ${ env.browser.isPortrait ? 100 : 50 }% /* set width based on column cnt */
2424+
width: ${ env.browser.isCompact ? 100 : 50 }% /* set width based on column cnt */
24282425
}
24292426
${ env.browser.isCompact ? '' : `#${app.slug}-settings ul:first-of-type { /* color desktop middle sep */
24302427
border-right: 1px dotted ${ appScheme == 'dark' ? 'white' : 'black' }}`}
@@ -2478,7 +2475,7 @@
24782475
}
24792476
#about-settings-entry span { color: ${ appScheme == 'dark' ? '#28ee28' : 'green' }}
24802477
#about-settings-entry > span { /* outer About status span */
2481-
width: ${ env.browser.isPortrait ? '15vw' : '95px' }; height: 20px ; overflow: hidden ;
2478+
width: ${ env.browser.isCompact ? '15vw' : '95px' }; height: 20px ; overflow: hidden ;
24822479
${ config.fgAnimationsDisabled ? '' : // fade edges
24832480
`mask-image: linear-gradient(
24842481
to right, transparent, black 20%, black 89%, transparent) ;

0 commit comments

Comments
 (0)