|
3 | 3 | // @description Add AI chat & product/category summaries to Amazon shopping, powered by the latest LLMs like GPT-4o! |
4 | 4 | // @author KudoAI |
5 | 5 | // @namespace https://kudoai.com |
6 | | -// @version 2025.10.21.1 |
| 6 | +// @version 2025.10.21.2 |
7 | 7 | // @license MIT |
8 | 8 | // @icon https://amazongpt.kudoai.com/assets/images/icons/app/black-gold-teal/icon48.png?v=8e8ed1c |
9 | 9 | // @icon64 https://amazongpt.kudoai.com/assets/images/icons/app/black-gold-teal/icon64.png?v=8e8ed1c |
|
141 | 141 | env.browser[`is${ platform == 'Firefox' ? 'FF' : platform }`] = chatgpt.browser['is' + platform]()) |
142 | 142 | Object.assign(env.browser, { |
143 | 143 | get isPortrait() { return env.browser.isMobile && (innerWidth < innerHeight) }, |
144 | | - get isPhone() { return env.browser.isMobile && innerWidth <= 480 } |
| 144 | + get isCompact() { return innerWidth <= 480 } |
145 | 145 | }) |
146 | 146 | env.scriptManager.supportsStreaming = /Tampermonkey|ScriptCat/.test(env.scriptManager.name) |
147 | 147 | env.scriptManager.supportsTooltips = env.scriptManager.name == 'Tampermonkey' |
|
403 | 403 | color: #b6b8ba ; fill: #b6b8ba ; animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite } |
404 | 404 | #${app.slug} section.loading { padding-left: 5px } /* left-pad loading status when sending replies */ |
405 | 405 | #${app.slug}-font-size-slider-track { |
406 | | - width: 98% ; height: 7px ; margin: -2px auto ${ env.browser.isPhone ? -8 : -13 }px ; |
| 406 | + width: 98% ; height: 7px ; margin: -2px auto ${ env.browser.isCompact ? -8 : -13 }px ; |
407 | 407 | padding: 15px 0 ; background-color: #ccc ; box-sizing: content-box; background-clip: content-box ; |
408 | 408 | -webkit-background-clip: content-box } |
409 | 409 | #${app.slug}-font-size-slider-track::before { /* to add finger cursor to unpadded core only */ |
|
590 | 590 | }, |
591 | 591 |
|
592 | 592 | bylineVisibility() { |
593 | | - if (env.browser.isPhone) return // since byline hidden by app.styles |
| 593 | + if (env.browser.isCompact) return // since byline hidden by app.styles |
594 | 594 |
|
595 | 595 | // Init header elems |
596 | 596 | const headerElems = { byline: app.div.querySelector('.byline') } |
|
1268 | 1268 | aboutModal.querySelector('h2').remove() // remove empty title h2 |
1269 | 1269 | aboutModal.querySelector('p').style.cssText = ` |
1270 | 1270 | overflow-wrap: anywhere ; line-height: 1.55 ; |
1271 | | - margin: ${ env.browser.isPhone ? '6px 0 -16px' : '0 0 0 21px' }` |
| 1271 | + margin: ${ env.browser.isCompact ? '6px 0 -16px' : '0 0 0 21px' }` |
1272 | 1272 |
|
1273 | 1273 | // Hack buttons |
1274 | 1274 | aboutModal.querySelectorAll('button').forEach(btn => { |
|
1330 | 1330 | // Re-style elems |
1331 | 1331 | apiModal.querySelector('h2').style.justifySelf = 'center' // center title |
1332 | 1332 | const btnsDiv = apiModal.querySelector('.modal-buttons') |
1333 | | - btnsDiv.style.cssText = `margin: 0 !important ; ${ env.browser.isPhone ? '' |
| 1333 | + btnsDiv.style.cssText = `margin: 0 !important ; ${ env.browser.isCompact ? '' |
1334 | 1334 | : 'flex-wrap: wrap ; justify-content: center ; gap: 9px' }` // gridify wide view btns |
1335 | 1335 | btnsDiv.querySelectorAll('button').forEach((btn, idx) => { |
1336 | 1336 | if (idx == 0) btn.style.display = 'none' // hide Dismiss button |
|
1844 | 1844 | } |
1845 | 1845 | .chatgpt-modal > div { |
1846 | 1846 | background-color: white !important ; color: black ; |
1847 | | - padding: ${ env.browser.isPhone ? '22px' : '20px 30px 24px 17px' }!important |
| 1847 | + padding: ${ env.browser.isCompact ? '22px' : '20px 30px 24px 17px' }!important |
1848 | 1848 | } |
1849 | 1849 | .chatgpt-modal p { margin: -8px 0 -14px 4px ; font-size: 22px ; line-height: 31px } |
1850 | 1850 | .chatgpt-modal a { color: #${ appScheme == 'dark' ? '00cfff' : '1e9ebb' } !important } |
|
1930 | 1930 | align-content: center ; /* for symmetrized gaps when odd num of entries */ |
1931 | 1931 | list-style: none ; padding: 0 ; margin: 0 0 2px -3px ; /* hide bullets, close bottom gap */ |
1932 | 1932 | width: ${ env.browser.isPortrait ? 100 : 50 }% } /* set width based on column cnt */ |
1933 | | - ${ env.browser.isPhone ? '' : `#${app.slug}-settings ul:first-of-type { /* color desktop middle sep */ |
| 1933 | + ${ env.browser.isCompact ? '' : `#${app.slug}-settings ul:first-of-type { /* color desktop middle sep */ |
1934 | 1934 | border-right: 1px dotted ${ appScheme == 'dark' ? 'white' : 'black' }}`} |
1935 | 1935 | #${app.slug}-settings li { |
1936 | 1936 | color: ${ appScheme == 'dark' ? 'rgb(255,255,255,0.65)' : 'rgba(0,0,0,0.45)' }; |
|
0 commit comments