|
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.9.20 |
| 151 | +// @version 2025.9.20.1 |
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 |
|
206 | 206 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@f4da9d4/assets/js/lib/chatbot/log.js#sha256-kjt26UXbx44I0/iDOf50F/LbRtsYcSwMHrexImR4D5A= |
207 | 207 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@199128d/assets/js/lib/chatbot/prompts.js#sha256-6U2C3dVLpYixR3UCNABCfvNpRa/9gJZYR8fElXmhGVk= |
208 | 208 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@4565425/assets/js/lib/chatbot/session.js#sha256-cH2e3l2bZQRekQHxaeSShdNguqD41evEOkMrrVIydHQ= |
| 209 | +// @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@1861401/assets/js/lib/chatbot/themes.js#sha256-ujpN5pwFdqQjF4UCsu7Pgge1aHbl6jNmbmcvw3AwoVM= |
209 | 210 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@3b0bccd/assets/js/lib/chatbot/ui.js#sha256-oN097tZtsr57Do6gpjDuRTQ1iLr3HzFxWmUmICvYD3c= |
210 | 211 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@4565425/assets/js/lib/chatbot/userscript.js#sha256-DTD+Tj/9angBw8/Q4e8PMz2SBwueqvNzeY8PwZlMgbs= |
211 | 212 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@1e84c2e/assets/js/lib/dom.js/dist/dom.min.js#sha256-xovdxRnmYD/eCgBiGCu5+Vd3+WWIvLUKVtU/MnRueeU= |
|
419 | 420 |
|
420 | 421 | // Define UI functions |
421 | 422 |
|
422 | | - const themes = { |
423 | | - apply(theme) { |
424 | | - if (!this.styleNode) document.head.append(this.styleNode = dom.create.style()) |
425 | | - this.styleNode.textContent = this.styles[theme] |
426 | | - }, |
427 | | - |
428 | | - selectors: { |
429 | | - btn: { |
430 | | - get after() { return this.shared.split(',').map(sel => `${sel}::after`).join(', ') }, |
431 | | - get before() { return this.shared.split(',').map(sel => `${sel}::before`).join(', ') }, |
432 | | - get hover() { return this.shared.split(',').map(sel => `${sel}:hover`).join(', ') }, |
433 | | - get hoverAfter() { return this.hover.split(',').map(sel => `${sel}::after`).join(', ') }, |
434 | | - get hoverBefore() { return this.hover.split(',').map(sel => `${sel}::before`).join(', ') }, |
435 | | - get hoverSVG() { return this.hover.split(',').map(sel => `${sel} svg`).join(', ') }, |
436 | | - modal: `body:has(#${app.slug}) .modal-buttons button`, |
437 | | - modalPrimary: `body:has(#${app.slug}) .primary-modal-btn`, |
438 | | - get shared() { return `${this.modal},${this.standby}` }, |
439 | | - get span() { return this.shared.split(',').map(sel => `${sel} span`).join(', ') }, |
440 | | - standby: `button.${app.slug}-standby-btn`, |
441 | | - get svg() { return this.shared.split(',').map(sel => `${sel} svg`).join(', ') } |
442 | | - } |
443 | | - }, |
444 | | - |
445 | | - styles: { |
446 | | - get lines() { const { selectors } = themes ; return ` |
447 | | -
|
448 | | - /* General button styles */ |
449 | | - ${selectors.btn.shared} { |
450 | | - --content-color: ${ env.ui.app.scheme == 'light' ? '0,0,0' : '255,255,255' }; |
451 | | - --side-line-fill: linear-gradient(rgb(var(--content-color)), rgb(var(--content-color))) ; |
452 | | - --skew: skew(-13deg) ; --counter-skew: skew(13deg) ; --btn-svg-zoom: scale(1.2) ; |
453 | | - --btn-transition: 0.1s ease all ; |
454 | | - position: relative ; border-width: 1px ; cursor: crosshair ; |
455 | | - border: 1px solid rgb(var(--content-color)) ; |
456 | | - background: /* side lines */ |
457 | | - var(--side-line-fill) left / 2px 50% no-repeat, |
458 | | - var(--side-line-fill) right / 2px 50% no-repeat ; |
459 | | - background-position-y: 81% ; |
460 | | - background-color: #ffffff00 ; /* clear bg */ |
461 | | - color: rgba(var(--content-color), ${ env.ui.app.scheme == 'light' ? 0.85 : 1 }) ; |
462 | | - font-size: 0.8em ; font-family: "Roboto", sans-serif ; text-transform: uppercase } |
463 | | - ${selectors.btn.svg} { |
464 | | - stroke: rgba(var(--content-color), ${ env.ui.app.scheme == 'light' ? 0.65 : 1 }) ; |
465 | | - ${ config.fgAnimationsDisabled ? '' : `transition: var(--btn-transition) ; |
466 | | - -webkit-transition: var(--btn-transition) ; -moz-transition: var(--btn-transition) ; |
467 | | - -o-transition: var(--btn-transition) ; -ms-transition: var(--btn-transition)` }} |
468 | | - ${selectors.btn.span} { font-weight: 600 ; display: inline-block } /* text */ |
469 | | - ${selectors.btn.before}, ${selectors.btn.after} { /* top/bottom lines */ |
470 | | - content: "" ; position: absolute ; background: rgb(var(--content-color)) ; |
471 | | - ${ config.fgAnimationsDisabled ? '' : `transition: var(--btn-transition) ; |
472 | | - -webkit-transition: var(--btn-transition) ; -moz-transition: var(--btn-transition) ; |
473 | | - -o-transition: var(--btn-transition) ; -ms-transition: var(--btn-transition)` }} |
474 | | - ${selectors.btn.before} { top: 0 ; left: 10% ; width: 65% ; height: 1px } /* top line */ |
475 | | - ${selectors.btn.after} { bottom: 0 ; right: 10% ; width: 80% ; height: 1px } /* bottom line */ |
476 | | - ${selectors.btn.hover} { |
477 | | - color: rgb(var(--content-color)) ; |
478 | | - background: /* extend side lines */ |
479 | | - var(--side-line-fill) left / 2px 100% no-repeat, |
480 | | - var(--side-line-fill) right / 2px 100% no-repeat !important } |
481 | | - ${selectors.btn.hoverBefore} { left: 0 ; width: 20px } /* top line on hover */ |
482 | | - ${selectors.btn.hoverAfter} { right: 0 ; width: 20px } /* bottom line on hover */ |
483 | | - ${selectors.btn.hoverSVG} { transform: var(--btn-svg-zoom) ; stroke: rgba(var(--content-color),1) } |
484 | | -
|
485 | | - /* Modal styles */ |
486 | | - .${modals.class} { border-radius: 0 !important } /* square the corners to match the buttons */ |
487 | | -
|
488 | | - /* Modal button styles */ |
489 | | - ${selectors.btn.modal} { |
490 | | - --modal-btn-y-offset: 2px ; --glow-color: #a0fdff ; |
491 | | - --modal-btn-zoom: scale(1.075) ; |
492 | | - --modal-btn-transition: transform 0.1s ease, background 0.2s ease, box-shadow 0.5s ease ; |
493 | | - ${ config.fgAnimationsDisabled ? /* override chatgpt.js transitions */ |
494 | | - `transition: none ; |
495 | | - -webkit-transition: none ; -moz-transition: none ; |
496 | | - -o-transition: none ; -ms-transition: none` |
497 | | - : `transition: var(--modal-btn-transition) ; |
498 | | - -webkit-transition: var(--modal-btn-transition) ; |
499 | | - -moz-transition: var(--modal-btn-transition) ; |
500 | | - -o-transition: var(--modal-btn-transition) ; |
501 | | - -ms-transition: var(--modal-btn-transition)` }} |
502 | | - ${selectors.btn.modalPrimary} { |
503 | | - ${ env.ui.app.scheme == 'dark' ? 'background-color: white !important ; color: black' |
504 | | - : 'background-color: black !important ; color: white' }} |
505 | | - ${selectors.btn.modal}:nth-child(odd) { |
506 | | - transform: translateY(calc(-1 * var(--modal-btn-y-offset))) } |
507 | | - ${selectors.btn.modal}:nth-child(even) { |
508 | | - transform: translateY(var(--modal-btn-y-offset)) } |
509 | | - ${selectors.btn.modal}:nth-child(odd):hover { |
510 | | - transform: translateY(calc(-1 * var(--modal-btn-y-offset))) ${ |
511 | | - env.browser.isMobile ? '' : 'var(--modal-btn-zoom)' }} |
512 | | - ${selectors.btn.modal}:nth-child(even):hover { |
513 | | - transform: translateY(var(--modal-btn-y-offset)) ${ |
514 | | - env.browser.isMobile ? '' : 'var(--modal-btn-zoom)' }} |
515 | | - ${selectors.btn.modal}:hover { /* add glow */ |
516 | | - background-color: var(--glow-color) !important ; |
517 | | - box-shadow: 2px 1px 30px var(--glow-color) ; |
518 | | - -webkit-box-shadow: 2px 1px 30px var(--glow-color) ; |
519 | | - -moz-box-shadow: 2px 1px 30px var(--glow-color) } |
520 | | -
|
521 | | - /* Standby button styles */ |
522 | | - ${selectors.btn.standby} { |
523 | | - --standby-btn-transition: transform 0.18s ease, background 0.2s ease ; |
524 | | - font-size: 10px ; width: 80% ; height: 43px ; margin-bottom: 13px } |
525 | | - ${selectors.btn.standby}:nth-child(odd) { margin-right: 20% ; margin-left: 15px } |
526 | | - ${selectors.btn.standby}:nth-child(even) { margin-left: 20% ; margin-bottom: 19px } |
527 | | - ${selectors.btn.standby}:hover { |
528 | | - border : 1px rgba(var(--content-color), ${ |
529 | | - env.ui.app.scheme == 'dark' ? '1) solid' : '0.6) dotted' }}` |
530 | | - } |
531 | | - } |
532 | | - } |
533 | | - |
534 | 423 | window.update = { |
535 | 424 |
|
536 | 425 | appBottomPos() { app.div.style.bottom = `${ config.minimized ? 48 - app.div.offsetHeight : -32 }px` }, |
|
0 commit comments