Spaces:
Running
Running
Add 2 files
Browse files- index.html +69 -33
- prompts.txt +2 -8
index.html
CHANGED
|
@@ -158,6 +158,11 @@
|
|
| 158 |
width: 180px;
|
| 159 |
}
|
| 160 |
.color-palette.show {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
display: grid;
|
| 162 |
grid-template-columns: repeat(6, 1fr);
|
| 163 |
gap: 4px;
|
|
@@ -172,12 +177,14 @@
|
|
| 172 |
.color-option:hover {
|
| 173 |
transform: scale(1.1);
|
| 174 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
.custom-color-input {
|
| 176 |
-
grid-column: span 6;
|
| 177 |
display: flex;
|
| 178 |
align-items: center;
|
| 179 |
gap: 4px;
|
| 180 |
-
margin-top: 4px;
|
| 181 |
}
|
| 182 |
.custom-color-input input {
|
| 183 |
flex: 1;
|
|
@@ -193,6 +200,13 @@
|
|
| 193 |
border-radius: 4px;
|
| 194 |
cursor: pointer;
|
| 195 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
</style>
|
| 197 |
</head>
|
| 198 |
<body class="bg-gray-50 min-h-screen">
|
|
@@ -316,34 +330,38 @@
|
|
| 316 |
<i class="fas fa-palette"></i>
|
| 317 |
</div>
|
| 318 |
<div class="color-palette" id="colorPalette">
|
| 319 |
-
<div class="color-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 347 |
</div>
|
| 348 |
</div>
|
| 349 |
</div>
|
|
@@ -434,6 +452,15 @@
|
|
| 434 |
"Lost Contact/Gaslight", "Preapproval/Purchase", "Power Play","Funny", "Appointment"
|
| 435 |
];
|
| 436 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 437 |
// DOM Elements
|
| 438 |
const scriptForm = document.getElementById('scriptForm');
|
| 439 |
const scriptModal = document.getElementById('scriptModal');
|
|
@@ -564,7 +591,13 @@
|
|
| 564 |
cursorOffset = 4;
|
| 565 |
break;
|
| 566 |
case 'color':
|
| 567 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 568 |
cursorOffset = 0;
|
| 569 |
break;
|
| 570 |
}
|
|
@@ -597,7 +630,8 @@
|
|
| 597 |
.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>') // bold
|
| 598 |
.replace(/\_(.*?)\_/g, '<em>$1</em>') // italic
|
| 599 |
.replace(/<u>(.*?)<\/u>/g, '<u>$1</u>') // underline
|
| 600 |
-
.replace(/<span
|
|
|
|
| 601 |
.replace(/\n/g, '<br>') // line breaks
|
| 602 |
.replace(/\[(.*?)\]/g, '<span class="bg-blue-100 text-blue-800 px-1 rounded">[$1]</span>'); // placeholders
|
| 603 |
|
|
@@ -763,7 +797,8 @@
|
|
| 763 |
.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>') // bold
|
| 764 |
.replace(/\_(.*?)\_/g, '<em>$1</em>') // italic
|
| 765 |
.replace(/<u>(.*?)<\/u>/g, '<u>$1</u>') // underline
|
| 766 |
-
.replace(/<span
|
|
|
|
| 767 |
.replace(/\n/g, '<br>') // line breaks
|
| 768 |
.replace(/\[(.*?)\]/g, '<span class="bg-blue-100 text-blue-800 px-1 rounded">[$1]</span>'); // placeholders
|
| 769 |
}
|
|
@@ -869,6 +904,7 @@
|
|
| 869 |
.replace(/_/g, '')
|
| 870 |
.replace(/<u>/g, '')
|
| 871 |
.replace(/<\/u>/g, '')
|
|
|
|
| 872 |
.replace(/<span style="color: (.*?)">/g, '')
|
| 873 |
.replace(/<\/span>/g, '');
|
| 874 |
|
|
|
|
| 158 |
width: 180px;
|
| 159 |
}
|
| 160 |
.color-palette.show {
|
| 161 |
+
display: flex;
|
| 162 |
+
flex-direction: column;
|
| 163 |
+
gap: 8px;
|
| 164 |
+
}
|
| 165 |
+
.color-options-grid {
|
| 166 |
display: grid;
|
| 167 |
grid-template-columns: repeat(6, 1fr);
|
| 168 |
gap: 4px;
|
|
|
|
| 177 |
.color-option:hover {
|
| 178 |
transform: scale(1.1);
|
| 179 |
}
|
| 180 |
+
.custom-color-section {
|
| 181 |
+
border-top: 1px solid #e5e7eb;
|
| 182 |
+
padding-top: 8px;
|
| 183 |
+
}
|
| 184 |
.custom-color-input {
|
|
|
|
| 185 |
display: flex;
|
| 186 |
align-items: center;
|
| 187 |
gap: 4px;
|
|
|
|
| 188 |
}
|
| 189 |
.custom-color-input input {
|
| 190 |
flex: 1;
|
|
|
|
| 200 |
border-radius: 4px;
|
| 201 |
cursor: pointer;
|
| 202 |
}
|
| 203 |
+
.custom-color-indicator {
|
| 204 |
+
display: inline-block;
|
| 205 |
+
width: 10px;
|
| 206 |
+
height: 10px;
|
| 207 |
+
border-radius: 50%;
|
| 208 |
+
margin-right: 4px;
|
| 209 |
+
}
|
| 210 |
</style>
|
| 211 |
</head>
|
| 212 |
<body class="bg-gray-50 min-h-screen">
|
|
|
|
| 330 |
<i class="fas fa-palette"></i>
|
| 331 |
</div>
|
| 332 |
<div class="color-palette" id="colorPalette">
|
| 333 |
+
<div class="color-options-grid">
|
| 334 |
+
<div class="color-option" style="background-color: #000000;" data-color="#000000"></div>
|
| 335 |
+
<div class="color-option" style="background-color: #ffffff; border: 1px solid #000;" data-color="#ffffff"></div>
|
| 336 |
+
<div class="color-option" style="background-color: #ff0000;" data-color="#ff0000"></div>
|
| 337 |
+
<div class="color-option" style="background-color: #00ff00;" data-color="#00ff00"></div>
|
| 338 |
+
<div class="color-option" style="background-color: #0000ff;" data-color="#0000ff"></div>
|
| 339 |
+
<div class="color-option" style="background-color: #ffff00;" data-color="#ffff00"></div>
|
| 340 |
+
<div class="color-option" style="background-color: #ff00ff;" data-color="#ff00ff"></div>
|
| 341 |
+
<div class="color-option" style="background-color: #00ffff;" data-color="#00ffff"></div>
|
| 342 |
+
<div class="color-option" style="background-color: #800000;" data-color="#800000"></div>
|
| 343 |
+
<div class="color-option" style="background-color: #008000;" data-color="#008000"></div>
|
| 344 |
+
<div class="color-option" style="background-color: #000080;" data-color="#000080"></div>
|
| 345 |
+
<div class="color-option" style="background-color: #808000;" data-color="#808000"></div>
|
| 346 |
+
<div class="color-option" style="background-color: #800080;" data-color="#800080"></div>
|
| 347 |
+
<div class="color-option" style="background-color: #008080;" data-color="#008080"></div>
|
| 348 |
+
<div class="color-option" style="background-color: #c0c0c0;" data-color="#c0c0c0"></div>
|
| 349 |
+
<div class="color-option" style="background-color: #808080;" data-color="#808080"></div>
|
| 350 |
+
<div class="color-option" style="background-color: #ffa500;" data-color="#ffa500"></div>
|
| 351 |
+
<div class="color-option" style="background-color: #ff6347;" data-color="#ff6347"></div>
|
| 352 |
+
<div class="color-option" style="background-color: #ff69b4;" data-color="#ff69b4"></div>
|
| 353 |
+
<div class="color-option" style="background-color: #9370db;" data-color="#9370db"></div>
|
| 354 |
+
<div class="color-option" style="background-color: #7fffd4;" data-color="#7fffd4"></div>
|
| 355 |
+
<div class="color-option" style="background-color: #ffd700;" data-color="#ffd700"></div>
|
| 356 |
+
<div class="color-option" style="background-color: #cd5c5c;" data-color="#cd5c5c"></div>
|
| 357 |
+
<div class="color-option" style="background-color: #4b0082;" data-color="#4b0082"></div>
|
| 358 |
+
<div class="color-option" style="background-color: #de4319;" data-color="#de4319"></div>
|
| 359 |
+
</div>
|
| 360 |
+
<div class="custom-color-section">
|
| 361 |
+
<div class="custom-color-input">
|
| 362 |
+
<input type="text" id="customColorInput" placeholder="#hex or color name" class="flex-1">
|
| 363 |
+
<button type="button" id="applyCustomColor">Apply</button>
|
| 364 |
+
</div>
|
| 365 |
</div>
|
| 366 |
</div>
|
| 367 |
</div>
|
|
|
|
| 452 |
"Lost Contact/Gaslight", "Preapproval/Purchase", "Power Play","Funny", "Appointment"
|
| 453 |
];
|
| 454 |
|
| 455 |
+
// Predefined colors that match the color palette options
|
| 456 |
+
const predefinedColors = [
|
| 457 |
+
'#000000', '#ffffff', '#ff0000', '#00ff00', '#0000ff', '#ffff00',
|
| 458 |
+
'#ff00ff', '#00ffff', '#800000', '#008000', '#000080', '#808000',
|
| 459 |
+
'#800080', '#008080', '#c0c0c0', '#808080', '#ffa500', '#ff6347',
|
| 460 |
+
'#ff69b4', '#9370db', '#7fffd4', '#ffd700', '#cd5c5c', '#4b0082',
|
| 461 |
+
'#f08080'
|
| 462 |
+
];
|
| 463 |
+
|
| 464 |
// DOM Elements
|
| 465 |
const scriptForm = document.getElementById('scriptForm');
|
| 466 |
const scriptModal = document.getElementById('scriptModal');
|
|
|
|
| 591 |
cursorOffset = 4;
|
| 592 |
break;
|
| 593 |
case 'color':
|
| 594 |
+
// Check if the color is predefined or custom
|
| 595 |
+
const isPredefined = predefinedColors.includes(color.toLowerCase());
|
| 596 |
+
if (isPredefined) {
|
| 597 |
+
formattedText = `<span class="text-color-${color.replace('#', '')}">${selectedText}</span>`;
|
| 598 |
+
} else {
|
| 599 |
+
formattedText = `<span style="color: ${color}">${selectedText}</span>`;
|
| 600 |
+
}
|
| 601 |
cursorOffset = 0;
|
| 602 |
break;
|
| 603 |
}
|
|
|
|
| 630 |
.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>') // bold
|
| 631 |
.replace(/\_(.*?)\_/g, '<em>$1</em>') // italic
|
| 632 |
.replace(/<u>(.*?)<\/u>/g, '<u>$1</u>') // underline
|
| 633 |
+
.replace(/<span class="text-color-(.*?)">(.*?)<\/span>/g, '<span style="color: #$1">$2</span>') // predefined colors
|
| 634 |
+
.replace(/<span style="color: (.*?)">(.*?)<\/span>/g, '<span style="color: $1">$2</span>') // custom colors
|
| 635 |
.replace(/\n/g, '<br>') // line breaks
|
| 636 |
.replace(/\[(.*?)\]/g, '<span class="bg-blue-100 text-blue-800 px-1 rounded">[$1]</span>'); // placeholders
|
| 637 |
|
|
|
|
| 797 |
.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>') // bold
|
| 798 |
.replace(/\_(.*?)\_/g, '<em>$1</em>') // italic
|
| 799 |
.replace(/<u>(.*?)<\/u>/g, '<u>$1</u>') // underline
|
| 800 |
+
.replace(/<span class="text-color-(.*?)">(.*?)<\/span>/g, '<span style="color: #$1">$2</span>') // predefined colors
|
| 801 |
+
.replace(/<span style="color: (.*?)">(.*?)<\/span>/g, '<span style="color: $1">$2</span>') // custom colors
|
| 802 |
.replace(/\n/g, '<br>') // line breaks
|
| 803 |
.replace(/\[(.*?)\]/g, '<span class="bg-blue-100 text-blue-800 px-1 rounded">[$1]</span>'); // placeholders
|
| 804 |
}
|
|
|
|
| 904 |
.replace(/_/g, '')
|
| 905 |
.replace(/<u>/g, '')
|
| 906 |
.replace(/<\/u>/g, '')
|
| 907 |
+
.replace(/<span class="text-color-(.*?)">/g, '')
|
| 908 |
.replace(/<span style="color: (.*?)">/g, '')
|
| 909 |
.replace(/<\/span>/g, '');
|
| 910 |
|
prompts.txt
CHANGED
|
@@ -1,8 +1,2 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
make the bold, italic, and underline buttons functional and make them have the correct functions
|
| 4 |
-
make the bold button actually bold the text, make the italic button actually italicize, and make the underline button actually underline the text
|
| 5 |
-
Don't make the formatting visible in the script editor. Just apply the format to the text
|
| 6 |
-
make the bold, italic, and underline buttons work properly.
|
| 7 |
-
make the bold, italic, and underline buttons work in the script and the content
|
| 8 |
-
allow me to change font colors and save custom font colors
|
|
|
|
| 1 |
+
seperate the custom font colors from the other font colors when saved
|
| 2 |
+
better separate the custom colors in the color palette
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|