Last active
December 1, 2025 21:24
-
-
Save rexxar31/1afe61fbfa27b9991a9a146bd11a676e to your computer and use it in GitHub Desktop.
Chat Improved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Chat Improved | |
| // @namespace test | |
| // @version 2 | |
| // @description Chat Assistant Front-End Interface | |
| // @match https://agents.moderationinterface.com/* | |
| // @require https://cdn.socket.io/4.7.5/socket.io.min.js | |
| // @updateURL https://gist.github.com/rexxar31/1afe61fbfa27b9991a9a146bd11a676e/raw/prodFront.user.js | |
| // @grant window.focus | |
| // @grant GM_addStyle | |
| // @grant GM_getValue | |
| // @grant GM_setValue | |
| // ==/UserScript== | |
| ;(function () { | |
| 'use strict' | |
| // Constants | |
| const CONFIG = { | |
| ui: { | |
| imageSelector: 'img.img-thumbnail[src*="cache.moderationinterface.com"]', | |
| blurAmount: '20px', | |
| hoverText: 'Hover to reveal', | |
| sessionSelector: | |
| 'span.badge.badge-secondary.float-right.ng-star-inserted', | |
| textareaSelector: '#chat-windows-message-textarea', | |
| customerRatingContainer: 'div.card-footer.ng-star-inserted', | |
| }, | |
| server: { | |
| url: 'http://localhost:5000', // Central hub URL | |
| }, | |
| reactivationPhrases: [ | |
| '[please reactivate the user!]', | |
| '[Bitte User reaktivieren!]', | |
| ], | |
| } | |
| // Styles | |
| const STYLES = { | |
| imageBlur: ` | |
| :root { | |
| --blur-amount: ${CONFIG.ui.blurAmount}; | |
| --transition-speed: 0.3s; | |
| --hover-bg: rgba(0, 0, 0, 0.7); | |
| } | |
| .blurred-image { | |
| filter: blur(var(--blur-amount)); | |
| transition: filter var(--transition-speed) ease-in-out; | |
| } | |
| .blurred-image:hover { | |
| filter: blur(0); | |
| } | |
| .image-container { | |
| position: relative; | |
| display: inline-block; | |
| } | |
| .hover-text { | |
| position: absolute; | |
| top: 50%; | |
| left: 50%; | |
| transform: translate(-50%, -50%); | |
| background-color: var(--hover-bg); | |
| color: white; | |
| padding: 5px 10px; | |
| border-radius: 5px; | |
| pointer-events: none; | |
| opacity: 1; | |
| transition: opacity var(--transition-speed) ease-in-out; | |
| } | |
| .image-container:hover .hover-text { | |
| opacity: 0; | |
| }`, | |
| notification: ` | |
| .notification-banner { | |
| position: fixed; | |
| top: 50px; | |
| left: 50%; | |
| transform: translateX(-50%); | |
| background-color: #4CAF50; | |
| color: white; | |
| padding: 12px 24px; | |
| border-radius: 4px; | |
| z-index: 10000; | |
| box-shadow: 0 2px 5px rgba(0,0,0,0.2); | |
| animation: slideDown 0.5s ease-out, fadeOut 0.5s ease-in 2.5s forwards; | |
| }`, | |
| controls: ` | |
| .control-panel { | |
| position: fixed; | |
| top: 10px; | |
| left: 150px; | |
| z-index: 9999; | |
| display: flex; | |
| gap: 10px; | |
| align-items: center; | |
| background: white; | |
| padding: 10px; | |
| border-radius: 5px; | |
| box-shadow: 0 2px 5px rgba(0,0,0,0.2); | |
| font-family: 'Inter', sans-serif; | |
| } | |
| .status-container { | |
| display: flex; | |
| align-items: center; | |
| gap: 8px; | |
| font-weight: 600; | |
| color: #1f1f1f; | |
| } | |
| .status-label { | |
| text-transform: uppercase; | |
| font-size: 12px; | |
| letter-spacing: 0.04em; | |
| color: #4a4a4a; | |
| } | |
| .status-indicator { | |
| width: 12px; | |
| height: 12px; | |
| border-radius: 50%; | |
| background-color: #d93025; | |
| box-shadow: 0 0 4px rgba(0,0,0,0.3); | |
| } | |
| .status-indicator.connected { | |
| background-color: #2ecc71; | |
| } | |
| .status-indicator.disconnected { | |
| background-color: #d93025; | |
| } | |
| .status-text { | |
| font-size: 13px; | |
| color: #1f1f1f; | |
| }`, | |
| } | |
| class UIManager { | |
| const chatAssistant = new ChatAssistant() | |
| window.chatAssistant = chatAssistant | |
| })() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment