|
148 | 148 | // @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (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.bravegpt.com/images/icons/app/icon48.png?v=e8ca7c2 |
154 | 154 | // @icon64 https://assets.bravegpt.com/images/icons/app/icon64.png?v=e8ca7c2 |
|
260 | 260 | } |
261 | 261 | } ; ['Chromium', 'Firefox', 'Chrome', 'Edge', 'Brave', 'Mobile'].forEach(platform => |
262 | 262 | 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 }}) |
267 | 264 | env.userLocale = env.browser.language.includes('-') ? env.browser.language.split('-')[1].toLowerCase() : '' |
268 | 265 | env.scriptManager.supportsStreaming = /Tampermonkey|ScriptCat/.test(env.scriptManager.name) |
269 | 266 | env.scriptManager.supportsTooltips = env.scriptManager.name == 'Tampermonkey' |
|
2224 | 2221 |
|
2225 | 2222 | // Init logo |
2226 | 2223 | 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 ;` |
2229 | 2226 | + 'filter: drop-shadow(5px 5px 15px rgba(0,0,0,0.3))' |
2230 | 2227 |
|
2231 | 2228 | // Init title |
|
2240 | 2237 | const settingsLists = [], middleGap = 30 // px |
2241 | 2238 | const settingsListContainer = dom.create.elem('div') |
2242 | 2239 | 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 |
2244 | 2241 | const settingEntryCap = Math.floor(settingsKeys.length /2) |
2245 | 2242 | for (let i = 0 ; i < settingsListCnt ; i++) settingsLists.push(dom.create.elem('ul')) |
2246 | 2243 | settingsListContainer.style.width = '95%' // pad vs. parent |
|
2260 | 2257 | { id: `${key}-settings-entry`, title: setting.helptip || '' }) |
2261 | 2258 | const settingLabel = dom.create.elem('label', { textContent: setting.label }) |
2262 | 2259 | settingEntry.append(settingLabel); |
2263 | | - (settingsLists[env.browser.isPortrait ? 0 : +(idx >= settingEntryCap)]).append(settingEntry) |
| 2260 | + (settingsLists[env.browser.isCompact ? 0 : +(idx >= settingEntryCap)]).append(settingEntry) |
2264 | 2261 |
|
2265 | 2262 | // Create/prepend icons |
2266 | 2263 | const settingIcon = icons.create({ key: setting.icon }) |
|
2408 | 2405 | this.styles.textContent = ` |
2409 | 2406 | #${app.slug}-settings { |
2410 | 2407 | 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 ; |
2412 | 2409 | word-wrap: break-word ; border-radius: 15px ; |
2413 | 2410 | ${ appScheme == 'dark' ? 'stroke: white ; fill: white' : 'stroke: black ; fill: black' }; |
2414 | 2411 | --shadow: 0 30px 60px rgba(0,0,0,0.12) ; box-shadow: var(--shadow) ; |
|
2419 | 2416 | margin: 0 ${ env.browser.isMobile ? -31 : -6 }px -3px 0 |
2420 | 2417 | } |
2421 | 2418 | #${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 ; |
2423 | 2420 | margin: -31px 17px 7px 0 |
2424 | 2421 | } |
2425 | 2422 | #${app.slug}-settings ul { |
2426 | 2423 | align-content: center ; /* for symmetrized gaps when odd num of entries */ |
2427 | 2424 | 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 */ |
2429 | 2426 | } |
2430 | 2427 | ${ env.browser.isCompact ? '' : `#${app.slug}-settings ul:first-of-type { /* color desktop middle sep */ |
2431 | 2428 | border-right: 1px dotted ${ appScheme == 'dark' ? 'white' : 'black' }}`} |
|
2479 | 2476 | } |
2480 | 2477 | #about-settings-entry span { color: ${ appScheme == 'dark' ? '#28ee28' : 'green' }} |
2481 | 2478 | #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 ; |
2483 | 2480 | ${ config.fgAnimationsDisabled ? '' : // fade edges |
2484 | 2481 | `mask-image: linear-gradient( |
2485 | 2482 | to right, transparent, black 20%, black 89%, transparent) ; |
|
0 commit comments