|
148 | 148 | // @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!) |
149 | 149 | // @author KudoAI |
150 | 150 | // @namespace https://kudoai.com |
151 | | -// @version 2025.11.3 |
| 151 | +// @version 2025.11.5 |
152 | 152 | // @license MIT |
153 | 153 | // @icon https://assets.ddgpt.com/images/icons/app/icon48.png?v=533ce0f |
154 | 154 | // @icon64 https://assets.ddgpt.com/images/icons/app/icon64.png?v=533ce0f |
|
261 | 261 | } |
262 | 262 | } ; ['Chromium', 'Firefox', 'Chrome', 'Edge', 'Brave', 'Mobile'].forEach(platform => |
263 | 263 | 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 }}) |
268 | 265 | env.userLocale = env.browser.language.includes('-') ? env.browser.language.split('-')[1].toLowerCase() : '' |
269 | 266 | env.scriptManager.supportsStreaming = /Tampermonkey|ScriptCat/.test(env.scriptManager.name) |
270 | 267 | env.scriptManager.supportsTooltips = env.scriptManager.name == 'Tampermonkey' |
|
2244 | 2241 | const settingsLists = [], middleGap = 30 // px |
2245 | 2242 | const settingsListContainer = dom.create.elem('div') |
2246 | 2243 | 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 |
2248 | 2245 | const settingEntryCap = Math.floor(settingsKeys.length /2) |
2249 | 2246 | for (let i = 0 ; i < settingsListCnt ; i++) settingsLists.push(dom.create.elem('ul')) |
2250 | 2247 | settingsListContainer.style.width = '95%' // pad vs. parent |
|
2264 | 2261 | { id: `${key}-settings-entry`, title: setting.helptip || '' }) |
2265 | 2262 | const settingLabel = dom.create.elem('label', { textContent: setting.label }) |
2266 | 2263 | settingEntry.append(settingLabel); |
2267 | | - (settingsLists[env.browser.isPortrait ? 0 : +(idx >= settingEntryCap)]).append(settingEntry) |
| 2264 | + (settingsLists[env.browser.isCompact ? 0 : +(idx >= settingEntryCap)]).append(settingEntry) |
2268 | 2265 |
|
2269 | 2266 | // Create/prepend icons |
2270 | 2267 | const settingIcon = icons.create({ key: setting.icon }) |
|
2411 | 2408 | if (!this.styles?.isConnected) document.head.append(this.styles ||= dom.create.style()) |
2412 | 2409 | this.styles.textContent = ` |
2413 | 2410 | #${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 ; |
2415 | 2412 | word-wrap: break-word ; border-radius: 15px ; |
2416 | 2413 | ${ appScheme == 'dark' ? 'stroke: white ; fill: white' : 'stroke: black ; fill: black' }; |
2417 | 2414 | --shadow: 0 30px 60px rgba(0,0,0,0.12) ; box-shadow: var(--shadow) ; |
|
2420 | 2417 | #${app.slug}-settings-title { |
2421 | 2418 | font-weight: bold ; line-height: 19px ; text-align: center ; margin: 0 3px -3px 0 } |
2422 | 2419 | #${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 } |
2424 | 2421 | #${app.slug}-settings ul { |
2425 | 2422 | align-content: center ; /* for symmetrized gaps when odd num of entries */ |
2426 | 2423 | 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 */ |
2428 | 2425 | } |
2429 | 2426 | ${ env.browser.isCompact ? '' : `#${app.slug}-settings ul:first-of-type { /* color desktop middle sep */ |
2430 | 2427 | border-right: 1px dotted ${ appScheme == 'dark' ? 'white' : 'black' }}`} |
|
2478 | 2475 | } |
2479 | 2476 | #about-settings-entry span { color: ${ appScheme == 'dark' ? '#28ee28' : 'green' }} |
2480 | 2477 | #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 ; |
2482 | 2479 | ${ config.fgAnimationsDisabled ? '' : // fade edges |
2483 | 2480 | `mask-image: linear-gradient( |
2484 | 2481 | to right, transparent, black 20%, black 89%, transparent) ; |
|
0 commit comments