|
149 | 149 | // @description:zu Yengeza izimpendulo ze-AI ku-Google Search (inikwa amandla yi-Google Gemma + GPT-4o!) |
150 | 150 | // @author KudoAI |
151 | 151 | // @namespace https://kudoai.com |
152 | | -// @version 2025.11.3 |
| 152 | +// @version 2025.11.5 |
153 | 153 | // @license MIT |
154 | 154 | // @icon data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22170.667%22%20height=%22170.667%22%3E%3Cstyle%3E:root%7B--fill:%23000%7D@media%20(prefers-color-scheme:dark)%7B:root%7B--fill:%23fff%7D%7D%3C/style%3E%3Cpath%20fill=%22var(--fill)%22%20d=%22M82.346%20159.79c-18.113-1.815-31.78-9.013-45.921-24.184C23.197%20121.416%2017.333%20106.18%2017.333%2086c0-21.982%205.984-36.245%2021.87-52.131C55.33%2017.74%2069.27%2011.867%2091.416%2011.867c17.574%200%2029.679%203.924%2044.309%2014.363l8.57%206.116-8.705%208.705-8.704%208.704-4.288-3.608c-13.91-11.704-35.932-14.167-53.085-5.939-3.4%201.631-9.833%206.601-14.297%2011.045C44.669%2061.753%2040.95%2070.811%2040.95%2086c0%2014.342%203.594%2023.555%2013.26%2033.995%2019.088%2020.618%2048.46%2022.539%2070.457%204.608l5.333-4.348%2011.333%203.844c6.234%202.114%2011.54%203.857%2011.791%203.873.252.015-2.037%203.008-5.087%206.65-6.343%207.577-20.148%2017.217-30.493%2021.295-8.764%203.454-23.358%205.06-35.198%203.873zM92%2086.333V74.667h60.648l-11.41%2011.41-11.411%2011.41-18.914.257L92%2098z%22/%3E%3C/svg%3E |
155 | 155 | // @icon64 data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22170.667%22%20height=%22170.667%22%3E%3Cstyle%3E:root%7B--fill:%23000%7D@media%20(prefers-color-scheme:dark)%7B:root%7B--fill:%23fff%7D%7D%3C/style%3E%3Cpath%20fill=%22var(--fill)%22%20d=%22M82.346%20159.79c-18.113-1.815-31.78-9.013-45.921-24.184C23.197%20121.416%2017.333%20106.18%2017.333%2086c0-21.982%205.984-36.245%2021.87-52.131C55.33%2017.74%2069.27%2011.867%2091.416%2011.867c17.574%200%2029.679%203.924%2044.309%2014.363l8.57%206.116-8.705%208.705-8.704%208.704-4.288-3.608c-13.91-11.704-35.932-14.167-53.085-5.939-3.4%201.631-9.833%206.601-14.297%2011.045C44.669%2061.753%2040.95%2070.811%2040.95%2086c0%2014.342%203.594%2023.555%2013.26%2033.995%2019.088%2020.618%2048.46%2022.539%2070.457%204.608l5.333-4.348%2011.333%203.844c6.234%202.114%2011.54%203.857%2011.791%203.873.252.015-2.037%203.008-5.087%206.65-6.343%207.577-20.148%2017.217-30.493%2021.295-8.764%203.454-23.358%205.06-35.198%203.873zM92%2086.333V74.667h60.648l-11.41%2011.41-11.411%2011.41-18.914.257L92%2098z%22/%3E%3C/svg%3E |
|
451 | 451 | } |
452 | 452 | } ; ['Chromium', 'Firefox', 'Chrome', 'Edge', 'Brave', 'Mobile'].forEach(platform => |
453 | 453 | env.browser[`is${ platform == 'Firefox' ? 'FF' : platform }`] = chatgpt.browser['is' + platform]()) |
454 | | - Object.assign(env.browser, { |
455 | | - get isPortrait() { return env.browser.isMobile && (innerWidth < innerHeight) }, |
456 | | - get isCompact() { return innerWidth <= 480 } |
457 | | - }) |
| 454 | + Object.assign(env.browser, { get isCompact() { return innerWidth <= 480 }}) |
458 | 455 | env.userLocale = location.hostname.endsWith('.com') ? 'us' : location.hostname.split('.').pop() |
459 | 456 | env.scriptManager.supportsStreaming = /Tampermonkey|ScriptCat/.test(env.scriptManager.name) |
460 | 457 | env.scriptManager.supportsTooltips = env.scriptManager.name == 'Tampermonkey' |
|
2400 | 2397 |
|
2401 | 2398 | // Init logo |
2402 | 2399 | const settingsIcon = icons.googlegpt.create() |
2403 | | - settingsIcon.style.cssText += `width: ${ env.browser.isPortrait ? 64 : 65 }px ; |
2404 | | - margin: 13px 0 ${ env.browser.isPortrait ? '-35' : '-27' }px ; |
| 2400 | + settingsIcon.style.cssText += `width: ${ env.browser.isCompact ? 64 : 65 }px ; |
| 2401 | + margin: 13px 0 ${ env.browser.isCompact ? '-35' : '-27' }px ; |
2405 | 2402 | position: relative ; top: -42px ; ${ |
2406 | | - env.browser.isPortrait ? 'left: 6px' : '' }` |
| 2403 | + env.browser.isCompact ? 'left: 6px' : '' }` |
2407 | 2404 | // Init title |
2408 | 2405 | const settingsTitleDiv = dom.create.elem('div', { id: `${app.slug}-settings-title` }), |
2409 | 2406 | settingsTitleIcon = icons.create({ key: 'sliders' }), |
|
2416 | 2413 | const settingsLists = [], middleGap = 30 // px |
2417 | 2414 | const settingsListContainer = dom.create.elem('div') |
2418 | 2415 | const settingsListCnt = ( |
2419 | | - env.browser.isMobile && ( env.browser.isPortrait || settingsKeys.length < 8 )) ? 1 : 2 |
| 2416 | + env.browser.isMobile && ( env.browser.isCompact || settingsKeys.length < 8 )) ? 1 : 2 |
2420 | 2417 | const settingEntryCap = Math.floor(settingsKeys.length /2) |
2421 | 2418 | for (let i = 0 ; i < settingsListCnt ; i++) settingsLists.push(dom.create.elem('ul')) |
2422 | 2419 | settingsListContainer.style.width = '95%' // pad vs. parent |
|
2436 | 2433 | { id: `${key}-settings-entry`, title: setting.helptip || '' }) |
2437 | 2434 | const settingLabel = dom.create.elem('label', { textContent: setting.label }) |
2438 | 2435 | settingEntry.append(settingLabel); |
2439 | | - (settingsLists[env.browser.isPortrait ? 0 : +(idx >= settingEntryCap)]).append(settingEntry) |
| 2436 | + (settingsLists[env.browser.isCompact ? 0 : +(idx >= settingEntryCap)]).append(settingEntry) |
2440 | 2437 |
|
2441 | 2438 | // Create/prepend icons |
2442 | 2439 | const settingIcon = icons.create({ key: setting.icon }) |
|
2583 | 2580 | if (!this.styles?.isConnected) document.head.append(this.styles ||= dom.create.style()) |
2584 | 2581 | this.styles.textContent = ` |
2585 | 2582 | #${app.slug}-settings { |
2586 | | - min-width: ${ env.browser.isPortrait ? 288 : 698 }px ; max-width: 75vw ; word-wrap: break-word ; |
| 2583 | + min-width: ${ env.browser.isCompact ? 288 : 698 }px ; max-width: 75vw ; word-wrap: break-word ; |
2587 | 2584 | margin: 12px 23px ; border-radius: 15px ; |
2588 | 2585 | ${ appScheme == 'dark' ? 'stroke: white ; fill: white' : 'stroke: black ; fill: black' }; |
2589 | 2586 | --shadow: 0 30px 60px rgba(0,0,0,0.12) ; box-shadow: var(--shadow) ; |
2590 | 2587 | -webkit-box-shadow: var(--shadow) ; -moz-box-shadow: var(--shadow) |
2591 | 2588 | } |
2592 | 2589 | #${app.slug}-settings-title { |
2593 | 2590 | font-weight: bold ; line-height: 19px ; text-align: center ; |
2594 | | - margin: 0 -6px ${ env.browser.isPortrait ? 2 : -15 }px 0 |
| 2591 | + margin: 0 -6px ${ env.browser.isCompact ? 2 : -15 }px 0 |
2595 | 2592 | } |
2596 | 2593 | #${app.slug}-settings-title h4 { |
2597 | | - font-size: ${ env.browser.isPortrait ? 22 : 29 }px ; font-weight: bold ; |
2598 | | - margin: 0 0 ${ env.browser.isPortrait ? 9 : 27 }px |
| 2594 | + font-size: ${ env.browser.isCompact ? 22 : 29 }px ; font-weight: bold ; |
| 2595 | + margin: 0 0 ${ env.browser.isCompact ? 9 : 27 }px |
2599 | 2596 | } |
2600 | 2597 | #${app.slug}-settings ul { |
2601 | 2598 | align-content: center ; /* for symmetrized gaps when odd num of entries */ |
2602 | 2599 | list-style: none ; padding: 0 ; margin-bottom: 2px ; /* hide bullets, close bottom gap */ |
2603 | | - width: ${ env.browser.isPortrait ? 100 : 50 }% /* set width based on column cnt */ |
| 2600 | + width: ${ env.browser.isCompact ? 100 : 50 }% /* set width based on column cnt */ |
2604 | 2601 | } |
2605 | 2602 | ${ env.browser.isCompact ? '' : `#${app.slug}-settings ul:first-of-type { /* color desktop middle sep */ |
2606 | 2603 | border-right: 1px dotted ${ appScheme == 'dark' ? 'white' : 'black' }}`} |
|
2654 | 2651 | } |
2655 | 2652 | #about-settings-entry span { color: ${ appScheme == 'dark' ? '#28ee28' : 'green' }} |
2656 | 2653 | #about-settings-entry > span { /* outer About status span */ |
2657 | | - width: ${ env.browser.isPortrait ? '15vw' : '95px' }; height: 20px ; overflow: hidden ; |
2658 | | - ${ env.browser.isPortrait ? 'position: relative ; bottom: 3px ;' : '' } /* v-align */ |
| 2654 | + width: ${ env.browser.isCompact ? '15vw' : '95px' }; height: 20px ; overflow: hidden ; |
| 2655 | + ${ env.browser.isCompact ? 'position: relative ; bottom: 3px ;' : '' } /* v-align */ |
2659 | 2656 | ${ config.fgAnimationsDisabled ? '' : // fade edges |
2660 | 2657 | `mask-image: linear-gradient( |
2661 | 2658 | to right, transparent, black 20%, black 89%, transparent) ; |
|
0 commit comments