character.ai Font Changer

Easy font changing for c.ai website (USE "\" To open the menu."

  1. // ==UserScript==
  2. // @name character.ai Font Changer
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Easy font changing for c.ai website (USE "\" To open the menu."
  6. // @match https://character.ai/*
  7. // @author Gamer, Claude.ai, The universe.
  8. // @grant GM_getValue
  9. // @grant GM_setValue
  10. // ==/UserScript==
  11.  
  12. // ==UserScript==
  13. // @name Universal Font Changer
  14. // @namespace http://tampermonkey.net/
  15. // @version 1.1
  16. // @description Easy font changing for any website
  17. // @match *://*/*
  18. // @grant GM_getValue
  19. // @grant GM_setValue
  20. // ==/UserScript==
  21.  
  22. (function() {
  23. 'use strict';
  24.  
  25. // Comprehensive font list
  26. const fonts = [
  27. // Default/Standard Fonts
  28. { name: 'Arial', value: 'Arial, sans-serif' },
  29. { name: 'Helvetica', value: 'Helvetica, sans-serif' },
  30. { name: 'Times New Roman', value: 'Times New Roman, serif' },
  31. { name: 'Georgia', value: 'Georgia, serif' },
  32. { name: 'Courier New', value: 'Courier New, monospace' },
  33. { name: 'Verdana', value: 'Verdana, sans-serif' },
  34.  
  35. // Dyslexia-Friendly Fonts
  36. { name: 'OpenDyslexic', value: 'OpenDyslexic, sans-serif' },
  37. { name: 'Dyslexie', value: 'Dyslexie, sans-serif' },
  38. { name: 'Comic Sans MS', value: 'Comic Sans MS, cursive' },
  39. { name: 'Lexend', value: 'Lexend, sans-serif' },
  40. { name: 'Atkinson Hyperlegible', value: 'Atkinson Hyperlegible, sans-serif' },
  41.  
  42. // Readable Fonts
  43. { name: 'Roboto', value: 'Roboto, sans-serif' },
  44. { name: 'Open Sans', value: 'Open Sans, sans-serif' },
  45. { name: 'Lato', value: 'Lato, sans-serif' },
  46. { name: 'Montserrat', value: 'Montserrat, sans-serif' },
  47. { name: 'Source Sans Pro', value: 'Source Sans Pro, sans-serif' },
  48.  
  49. // Serif Fonts
  50. { name: 'Merriweather', value: 'Merriweather, serif' },
  51. { name: 'Noto Serif', value: 'Noto Serif, serif' },
  52. { name: 'Libre Baskerville', value: 'Libre Baskerville, serif' },
  53.  
  54. // Monospace Fonts
  55. { name: 'Courier Prime', value: 'Courier Prime, monospace' },
  56. { name: 'Source Code Pro', value: 'Source Code Pro, monospace' },
  57. { name: 'Fira Mono', value: 'Fira Mono, monospace' }
  58. ];
  59.  
  60. // Create font changer menu
  61. function createFontChangerMenu() {
  62. // Create menu container
  63. const menu = document.createElement('div');
  64. menu.id = 'font-changer-menu';
  65. menu.style.cssText = `
  66. position: fixed;
  67. top: 20px;
  68. right: 20px;
  69. width: 300px;
  70. background: black;
  71. border: 2px solid white;
  72. padding: 15px;
  73. z-index: 10000;
  74. box-shadow: 0 0 10px rgba(255,255,255,0.5);
  75. max-height: 80vh;
  76. overflow-y: auto;
  77. display: none;
  78. color: white;
  79. `;
  80.  
  81. // Create title
  82. const title = document.createElement('h2');
  83. title.textContent = 'Font Changer';
  84. title.style.cssText = `
  85. text-align: center;
  86. color: white;
  87. margin-bottom: 15px;
  88. `;
  89. menu.appendChild(title);
  90.  
  91. // Create font selector
  92. const fontSelect = document.createElement('select');
  93. fontSelect.id = 'font-selector';
  94. fontSelect.style.cssText = `
  95. width: 100%;
  96. margin-bottom: 10px;
  97. background: white;
  98. color: black;
  99. padding: 5px;
  100. `;
  101.  
  102. // Populate font selector
  103. fonts.forEach(font => {
  104. const option = document.createElement('option');
  105. option.value = font.value;
  106. option.textContent = font.name;
  107. fontSelect.appendChild(option);
  108. });
  109. menu.appendChild(fontSelect);
  110.  
  111. // Create preview area
  112. const previewArea = document.createElement('div');
  113. previewArea.id = 'font-preview';
  114. previewArea.textContent = 'The quick brown fox jumps over the lazy dog';
  115. previewArea.style.cssText = `
  116. margin-top: 10px;
  117. padding: 10px;
  118. border: 1px solid white;
  119. text-align: center;
  120. color: white;
  121. `;
  122. menu.appendChild(previewArea);
  123.  
  124. // Create apply button
  125. const applyButton = document.createElement('button');
  126. applyButton.textContent = 'Apply Font';
  127. applyButton.style.cssText = `
  128. width: 100%;
  129. padding: 10px;
  130. margin-top: 10px;
  131. background: white;
  132. color: black;
  133. border: none;
  134. cursor: pointer;
  135. `;
  136. menu.appendChild(applyButton);
  137.  
  138. // Append menu to body
  139. document.body.appendChild(menu);
  140.  
  141. // Event listeners
  142. fontSelect.addEventListener('change', (e) => {
  143. previewArea.style.fontFamily = e.target.value;
  144. });
  145.  
  146. applyButton.addEventListener('click', () => {
  147. const selectedFont = fontSelect.value;
  148. applyFont(selectedFont);
  149. });
  150.  
  151. // Keyboard shortcut to toggle menu
  152. document.addEventListener('keydown', (e) => {
  153. // Explicitly check for backslash key
  154. if (e.key === '\\' || e.keyCode === 220) {
  155. e.preventDefault(); // Prevent default backslash behavior
  156. menu.style.display = menu.style.display === 'none' ? 'block' : 'none';
  157. }
  158. });
  159.  
  160. return menu;
  161. }
  162.  
  163. // Apply font to entire page
  164. function applyFont(fontFamily) {
  165. const styleElement = document.createElement('style');
  166. styleElement.id = 'font-changer-style';
  167. styleElement.textContent = `
  168. body, html, * {
  169. font-family: ${fontFamily} !important;
  170. }
  171. `;
  172.  
  173. // Remove previous font style if exists
  174. const existingStyle = document.getElementById('font-changer-style');
  175. if (existingStyle) {
  176. existingStyle.remove();
  177. }
  178.  
  179. document.head.appendChild(styleElement);
  180. }
  181.  
  182. // Initialize script
  183. function init() {
  184. const menu = createFontChangerMenu();
  185. }
  186.  
  187. // Run script after page load
  188. if (document.readyState === 'loading') {
  189. document.addEventListener('DOMContentLoaded', init);
  190. } else {
  191. init();
  192. }
  193. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址