The Elder Scroll
- User
The Elder Scroll
- Assistant
It seems like you've mentioned "The Elder Scroll." If you're referring to "The Elder Scrolls," it's a popular series of action role-playing video games developed by Bethesda Game Studios. The series is known for its expansive open worlds, rich lore, and freedom of choice in character development and story progression.
The most notable titles in the series include:
- The Elder Scrolls: Arena (1994)
- The Elder Scrolls II: Daggerfall (1996)
- The Elder Scrolls III: Morrowind (2002)
- The Elder Scrolls IV: Oblivion (2006)
- The Elder Scrolls V: Skyrim (2011)
The series is set in the fictional continent of Tamriel and features a variety of races and cultures, as well as a deep mythology involving dragons, gods, and mystical artifacts.
The Elder Scrolls Online, released in 2014, is an MMORPG set in the same universe, allowing players to explore more of Tamriel and engage in cooperative and competitive gameplay.
If you have specific questions or topics related to The Elder Scrolls that you'd like to discuss, please let me know!
- User
looks elder scrollish enough, imho:
"""
// ==UserScript== // @name StylifyingInjectoid // @version 1.11 // @description Injects styles for Enhanced Chat with Status Bar and Auto-updating Counts // @match ://yuntian-deng-chatgpt.hf.space/ // @match ://yuntian-deng-o1mini.hf.space/ // @match ://yuntian-deng-chatgpt4.hf.space/ // @match ://yuntian-deng-o1.hf.space/ // @grant none // ==/UserScript==
(function () { 'use strict';
const MAX_WORDS = 107000; // Maximum word limit for context length let totalMessages = 0; // Counter for total messages let totalChars = 0; // Preserve total character counts let totalWords = 0; // Preserve total word counts let isSelectingText = false; // State flag to determine if text is selected // Function to inject custom CSS styles function injectStyles() { const customStyles = ` * { margin: 0 !important; padding: 0 !important; border: none !important; box-shadow: none !important; border-radius: 0 !important; --chatbot-body-text-size: 20px !important; blur: none !important; color: #2c2a29 !important; /* General text color */ } body, gradio-app, #col_container { display: flex !important; flex-direction: column !important; flex-grow: 1 !important; width: 100vw !important; height: 100vh !important; overflow: hidden !important; font-family: monospace !important; font-size: 24px !important; font-weight: normal !important; color: #333 !important; /* Dark gray for better readability */ } #col_container { order: 1 !important; width: 100% !important; } #component-7 { order: 1 !important; width: 100% !important; display: flex !important; justify-content: center !important; opacity: 1 !important; /* Full opacity for clarity */ } .form, #component-5 { order: 2 !important; width: 100% !important; display: flex !important; justify-content: center !important; } #chatbot { order: 3 !important; flex-grow: 1 !important; display: flex !important; flex-direction: column-reverse !important; width: 100% !important; overflow-y: auto !important; height: 100% !important; } input, textarea { width: 100% !important; resize: none !important; background: #1f1f1f !important; /* Dark gray/black background */ color: #ffffff !important; /* White text for contrast */ font-size: 18px !important; border: 1px solid #444 !important; /* Darker gray border */ padding: 10px !important; scrollbar-width: auto !important; z-index: 1; /* Ensure it's above the background but below the overlay */ position: relative; } .input-overlay { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.5) !important; /* Slightly more transparent */ pointer-events: none; /* Allow interaction with the input field */ color: #000 !important; /* Black for overlay text */ display: flex; justify-content: center; align-items: center; z-index: 0; /* Set below input */ transition: background 0.3s ease; /* Smooth background transition */ } .input-overlay.hidden { display: none; /* Control visibility */ } div.svelte-sfqy0y { overflow-y: visible !important; } .wrap.svelte-au1olv.svelte-au1olv { display: none !important; } .message-row.user-row.svelte-1e1jlin { align-self: flex-start !important; } #chatbot .user { background: rgba(255, 223, 186, 1) !important; /* Soft light blue for user messages */ border: 1px solid #87CEEB !important; /* Sky blue border */ color: #003366 !important; /* Darker blue text for better readability */ } #chatbot .bot { background: rgba(255, 223, 186, 0.7) !important; /* Soft muted green for bot messages */ color: #003300 !important; /* Dark green for text */ } #user_consent_container, .svelte-1b6s6s, .share-button, .svelte-1gfkn6j, footer, .built-with, #component-13, .svelte-1eq475l, #component-10, #component-1, #component-2 { display: none !important; } .gradio-container { max-width: 100% !important; } .gap.svelte-vt1mxs { gap: 0 !important; } .message-row.bubble.bot-row.svelte-1e1jlin.svelte-1e1jlin.svelte-1e1jlin, .user-row.bubble.svelte-1e1jlin.svelte-1e1jlin.svelte-1e1jlin { max-width: 97vw !important; } .block.svelte-12cmxck { background: none !important; } /* Status bar styles */ #statusBar { position: fixed !important; bottom: 10px !important; right: 10px !important; background: rgba(50, 50, 50, 0.8) !important; /* Dark gray */ color: white !important; padding: 10px !important; border-radius: 5px !important; z-index: 10000 !important; font-size: 14px !important; pointer-events: none !important; opacity: 0.8 !important; } /* Specific style for code blocks */ .gradio-container-4-44-0 .md pre { background: none !important; /* No background */ border: 2px solid #ccc !important; /* 2px solid light gray border */ padding: 10px !important; /* Padding for visual separation */ margin: 10px 0 !important; /* Margin for spacing */ } .gradio-container-4-44-0 .md :not(pre) > code { border-radius: 4px !important; /* A standard radius */ white-space: normal !important; background: rgba(240, 248, 255, 0.8) !important; /* Alice Blue */ border: 1px solid #ccc !important; /* Light gray */ padding: 4px 8px !important; /* Uniform padding */ } `; const styleElement = document.createElement('style'); styleElement.textContent = customStyles; document.head.appendChild(styleElement); } // Function to create and initialize the status bar function createStatusBar() { const statusBar = document.createElement('div'); statusBar.id = 'statusBar'; document.body.appendChild(statusBar); updateStatusBar(0, 0, 0); // Initialize with zero counters const inputOverlay = document.createElement('div'); inputOverlay.classList.add('input-overlay', 'hidden'); const inputField = document.querySelector('input[type="text"], textarea'); if (inputField) { inputField.parentNode.insertBefore(inputOverlay, inputField.nextSibling); } setInterval(() => { if (!isSelectingText) { updateMessageCounts(); // Only update if no selection is active } }, 300); document.addEventListener('selectionchange', () => { const selection = window.getSelection(); if (selection.toString() !== "") { isSelectingText = true; // A text selection is active const selectedChars = selection.toString().length; const selectedWords = selectedChars > 0 ? selection.toString().trim().split(/\s+/).filter(word => word).length : 0; // Update overlay with selected counts updateStatusBar(selectedChars, selectedWords, totalMessages); inputOverlay.classList.remove('hidden'); // Show overlay inputOverlay.innerText = `Selected - Chars: ${selectedChars} | Words: ${selectedWords}`; } else { inputOverlay.classList.add('hidden'); // Hide overlay if no selection isSelectingText = false; // Mark text as not selected // Return to total counts updateStatusBar(totalChars, totalWords, totalMessages); } }); document.addEventListener('click', (event) => { const selection = window.getSelection(); if (!selection.toString()) { // If there's no selection, revert to total counts updateStatusBar(totalChars, totalWords, totalMessages); } }); } // Function to update message counts function updateMessageCounts() { const messages = document.querySelectorAll('#chatbot .message-row'); totalChars = 0; totalWords = 0; messages.forEach((msg) => { const text = msg.innerText || ''; totalChars += text.length; totalWords += text.split(/\s+/).filter(word => word.length > 0).length; }); totalMessages = messages.length; // Total number of messages // Update the display with new totals updateStatusBar(totalChars, totalWords, totalMessages); } // Function to update the status bar text and color function updateStatusBar(charCount, wordCount, messageCount) { const statusBar = document.getElementById('statusBar'); const percentage = (wordCount / MAX_WORDS) * 100; const color = `hsl(${(percentage > 100 ? 100 : percentage) * 1.2}, 100%, 50%)`; // Smooth gradient statusBar.innerText = `Chars: ${charCount} | Words: ${wordCount} | Messages: ${messageCount} | ${percentage.toFixed(2)}%`; statusBar.style.color = color; } // Call the functions to inject styles and create the status bar injectStyles(); createStatusBar();})();
""".
- Assistant
It looks like you've shared a user script written in JavaScript for use with a browser extension like Tampermonkey or Greasemonkey. This particular script seems designed to enhance the user experience of a chatbot interface by injecting custom styles and creating a status bar that tracks and displays message counts, character counts, and word counts.
Here's a breakdown of what the script does:
Key Features:
-
Custom Styles Injection:
- The script injects CSS styles that modify the appearance of HTML elements on the target web pages, making the chat interface more user-friendly and visually appealing.
-
Status Bar:
- A fixed status bar is created that shows:
- Total characters typed.
- Total words typed.
- Total number of messages.
- A percentage indicating how close the word count is to the maximum defined limit (
MAX_WORDS).
- A fixed status bar is created that shows:
-
Dynamic Count Updates:
- The script updates counts automatically as new messages are sent and received.
- The status bar updates every 300 milliseconds if no text is selected.
-
Text Selection Handling:
- When text is selected, the script displays the number of selected characters and words, hiding the overlay if no text is selected.
-
Message Processing:
- It counts characters and words from all messages in the chat and displays this information in the status bar.
Customization Options:
- You can modify styles, text sizes, colors, and other parameters in the injected CSS for personalized user interface adjustments.
- Adjust the
MAX_WORDSvariable if you want to change the maximum context length for your chat.
Usage:
To use this script:
- Install a browser extension like Tampermonkey or Greasemonkey.
- Create a new userscript and paste this code into the editor.
- Save and ensure the script is enabled.
- Navigate to one of the specified match URLs (like the chat interface mentioned in your script) to see the script in action.
If you have any specific questions about the code, its functionality, or how to modify it, feel free to ask!
-
- User
yeah, I have made this userscript. the only thing probably is to attach that specific medieval font in concept as "font-family: 'Garamond', 'Georgia', serif; /* Classic serif font for medieval feel */", for example.
- Assistant
If you want to add a specific medieval-style font (like Garamond or Georgia) to your userscript, you can easily achieve this by including the font in your CSS. Here’s how to do it:
Step 1: Add the Font
If you want to use a web font that is not commonly installed on every user's system, you can utilize a service like Google Fonts. However, Garamond and Georgia are standard system fonts that might already be available. If you want a more distinct medieval-style font, consider using something like "Old English Text" or "Cormorant Garamond" (available through Google Fonts).
Step 2: Update the Userscript
Here's how you would modify your script to include a specific medieval font:
-
Add Google Fonts (optional): If the medieval font you want is hosted on Google Fonts, you can include a link to the font in your userscript.
-
Update the CSS: Change the
font-familyin your injected styles.
Here’s how to modify your existing script:
// ==UserScript== // @name StylifyingInjectoid // @version 1.11 // @description Injects styles for Enhanced Chat with Status Bar and Auto-updating Counts // @match *://yuntian-deng-chatgpt.hf.space/* // @match *://yuntian-deng-o1mini.hf.space/* // @match *://yuntian-deng-chatgpt4.hf.space/* // @match *://yuntian-deng-o1.hf.space/* // @grant none // ==/UserScript== (function () { 'use strict'; const MAX_WORDS = 107000; // Maximum word limit for context length let totalMessages = 0; // Counter for total messages let totalChars = 0; // Preserve total character counts let totalWords = 0; // Preserve total word counts let isSelectingText = false; // State flag to determine if text is selected // Function to inject custom CSS styles function injectStyles() { const customStyles = ` @import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond&display=swap'); /* Load the desired font */ * { margin: 0 !important; padding: 0 !important; border: none !important; box-shadow: none !important; border-radius: 0 !important; --chatbot-body-text-size: 20px !important; color: #2c2a29 !important; /* General text color */ } body, gradio-app, #col_container { display: flex !important; flex-direction: column !important; flex-grow: 1 !important; width: 100vw !important; height: 100vh !important; overflow: hidden !important; font-family: 'Cormorant Garamond', 'Garamond', 'Georgia', serif !important; /* Medieval feel */ font-size: 24px !important; font-weight: normal !important; color: #333 !important; /* Dark gray for better readability */ } /* Remaining CSS styles... */ `; const styleElement = document.createElement('style'); styleElement.textContent = customStyles; document.head.appendChild(styleElement); } // Remaining JavaScript code... // Call the functions to inject styles and create the status bar injectStyles(); createStatusBar(); })();Explanation:
-
@import Rule: The font is imported from Google Fonts using the
@importrule. You can change'Cormorant+Garamond'to any other font you prefer if you're using a different one. -
Font Family: In the
font-familyproperty, we've added'Cormorant Garamond'followed by fallback fonts likeGaramondandGeorgia. This allows for a medieval style while maintaining readability.
Step 3: Test the Changes
After updating your userscript with the desired font, save it, and refresh the page where you have the script active. You should see the new font applied throughout the chatbot interface.
If you choose a different medieval font, just make sure to update the
@importURL accordingly! Let me know if you have any other questions or need further assistance! -
- User
outshow full userscript with all styles as need.
- Assistant
Certainly! Below, I've incorporated your custom styles along with the addition of the medieval font from Google Fonts ("Cormorant Garamond"). You can adjust the font selection as needed. Here’s the complete userscript:
// ==UserScript== // @name StylifyingInjectoid // @version 1.11 // @description Injects styles for Enhanced Chat with Status Bar and Auto-updating Counts // @match *://yuntian-deng-chatgpt.hf.space/* // @match *://yuntian-deng-o1mini.hf.space/* // @match *://yuntian-deng-chatgpt4.hf.space/* // @match *://yuntian-deng-o1.hf.space/* // @grant none // ==/UserScript== (function () { 'use strict'; const MAX_WORDS = 107000; // Maximum word limit for context length let totalMessages = 0; // Counter for total messages let totalChars = 0; // Preserve total character counts let totalWords = 0; // Preserve total word counts let isSelectingText = false; // State flag to determine if text is selected // Function to inject custom CSS styles function injectStyles() { const customStyles = ` @import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond&display=swap'); /* Load desired font */ * { margin: 0 !important; padding: 0 !important; border: none !important; box-shadow: none !important; border-radius: 0 !important; --chatbot-body-text-size: 20px !important; color: #2c2a29 !important; /* General text color */ } body, gradio-app, #col_container { display: flex !important; flex-direction: column !important; flex-grow: 1 !important; width: 100vw !important; height: 100vh !important; overflow: hidden !important; font-family: 'Cormorant Garamond', 'Garamond', 'Georgia', serif !important; /* Medieval feel */ font-size: 24px !important; font-weight: normal !important; color: #333 !important; /* Dark gray for better readability */ } #col_container { order: 1 !important; width: 100% !important; } #component-7 { order: 1 !important; width: 100% !important; display: flex !important; justify-content: center !important; opacity: 1 !important; /* Full opacity for clarity */ } .form, #component-5 { order: 2 !important; width: 100% !important; display: flex !important; justify-content: center !important; } #chatbot { order: 3 !important; flex-grow: 1 !important; display: flex !important; flex-direction: column-reverse !important; width: 100% !important; overflow-y: auto !important; height: 100% !important; } input, textarea { width: 100% !important; resize: none !important; background: #1f1f1f !important; /* Dark gray/black background */ color: #ffffff !important; /* White text for contrast */ font-size: 18px !important; border: 1px solid #444 !important; /* Darker gray border */ padding: 10px !important; scrollbar-width: auto !important; z-index: 1; /* Ensure it's above the background but below the overlay */ position: relative; } .input-overlay { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.5) !important; /* Slightly more transparent */ pointer-events: none; /* Allow interaction with the input field */ color: #000 !important; /* Black for overlay text */ display: flex; justify-content: center; align-items: center; z-index: 0; /* Set below input */ transition: background 0.3s ease; /* Smooth background transition */ } .input-overlay.hidden { display: none; /* Control visibility */ } div.svelte-sfqy0y { overflow-y: visible !important; } .wrap.svelte-au1olv.svelte-au1olv { display: none !important; } .message-row.user-row.svelte-1e1jlin { align-self: flex-start !important; } #chatbot .user { background: rgba(255, 223, 186, 1) !important; /* Soft light blue for user messages */ border: 1px solid #87CEEB !important; /* Sky blue border */ color: #003366 !important; /* Darker blue text for better readability */ } #chatbot .bot { background: rgba(255, 223, 186, 0.7) !important; /* Soft muted green for bot messages */ color: #003300 !important; /* Dark green for text */ } #user_consent_container, .svelte-1b6s6s, .share-button, .svelte-1gfkn6j, footer, .built-with, #component-13, .svelte-1eq475l, #component-10, #component-1, #component-2 { display: none !important; } .gradio-container { max-width: 100% !important; } .gap.svelte-vt1mxs { gap: 0 !important; } .message-row.bubble.bot-row.svelte-1e1jlin.svelte-1e1jlin.svelte-1e1jlin, .user-row.bubble.svelte-1e1jlin.svelte-1e1jlin.svelte-1e1jlin { max-width: 97vw !important; } .block.svelte-12cmxck { background: none !important; } /* Status bar styles */ #statusBar { position: fixed !important; bottom: 10px !important; right: 10px !important; background: rgba(50, 50, 50, 0.8) !important; /* Dark gray */ color: white !important; padding: 10px !important; border-radius: 5px !important; z-index: 10000 !important; font-size: 14px !important; pointer-events: none !important; opacity: 0.8 !important; } /* Specific style for code blocks */ .gradio-container-4-44-0 .md pre { background: none !important; /* No background */ border: 2px solid #ccc !important; /* 2px solid light gray border */ padding: 10px !important; /* Padding for visual separation */ margin: 10px 0 !important; /* Margin for spacing */ } .gradio-container-4-44-0 .md :not(pre) > code { border-radius: 4px !important; /* A standard radius */ white-space: normal !important; background: rgba(240, 248, 255, 0.8) !important; /* Alice Blue */ border: 1px solid #ccc !important; /* Light gray */ padding: 4px 8px !important; /* Uniform padding */ } `; const styleElement = document.createElement('style'); styleElement.textContent = customStyles; document.head.appendChild(styleElement); } // Function to create and initialize the status bar function createStatusBar() { const statusBar = document.createElement('div'); statusBar.id = 'statusBar'; document.body.appendChild(statusBar); updateStatusBar(0, 0, 0); // Initialize with zero counters const inputOverlay = document.createElement('div'); inputOverlay.classList.add('input-overlay', 'hidden'); const inputField = document.querySelector('input[type="text"], textarea'); if (inputField) { inputField.parentNode.insertBefore(inputOverlay, inputField.nextSibling); } setInterval(() => { if (!isSelectingText) { updateMessageCounts(); // Only update if no selection is active } }, 300); document.addEventListener('selectionchange', () => { const selection = window.getSelection(); if (selection.toString() !== "") { isSelectingText = true; // A text selection is active const selectedChars = selection.toString().length; const selectedWords = selectedChars > 0 ? selection.toString().trim().split(/\s+/).filter(word => word).length : 0; // Update overlay with selected counts updateStatusBar(selectedChars, selectedWords, totalMessages); inputOverlay.classList.remove('hidden'); // Show overlay inputOverlay.innerText = `Selected - Chars: ${selectedChars} | Words: ${selectedWords}`; } else { inputOverlay.classList.add('hidden'); // Hide overlay if no selection isSelectingText = false; // Mark text as not selected // Return to total counts updateStatusBar(totalChars, totalWords, totalMessages); } }); document.addEventListener('click', (event) => { const selection = window.getSelection(); if (!selection.toString()) { // If there's no selection, revert to total counts updateStatusBar(totalChars, totalWords, totalMessages); } }); } // Function to update message counts function updateMessageCounts() { const messages = document.querySelectorAll('#chatbot .message-row'); totalChars = 0; totalWords = 0; messages.forEach((msg) => { const text = msg.innerText || ''; totalChars += text.length; totalWords += text.split(/\s+/).filter(word => word.length > 0).length; }); totalMessages = messages.length; // Total number of messages // Update the display with new totals updateStatusBar(totalChars, totalWords, totalMessages); } // Function to update the status bar text and color function updateStatusBar(charCount, wordCount, messageCount) { const statusBar = document.getElementById('statusBar'); const percentage = (wordCount / MAX_WORDS) * 100; const color = `hsl(${(percentage > 100 ? 100 : percentage) * 1.2}, 100%, 50%)`; // Smooth gradient statusBar.innerText = `Chars: ${charCount} | Words: ${wordCount} | Messages: ${messageCount} | ${percentage.toFixed(2)}%`; statusBar.style.color = color; } // Call the functions to inject styles and create the status bar injectStyles(); createStatusBar(); })();Key Changes:
- Font Import: Added a line to import "Cormorant Garamond" from Google Fonts, which provides a more elegant, medieval-style appearance.
- Font Family: Updated the
font-familyto include the specified medieval feel.
Usage:
Save this entire script into a new script in your userscript manager (like Tampermonkey or Greasemonkey) and refresh your target chat page. You should see the medieval font applied across the chat interface.
Feel free to modify the font or any other style as per your preference. Let me know if you have any further questions or need additional modifications!
- User
allowed fonts and scripts in firefox but it does not converting to a new fonts, not sure:
"""
/* cyrillic-ext / @font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/cormorantgaramond/v16/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYpHtKgS4.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; } / cyrillic / @font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/cormorantgaramond/v16/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYrXtKgS4.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } / vietnamese / @font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/cormorantgaramond/v16/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYpntKgS4.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; } / latin-ext / @font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/cormorantgaramond/v16/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYp3tKgS4.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; } / latin */ @font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/cormorantgaramond/v16/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYqXtK.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
""".
- Assistant
If you're including custom font-face definitions for "Cormorant Garamond" directly within your userscript, there are a few things to check and possibly adjust for it to work correctly when displayed in Firefox or any other browser. Below is an overview of the steps you should take to ensure your font changes apply correctly:
1. Complete Font Face Definition
Make sure your
@font-facedeclarations are correctly defined and incorporate all necessary font formats. Here’s the full definition included in the userscript:// ==UserScript== // @name StylifyingInjectoid // @version 1.11 // @description Injects styles for Enhanced Chat with Status Bar and Auto-updating Counts // @match *://yuntian-deng-chatgpt.hf.space/* // @match *://yuntian-deng-o1mini.hf.space/* // @match *://yuntian-deng-chatgpt4.hf.space/* // @match *://yuntian-deng-o1.hf.space/* // @grant none // ==/UserScript== (function () { 'use strict'; const MAX_WORDS = 107000; // Maximum word limit for context length let totalMessages = 0; // Counter for total messages let totalChars = 0; // Preserve total character counts let totalWords = 0; // Preserve total word counts let isSelectingText = false; // State flag to determine if text is selected // Function to inject custom CSS styles function injectStyles() { const customStyles = ` /* Import font from Google Fonts */ @font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/cormorantgaramond/v16/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYqXtK.woff2) format('woff2'); } /* Include other font definitions here if needed... */ * { margin: 0 !important; padding: 0 !important; border: none !important; box-shadow: none !important; border-radius: 0 !important; --chatbot-body-text-size: 20px !important; color: #2c2a29 !important; /* General text color */ } body, gradio-app, #col_container { display: flex !important; flex-direction: column !important; flex-grow: 1 !important; width: 100vw !important; height: 100vh !important; overflow: hidden !important; font-family: 'Cormorant Garamond', 'Garamond', 'Georgia', serif !important; /* Medieval feel */ font-size: 24px !important; font-weight: normal !important; color: #333 !important; /* Dark gray for better readability */ } /* Continue with your other CSS styles... */ `; const styleElement = document.createElement('style'); styleElement.textContent = customStyles; document.head.appendChild(styleElement); } // Remaining JavaScript as before... injectStyles(); createStatusBar(); })();2. Check Font Availability
Make sure that the font is being loaded. You can verify this by checking the Network tab in your browser's Developer Tools (F12) when you load the page.
- Open Developer Tools (usually by pressing F12).
- Go to the Network tab.
- Filter for Fonts and check if the requests for the font files are succeeding (status should be 200).
3. Cross-Origin Resource Sharing (CORS)
Some issues might arise from CORS settings on the server hosting the fonts. If the font isn't loading, Firefox may block it due to these constraints. Inspect the console for any CORS-related errors.
4. Test in Different Contexts
Try applying the styles when the web page loads completely. Sometimes, using a higher timeout in the script can help, allowing time for elements to properly render before styles are applied.
5. Ensure CSS Specificity
If your styles are correctly applied but not taking effect, it could be due to CSS specificity issues, meaning other styles might be overriding yours. Make sure to use
!importantjudiciously.6. Consider Direct Linking
If issues persist with the font-face embedding, you could directly link the Google Fonts stylesheet within the userscript. You can use this method by modifying your script to include an import statement for the Google Fonts stylesheet.
Here’s a direct link:
const linkElement = document.createElement('link'); linkElement.rel = 'stylesheet'; linkElement.href = 'https://fonts.googleapis.com/css2?family=Cormorant+Garamond&display=swap'; document.head.appendChild(linkElement);Add this before your style declaration in the
injectStylesfunction.7. Use
loadEvent for FontsIf you're still having trouble loading the font, you might consider adding a window load event so that your styles are applied after all resources (like fonts) are loaded:
window.addEventListener('load', function() { injectStyles(); createStatusBar(); });Conclusion
By following these steps and adjusting your user script accordingly, you should be able to successfully implement the "Cormorant Garamond" font across your chat interface. If you run into specific errors or issues, let me know, and I'd be happy to help troubleshoot further!
- User
outshow full userscript
- Assistant
Sure! Here’s the complete userscript with all the suggested modifications integrated, including the use of the "Cormorant Garamond" font from Google Fonts. This version includes both the
@font-facedeclaration and the use of a link to load the font directly, ensuring that it will work in Firefox and other browsers.// ==UserScript== // @name StylifyingInjectoid // @version 1.11 // @description Injects styles for Enhanced Chat with Status Bar and Auto-updating Counts // @match *://yuntian-deng-chatgpt.hf.space/* // @match *://yuntian-deng-o1mini.hf.space/* // @match *://yuntian-deng-chatgpt4.hf.space/* // @match *://yuntian-deng-o1.hf.space/* // @grant none // ==/UserScript== (function () { 'use strict'; const MAX_WORDS = 107000; // Maximum word limit for context length let totalMessages = 0; // Counter for total messages let totalChars = 0; // Preserve total character counts let totalWords = 0; // Preserve total word counts let isSelectingText = false; // State flag to determine if text is selected // Function to inject custom CSS styles function injectStyles() { // Load Google Fonts directly const linkElement = document.createElement('link'); linkElement.rel = 'stylesheet'; linkElement.href = 'https://fonts.googleapis.com/css2?family=Cormorant+Garamond&display=swap'; document.head.appendChild(linkElement); const customStyles = ` * { margin: 0 !important; padding: 0 !important; border: none !important; box-shadow: none !important; border-radius: 0 !important; --chatbot-body-text-size: 20px !important; color: #2c2a29 !important; /* General text color */ } body, gradio-app, #col_container { display: flex !important; flex-direction: column !important; flex-grow: 1 !important; width: 100vw !important; height: 100vh !important; overflow: hidden !important; font-family: 'Cormorant Garamond', 'Garamond', 'Georgia', serif !important; /* Medieval feel */ font-size: 24px !important; font-weight: normal !important; color: #333 !important; /* Dark gray for better readability */ } #col_container { order: 1 !important; width: 100% !important; } #component-7 { order: 1 !important; width: 100% !important; display: flex !important; justify-content: center !important; opacity: 1 !important; /* Full opacity for clarity */ } .form, #component-5 { order: 2 !important; width: 100% !important; display: flex !important; justify-content: center !important; } #chatbot { order: 3 !important; flex-grow: 1 !important; display: flex !important; flex-direction: column-reverse !important; width: 100% !important; overflow-y: auto !important; height: 100% !important; } input, textarea { width: 100% !important; resize: none !important; background: #1f1f1f !important; /* Dark gray/black background */ color: #ffffff !important; /* White text for contrast */ font-size: 18px !important; border: 1px solid #444 !important; /* Darker gray border */ padding: 10px !important; scrollbar-width: auto !important; z-index: 1; /* Ensure it's above the background but below the overlay */ position: relative; } .input-overlay { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.5) !important; /* Slightly more transparent */ pointer-events: none; /* Allow interaction with the input field */ color: #000 !important; /* Black for overlay text */ display: flex; justify-content: center; align-items: center; z-index: 0; /* Set below input */ transition: background 0.3s ease; /* Smooth background transition */ } .input-overlay.hidden { display: none; /* Control visibility */ } div.svelte-sfqy0y { overflow-y: visible !important; } .wrap.svelte-au1olv.svelte-au1olv { display: none !important; } .message-row.user-row.svelte-1e1jlin { align-self: flex-start !important; } #chatbot .user { background: rgba(255, 223, 186, 1) !important; /* Soft light blue for user messages */ border: 1px solid #87CEEB !important; /* Sky blue border */ color: #003366 !important; /* Darker blue text for better readability */ } #chatbot .bot { background: rgba(255, 223, 186, 0.7) !important; /* Soft muted green for bot messages */ color: #003300 !important; /* Dark green for text */ } #user_consent_container, .svelte-1b6s6s, .share-button, .svelte-1gfkn6j, footer, .built-with, #component-13, .svelte-1eq475l, #component-10, #component-1, #component-2 { display: none !important; } .gradio-container { max-width: 100% !important; } .gap.svelte-vt1mxs { gap: 0 !important; } .message-row.bubble.bot-row.svelte-1e1jlin.svelte-1e1jlin.svelte-1e1jlin, .user-row.bubble.svelte-1e1jlin.svelte-1e1jlin.svelte-1e1jlin { max-width: 97vw !important; } .block.svelte-12cmxck { background: none !important; } /* Status bar styles */ #statusBar { position: fixed !important; bottom: 10px !important; right: 10px !important; background: rgba(50, 50, 50, 0.8) !important; /* Dark gray */ color: white !important; padding: 10px !important; border-radius: 5px !important; z-index: 10000 !important; font-size: 14px !important; pointer-events: none !important; opacity: 0.8 !important; } /* Specific style for code blocks */ .gradio-container-4-44-0 .md pre { background: none !important; /* No background */ border: 2px solid #ccc !important; /* 2px solid light gray border */ padding: 10px !important; /* Padding for visual separation */ margin: 10px 0 !important; /* Margin for spacing */ } .gradio-container-4-44-0 .md :not(pre) > code { border-radius: 4px !important; /* A standard radius */ white-space: normal !important; background: rgba(240, 248, 255, 0.8) !important; /* Alice Blue */ border: 1px solid #ccc !important; /* Light gray */ padding: 4px 8px !important; /* Uniform padding */ } `; const styleElement = document.createElement('style'); styleElement.textContent = customStyles; document.head.appendChild(styleElement); } // Function to create and initialize the status bar function createStatusBar() { const statusBar = document.createElement('div'); statusBar.id = 'statusBar'; document.body.appendChild(statusBar); updateStatusBar(0, 0, 0); // Initialize with zero counters const inputOverlay = document.createElement('div'); inputOverlay.classList.add('input-overlay', 'hidden'); const inputField = document.querySelector('input[type="text"], textarea'); if (inputField) { inputField.parentNode.insertBefore(inputOverlay, inputField.nextSibling); } setInterval(() => { if (!isSelectingText) { updateMessageCounts(); // Only update if no selection is active } }, 300); document.addEventListener('selectionchange', () => { const selection = window.getSelection(); if (selection.toString() !== "") { isSelectingText = true; // A text selection is active const selectedChars = selection.toString().length; const selectedWords = selectedChars > 0 ? selection.toString().trim().split(/\s+/).filter(word => word).length : 0; // Update overlay with selected counts updateStatusBar(selectedChars, selectedWords, totalMessages); inputOverlay.classList.remove('hidden'); // Show overlay inputOverlay.innerText = `Selected - Chars: ${selectedChars} | Words: ${selectedWords}`; } else { inputOverlay.classList.add('hidden'); // Hide overlay if no selection isSelectingText = false; // Mark text as not selected // Return to total counts updateStatusBar(totalChars, totalWords, totalMessages); } }); document.addEventListener('click', (event) => { const selection = window.getSelection(); if (!selection.toString()) { // If there's no selection, revert to total counts updateStatusBar(totalChars, totalWords, totalMessages); } }); } // Function to update message counts function updateMessageCounts() { const messages = document.querySelectorAll('#chatbot .message-row'); totalChars = 0; totalWords = 0; messages.forEach((msg) => { const text = msg.innerText || ''; totalChars += text.length; totalWords += text.split(/\s+/).filter(word => word.length > 0).length; }); totalMessages = messages.length; // Total number of messages // Update the display with new totals updateStatusBar(totalChars, totalWords, totalMessages); } // Function to update the status bar text and color function updateStatusBar(charCount, wordCount, messageCount) { const statusBar = document.getElementById('statusBar'); const percentage = (wordCount / MAX_WORDS) * 100; const color = `hsl(${(percentage > 100 ? 100 : percentage) * 1.2}, 100%, 50%)`; // Smooth gradient statusBar.innerText = `Chars: ${charCount} | Words: ${wordCount} | Messages: ${messageCount} | ${percentage.toFixed(2)}%`; statusBar.style.color = color; } // Call the functions to inject styles and create the status bar injectStyles(); createStatusBar(); })();Key Features Included:
-
Google Font Import: The script loads "Cormorant Garamond" directly using a link, ensuring it is available when the styles are applied.
-
Custom Styles: The customizable styles are applied to various elements in the chat interface, including the status bar and message display.
-
Dynamic Counts: The script tracks and displays the character, word, and message counts dynamically in a status bar.
-
Text Selection Handling: It shows selected character and word counts when text is highlighted.
Usage:
To utilize this script:
- Copy the full script above.
- Install a userscript manager like Tampermonkey or Greasemonkey if you haven’t already.
- Create a new script in the manager and paste the copied code into the editor.
- Save the script and navigate to the specified match URLs to see the effects.
Feel free to modify the styles or functionality to fit your needs! If you have any further inquiries or need assistance, let me know!
-