Refactor emoji library, improve UI responsiveness, and enhance text transforms

- Refactor emojiLibrary.js: auto-generate EMOJI_LIST from categorized emojis
  - Removed 400+ lines of duplicate emoji definitions
  - Implemented single source of truth with deduplication
  - Added emoji count display updates

- Improve responsive layout and styling (style.css)
  - Add flex-wrap to header and transform categories for better wrapping
  - Fix transform button width and sizing issues
  - Improve tokenade-presets responsive layout
  - Remove fixed min-width constraints

- Optimize app performance (app.js)
  - Remove watchers that caused unnecessary emoji grid re-renders
  - Fix category scroll behavior with proper offset calculation
  - Move lastCopyTime from methods to data
  - Refactor setupPasteHandlers method location
  - Fix applyTransform to pass full text to transforms instead of character-by-character
  - Add missing transforms to categories (Vaporwave, Disemvowel, ROT18, ROT5, A1Z26, etc.)

- UI/UX improvements (index.html)
  - Switch to Vue.js production build for better performance
  - Simplify copy buttons (icon only, remove redundant text)
  - Fix Vue key prop warnings with unique keys
  - Improve emoji grid initialization and tab switching logic
  - Reorganize Tokenade panel controls
  - Add structural comments for better code navigation
  - Add emojiWordMap.js script reference

- Enhance text transforms (transforms.js)
  - Inline try-catch blocks for base64, base64url, and url transforms (return '[Invalid input]' on error)
  - Fix numerous copy-paste errors in transform previews (vaporwave, rot5, rot18, upside_down, elder_futhark, greek, wingdings)
  - Fix klingon transform case sensitivity and reverse function for multi-character mappings
  - Update reverse_words preview to show ellipsis at end
  - Refactor emoji_speak to use keyword-based emoji lookup with two-pass replacement
  - Fix emoji_speak digit duplication by excluding single digits from symbol pass

- Add emojiWordMap.js: emoji-to-keywords mapping system
  - Extract emoji word map to separate file for better maintainability
  - Refactor from word->emoji to emoji->keywords[] for variety and semantic realism
  - Add 850+ lines of comprehensive emoji keyword mappings
  - Include 57+ jailbreak-related terms (unlock, bypass, override, escape, exploit, etc.)
  - Add special character mappings (math symbols, arrows, punctuation equivalents)
  - Exclude structural punctuation to maintain readability
This commit is contained in:
Dustin Farley
2025-11-08 10:45:59 -08:00
parent 00321f4d02
commit fc4910555a
6 changed files with 1151 additions and 575 deletions
+28 -13
View File
@@ -66,6 +66,7 @@ body {
header {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
@@ -855,7 +856,6 @@ button:hover {
/* Transform layout */
.transform-layout {
display: grid;
gap: 24px;
margin-top: 16px;
}
@@ -877,6 +877,12 @@ button:hover {
border-bottom: 1px solid var(--input-border);
}
.transform-category-legend > div {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.legend-title {
font-size: 0.9rem;
font-weight: 500;
@@ -989,6 +995,20 @@ button:hover {
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
gap: 8px;
margin-bottom: 16px;
width: 100%; /* Ensure grid doesn't overflow container */
box-sizing: border-box;
}
#category-randomizer .transform-buttons {
display: flex;
}
#category-randomizer .transform-buttons .transform-button-group {
width: 100%;
}
#category-randomizer .transform-buttons .transform-button .transform-preview {
max-width: 300px;
}
/* Carrier styling */
@@ -1308,8 +1328,7 @@ button:hover {
flex-direction: column;
align-items: center;
gap: 4px;
min-width: 110px;
max-width: 100%;
width: 100%;
font-weight: 500;
text-align: center;
border: 1px solid var(--input-border);
@@ -1816,7 +1835,6 @@ button:hover {
border: 2px solid rgba(200, 170, 255, 0.35) !important;
padding: 18px 28px !important;
letter-spacing: .3px;
min-width: 48ch;
justify-content: center;
text-align: center;
}
@@ -1976,9 +1994,6 @@ html {
.tokenade-presets > label {
margin-right: 4px;
}
.tokenade-presets .transform-button {
padding: 6px 10px;
}
/* Hacker style controls */
.hacker-controls {
@@ -2086,14 +2101,14 @@ html {
/* Presets row polish */
.tokenade-presets {
display: flex;
align-items: center;
gap: 6px;
flex-wrap: nowrap;
overflow-x: visible;
margin: 8px 0 12px 0;
}
.tokenade-presets .transform-button { flex: 0 0 auto; min-width: 136px; padding: 5px 8px; }
.tokenade-presets .transform-button {
flex: 1 0 auto;
padding: 5px 8px;
width: unset;
}
/* Quick picks panel */
.carrier-quick-grid {