Skip to content

Commit bfce22f

Browse files
committed
Converted env.browser.isPhone to .isCompact ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/duckduckgpt]
1 parent 024f772 commit bfce22f

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

chatgpt/duckduckgpt/duckduckgpt.user.js

Lines changed: 8 additions & 8 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.10.21.2
151+
// @version 2025.10.21.3
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
@@ -263,7 +263,7 @@
263263
env.browser[`is${ platform == 'Firefox' ? 'FF' : platform }`] = chatgpt.browser['is' + platform]())
264264
Object.assign(env.browser, {
265265
get isPortrait() { return env.browser.isMobile && (innerWidth < innerHeight) },
266-
get isPhone() { return env.browser.isMobile && innerWidth <= 480 }
266+
get isCompact() { return innerWidth <= 480 }
267267
})
268268
env.userLocale = env.browser.language.includes('-') ? env.browser.language.split('-')[1].toLowerCase() : ''
269269
env.scriptManager.supportsStreaming = /Tampermonkey|ScriptCat/.test(env.scriptManager.name)
@@ -554,7 +554,7 @@
554554
color: #b6b8ba ; fill: #b6b8ba ; animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite }
555555
#${app.slug} section.loading { padding-left: 5px } /* left-pad loading status when sending replies */
556556
#${app.slug}-font-size-slider-track {
557-
width: 98% ; height: 7px ; margin: -6px auto ${ env.browser.isPhone ? -5 : -10 }px ;
557+
width: 98% ; height: 7px ; margin: -6px auto ${ env.browser.isCompact ? -5 : -10 }px ;
558558
padding: 15px 0 ; background-color: #ccc ; box-sizing: content-box; background-clip: content-box ;
559559
-webkit-background-clip: content-box }
560560
#${app.slug}-font-size-slider-track::before { /* to add finger cursor to unpadded core only */
@@ -819,7 +819,7 @@
819819
},
820820

821821
bylineVisibility() {
822-
if (env.browser.isPhone) return // since byline hidden by app.styles
822+
if (env.browser.isCompact) return // since byline hidden by app.styles
823823

824824
// Init header elems
825825
const headerElems = { byline: app.div.querySelector('.byline') }
@@ -1887,7 +1887,7 @@
18871887
aboutModal.querySelector('h2').remove() // remove empty title h2
18881888
aboutModal.querySelector('p').style.cssText = (
18891889
'overflow-wrap: anywhere ; line-height: 1.55 ;'
1890-
+ `margin: ${ env.browser.isPhone ? '9px 0 -16px' : '3px 0 -11px 10px' }`)
1890+
+ `margin: ${ env.browser.isCompact ? '9px 0 -16px' : '3px 0 -11px 10px' }`)
18911891

18921892
// Hack buttons
18931893
aboutModal.querySelectorAll('button').forEach(btn => {
@@ -1948,7 +1948,7 @@
19481948
// Re-style elems
19491949
apiModal.querySelector('h2').style.justifySelf = 'center' // center title
19501950
const btnsDiv = apiModal.querySelector('.modal-buttons')
1951-
btnsDiv.style.cssText = `margin: 18px 0px 6px !important ; ${ env.browser.isPhone ? ''
1951+
btnsDiv.style.cssText = `margin: 18px 0px 6px !important ; ${ env.browser.isCompact ? ''
19521952
: 'flex-wrap: wrap ; justify-content: center ; gap: 9px' }` // gridify wide view btns
19531953
btnsDiv.querySelectorAll('button').forEach((btn, idx) => {
19541954
if (idx == 0) btn.style.display = 'none' // hide Dismiss button
@@ -1975,7 +1975,7 @@
19751975

19761976
// Re-style button cluster
19771977
const btnsDiv = feedbackModal.querySelector('.modal-buttons')
1978-
btnsDiv.style.cssText = `margin-top: 12px !important ; ${ env.browser.isPhone ? ''
1978+
btnsDiv.style.cssText = `margin-top: 12px !important ; ${ env.browser.isCompact ? ''
19791979
: 'flex-wrap: wrap ; justify-content: center ; gap: 9px' }` // gridify wide view btns
19801980

19811981
// Hack buttons
@@ -2602,7 +2602,7 @@
26022602
align-content: center ; /* for symmetrized gaps when odd num of entries */
26032603
list-style: none ; padding: 0 ; margin-bottom: 2px ; /* hide bullets, close bottom gap */
26042604
width: ${ env.browser.isPortrait ? 100 : 50 }% } /* set width based on column cnt */
2605-
${ env.browser.isPhone ? '' : `#${app.slug}-settings ul:first-of-type { /* color desktop middle sep */
2605+
${ env.browser.isCompact ? '' : `#${app.slug}-settings ul:first-of-type { /* color desktop middle sep */
26062606
border-right: 1px dotted ${ appScheme == 'dark' ? 'white' : 'black' }}`}
26072607
#${app.slug}-settings li {
26082608
color: ${ appScheme == 'dark' ? 'rgb(255,255,255,0.65)' : 'rgba(0,0,0,0.45)' };

0 commit comments

Comments
 (0)