|
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.9.20 |
| 152 | +// @version 2025.9.20.1 |
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 |
|
396 | 396 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@f4da9d4/assets/js/lib/chatbot/log.js#sha256-kjt26UXbx44I0/iDOf50F/LbRtsYcSwMHrexImR4D5A= |
397 | 397 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@199128d/assets/js/lib/chatbot/prompts.js#sha256-6U2C3dVLpYixR3UCNABCfvNpRa/9gJZYR8fElXmhGVk= |
398 | 398 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@4565425/assets/js/lib/chatbot/session.js#sha256-cH2e3l2bZQRekQHxaeSShdNguqD41evEOkMrrVIydHQ= |
| 399 | +// @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@1861401/assets/js/lib/chatbot/themes.js#sha256-ujpN5pwFdqQjF4UCsu7Pgge1aHbl6jNmbmcvw3AwoVM= |
399 | 400 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@3b0bccd/assets/js/lib/chatbot/ui.js#sha256-oN097tZtsr57Do6gpjDuRTQ1iLr3HzFxWmUmICvYD3c= |
400 | 401 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@4565425/assets/js/lib/chatbot/userscript.js#sha256-DTD+Tj/9angBw8/Q4e8PMz2SBwueqvNzeY8PwZlMgbs= |
401 | 402 | // @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= |
|
613 | 614 |
|
614 | 615 | // Define UI functions |
615 | 616 |
|
616 | | - const themes = { |
617 | | - apply(theme) { |
618 | | - if (!this.styleNode) document.head.append(this.styleNode = dom.create.style()) |
619 | | - this.styleNode.textContent = this.styles[theme] |
620 | | - }, |
621 | | - |
622 | | - selectors: { |
623 | | - btn: { |
624 | | - get after() { return this.shared.split(',').map(sel => `${sel}::after`).join(', ') }, |
625 | | - get before() { return this.shared.split(',').map(sel => `${sel}::before`).join(', ') }, |
626 | | - get hover() { return this.shared.split(',').map(sel => `${sel}:hover`).join(', ') }, |
627 | | - get hoverAfter() { return this.hover.split(',').map(sel => `${sel}::after`).join(', ') }, |
628 | | - get hoverBefore() { return this.hover.split(',').map(sel => `${sel}::before`).join(', ') }, |
629 | | - get hoverSVG() { return this.hover.split(',').map(sel => `${sel} svg`).join(', ') }, |
630 | | - modal: `body:has(#${app.slug}) .modal-buttons button`, |
631 | | - modalPrimary: `body:has(#${app.slug}) .primary-modal-btn`, |
632 | | - get shared() { return `${this.modal},${this.standby}` }, |
633 | | - get span() { return this.shared.split(',').map(sel => `${sel} span`).join(', ') }, |
634 | | - standby: `button.${app.slug}-standby-btn`, |
635 | | - get svg() { return this.shared.split(',').map(sel => `${sel} svg`).join(', ') } |
636 | | - } |
637 | | - }, |
638 | | - |
639 | | - styles: { |
640 | | - get lines() { const { selectors } = themes ; return ` |
641 | | -
|
642 | | - /* General button styles */ |
643 | | - ${selectors.btn.shared} { |
644 | | - --content-color: ${ env.ui.app.scheme == 'light' ? '0,0,0' : '255,255,255' }; |
645 | | - --side-line-fill: linear-gradient(rgb(var(--content-color)), rgb(var(--content-color))) ; |
646 | | - --skew: skew(-13deg) ; --counter-skew: skew(13deg) ; --btn-svg-zoom: scale(1.2) ; |
647 | | - --btn-transition: 0.1s ease all ; |
648 | | - position: relative ; border-width: 1px ; cursor: crosshair ; |
649 | | - border: 1px solid rgb(var(--content-color)) ; |
650 | | - background: /* side lines */ |
651 | | - var(--side-line-fill) left / 2px 50% no-repeat, |
652 | | - var(--side-line-fill) right / 2px 50% no-repeat ; |
653 | | - background-position-y: 81% ; |
654 | | - background-color: #ffffff00 ; /* clear bg */ |
655 | | - color: rgba(var(--content-color), ${ env.ui.app.scheme == 'light' ? 0.85 : 1 }) ; |
656 | | - font-size: 0.8em ; font-family: "Roboto", sans-serif ; text-transform: uppercase } |
657 | | - ${selectors.btn.svg} { |
658 | | - stroke: rgba(var(--content-color), ${ env.ui.app.scheme == 'light' ? 0.65 : 1 }) ; |
659 | | - ${ config.fgAnimationsDisabled ? '' : `transition: var(--btn-transition) ; |
660 | | - -webkit-transition: var(--btn-transition) ; -moz-transition: var(--btn-transition) ; |
661 | | - -o-transition: var(--btn-transition) ; -ms-transition: var(--btn-transition)` }} |
662 | | - ${selectors.btn.span} { font-weight: 600 ; display: inline-block } /* text */ |
663 | | - ${selectors.btn.before}, ${selectors.btn.after} { /* top/bottom lines */ |
664 | | - content: "" ; position: absolute ; background: rgb(var(--content-color)) ; |
665 | | - ${ config.fgAnimationsDisabled ? '' : `transition: var(--btn-transition) ; |
666 | | - -webkit-transition: var(--btn-transition) ; -moz-transition: var(--btn-transition) ; |
667 | | - -o-transition: var(--btn-transition) ; -ms-transition: var(--btn-transition)` }} |
668 | | - ${selectors.btn.before} { top: 0 ; left: 10% ; width: 65% ; height: 1px } /* top line */ |
669 | | - ${selectors.btn.after} { bottom: 0 ; right: 10% ; width: 80% ; height: 1px } /* bottom line */ |
670 | | - ${selectors.btn.hover} { |
671 | | - color: rgb(var(--content-color)) ; |
672 | | - background: /* extend side lines */ |
673 | | - var(--side-line-fill) left / 2px 100% no-repeat, |
674 | | - var(--side-line-fill) right / 2px 100% no-repeat !important } |
675 | | - ${selectors.btn.hoverBefore} { left: 0 ; width: 20px } /* top line on hover */ |
676 | | - ${selectors.btn.hoverAfter} { right: 0 ; width: 20px } /* bottom line on hover */ |
677 | | - ${selectors.btn.hoverSVG} { transform: var(--btn-svg-zoom) ; stroke: rgba(var(--content-color),1) } |
678 | | -
|
679 | | - /* Modal styles */ |
680 | | - .${modals.class} { border-radius: 0 !important } /* square the corners to match the buttons */ |
681 | | -
|
682 | | - /* Modal button styles */ |
683 | | - ${selectors.btn.modal} { |
684 | | - --modal-btn-y-offset: 2px ; --glow-color: #a0fdff ; |
685 | | - --modal-btn-zoom: scale(1.075) ; |
686 | | - --modal-btn-transition: transform 0.1s ease, background 0.2s ease, box-shadow 0.5s ease ; |
687 | | - ${ config.fgAnimationsDisabled ? /* override chatgpt.js transitions */ |
688 | | - `transition: none ; |
689 | | - -webkit-transition: none ; -moz-transition: none ; |
690 | | - -o-transition: none ; -ms-transition: none` |
691 | | - : `transition: var(--modal-btn-transition) ; |
692 | | - -webkit-transition: var(--modal-btn-transition) ; |
693 | | - -moz-transition: var(--modal-btn-transition) ; |
694 | | - -o-transition: var(--modal-btn-transition) ; |
695 | | - -ms-transition: var(--modal-btn-transition)` }} |
696 | | - ${selectors.btn.modalPrimary} { |
697 | | - ${ env.ui.app.scheme == 'dark' ? 'background-color: white !important ; color: black' |
698 | | - : 'background-color: black !important ; color: white' }} |
699 | | - ${selectors.btn.modal}:nth-child(odd) { |
700 | | - transform: translateY(calc(-1 * var(--modal-btn-y-offset))) } |
701 | | - ${selectors.btn.modal}:nth-child(even) { |
702 | | - transform: translateY(var(--modal-btn-y-offset)) } |
703 | | - ${selectors.btn.modal}:nth-child(odd):hover { |
704 | | - transform: translateY(calc(-1 * var(--modal-btn-y-offset))) ${ |
705 | | - env.browser.isMobile ? '' : 'var(--modal-btn-zoom)' }} |
706 | | - ${selectors.btn.modal}:nth-child(even):hover { |
707 | | - transform: translateY(var(--modal-btn-y-offset)) ${ |
708 | | - env.browser.isMobile ? '' : 'var(--modal-btn-zoom)' }} |
709 | | - ${selectors.btn.modal}:hover { /* add glow */ |
710 | | - background-color: var(--glow-color) !important ; |
711 | | - box-shadow: 2px 1px 30px var(--glow-color) ; |
712 | | - -webkit-box-shadow: 2px 1px 30px var(--glow-color) ; |
713 | | - -moz-box-shadow: 2px 1px 30px var(--glow-color) } |
714 | | -
|
715 | | - /* Standby button styles */ |
716 | | - ${selectors.btn.standby} { |
717 | | - --standby-btn-transition: transform 0.18s ease, background 0.2s ease ; |
718 | | - font-size: 11px ; width: 80% ; height: 51px ; margin-bottom: 16px } |
719 | | - ${selectors.btn.standby}:nth-child(odd) { margin-right: 20% ; margin-left: 15px } |
720 | | - ${selectors.btn.standby}:nth-child(even) { margin-left: 20% ; margin-bottom: 19px } |
721 | | - ${selectors.btn.standby}:hover { |
722 | | - border : 1px rgba(var(--content-color), ${ |
723 | | - env.ui.app.scheme == 'dark' ? '1) solid' : '0.6) dotted' }}` |
724 | | - } |
725 | | - } |
726 | | - } |
727 | | - |
728 | 617 | window.update = { |
729 | 618 |
|
730 | 619 | appBottomPos() { app.div.style.bottom = `${ config.minimized ? 22 - app.div.offsetHeight : -33 }px` }, |
|
0 commit comments