Skip to content

Commit fc5ef42

Browse files
committed
- update page title and SEO with meta description tag
- rename UI elements from "OppositeFinder" to "Opposite Word Generator" - add slider to control number of opposites (1-6) - improve API prompt to specify language matching and exact count - update footer text and help section content - enhance share functionality with more descriptive text
1 parent 3555176 commit fc5ef42

File tree

1 file changed

+33
-24
lines changed

1 file changed

+33
-24
lines changed

tools/opposite_finder.html

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🔄</text></svg>">
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<title>OppositeFinder</title>
7+
<meta name="description" content="Free online opposite word generator tool. Find antonyms and opposites for any word or phrase with our AI-powered opposite generator.">
8+
<title>Opposite Word Generator | OppositeFinder</title>
89
<script src="https://cdn.tailwindcss.com"></script>
910
<script src="https://cdnjs.cloudflare.com/ajax/libs/json5/2.2.3/index.min.js" integrity="sha512-44jdhc+R2TFfzBflS3/dGNEABiNUxBkkrqwO7GWTvGsj3HkQNr3GESvI9PUvAxmqxSnTosR0Ij9y3+o+6J1hig==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
1011
<script>tailwind.config = {darkMode: 'class',theme: {extend: {colors: {primary: {50: '#f0f9ff',100: '#e0f2fe',200: '#bae6fd',300: '#7dd3fc',400: '#38bdf8',500: '#0ea5e9',600: '#0284c7',700: '#0369a1',800: '#075985',900: '#0c4a6e',}}}}};</script>
@@ -26,7 +27,7 @@
2627
<div class="container mx-auto px-4 flex justify-between items-center">
2728
<div class="flex items-center gap-2">
2829
<span class="text-2xl">🔄</span>
29-
<h1 class="text-2xl font-bold text-gray-800 dark:text-white">OppositeFinder</h1>
30+
<h1 class="text-2xl font-bold text-gray-800 dark:text-white">Opposite Word Generator</h1>
3031
</div>
3132
<button id="theme-toggle" class="p-2 rounded-full bg-gray-200 dark:bg-gray-700" aria-label="Toggle theme">
3233
<svg id="dark-icon" class="w-5 h-5 text-gray-800 dark:hidden" fill="currentColor" viewBox="0 0 20 20"><path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"></path></svg>
@@ -48,6 +49,18 @@ <h1 class="text-2xl font-bold text-gray-800 dark:text-white">OppositeFinder</h1>
4849
<div id="char-count" class="text-xs text-right mt-1 text-gray-500 dark:text-gray-400">0 characters</div>
4950
</div>
5051

52+
<div class="mb-4">
53+
<div class="flex justify-between items-center mb-2">
54+
<label for="count" class="text-sm font-medium text-gray-700 dark:text-gray-300">Number of Opposites:</label>
55+
<span id="count-value" class="text-sm text-gray-600 dark:text-gray-400">2</span>
56+
</div>
57+
<input type="range" id="count" min="1" max="6" step="1" value="2" class="w-full h-2 bg-gray-200 dark:bg-gray-700 rounded-lg appearance-none cursor-pointer accent-primary-600">
58+
<div class="flex justify-between text-xs text-gray-500 dark:text-gray-400 mt-1">
59+
<span>Fewer</span>
60+
<span>More</span>
61+
</div>
62+
</div>
63+
5164
<div class="mb-6">
5265
<div class="flex justify-between items-center mb-2">
5366
<label for="creativity" class="text-sm font-medium text-gray-700 dark:text-gray-300">Creativity Level:</label>
@@ -100,15 +113,16 @@ <h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300">Results:</h3>
100113

101114
<div class="border-t dark:border-gray-700 pt-4">
102115
<button id="help-toggle" class="flex justify-between items-center w-full py-2 text-left text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 rounded transition-colors">
103-
<span>How to Use OppositeFinder</span>
116+
<span>How to Use This Opposite Generator</span>
104117
<svg id="help-icon" class="h-5 w-5 transform transition-transform" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /></svg>
105118
</button>
106119
<div id="help-content" class="hidden mt-2">
107120
<div class="bg-primary-50 dark:bg-gray-700 border-l-4 border-primary-500 p-4 rounded-r-lg">
108-
<p class="text-sm text-gray-700 dark:text-gray-300 mb-3">OppositeFinder helps you discover opposites of words or phrases:</p>
121+
<p class="text-sm text-gray-700 dark:text-gray-300 mb-3">This opposite word generator helps you discover antonyms and opposites:</p>
109122
<ul class="text-sm text-gray-700 dark:text-gray-300 space-y-2 ml-5 list-disc">
110-
<li>Enter text in the input field</li>
111-
<li>Adjust the "Creativity" slider (higher = more creative results)</li>
123+
<li>Enter a word or phrase in the input field</li>
124+
<li>Adjust the number of opposites (2-6)</li>
125+
<li>Set the "Creativity" slider (higher = more creative results)</li>
112126
<li>Press "Find Opposite" or hit Enter</li>
113127
<li>Click any result to copy it</li>
114128
<li>Use history to revisit previous searches</li>
@@ -125,13 +139,14 @@ <h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300">Results:</h3>
125139

126140
<footer class="py-3 bg-white dark:bg-gray-800 mt-auto">
127141
<div class="container mx-auto px-4 text-center text-sm text-gray-500 dark:text-gray-400">
128-
OppositeFinder &copy; 2025 | Find opposites with AI
142+
Opposite Word Generator &copy; 2025 | The best free opposite generator online
129143
</div>
130144
</footer>
131145

132146
<script>
133-
// DOM Elements
134147
const inputEl = document.getElementById('input');
148+
const countSlider = document.getElementById('count');
149+
const countValue = document.getElementById('count-value');
135150
const creativitySlider = document.getElementById('creativity');
136151
const creativityValue = document.getElementById('creativity-value');
137152
const findOppositeBtn = document.getElementById('find-opposite');
@@ -152,19 +167,21 @@ <h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300">Results:</h3>
152167
const helpContent = document.getElementById('help-content');
153168
const toastEl = document.getElementById('toast');
154169

155-
// State
156170
const MAX_HISTORY_ITEMS = 5;
157171
let searchHistory = JSON.parse(localStorage.getItem('oppositeFinder_history') || '[]');
158172
let currentResults = [];
159173

160-
// Initialize
161174
init();
162175

163176
function init() {
164-
// Event listeners
177+
countSlider.addEventListener('input', () => {
178+
countValue.textContent = countSlider.value;
179+
});
180+
165181
creativitySlider.addEventListener('input', () => {
166182
creativityValue.textContent = `${creativitySlider.value}%`;
167183
});
184+
168185
findOppositeBtn.addEventListener('click', findOpposite);
169186
inputEl.addEventListener('input', updateCharCount);
170187
inputEl.addEventListener('keydown', e => {
@@ -181,13 +198,11 @@ <h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300">Results:</h3>
181198
historyToggleBtn.addEventListener('click', () => toggleSection(historyContent, historyIcon));
182199
helpToggleBtn.addEventListener('click', () => toggleSection(helpContent, helpIcon));
183200

184-
// Initialize
185201
updateCharCount();
186202
loadTheme();
187203
updateHistoryDisplay();
188204
}
189205

190-
// Theme handling
191206
function loadTheme() {
192207
const savedTheme = localStorage.getItem('oppositeFinder_theme') || 'light';
193208
if (savedTheme === 'dark') document.documentElement.classList.add('dark');
@@ -209,7 +224,6 @@ <h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300">Results:</h3>
209224
iconEl.style.transform = isHidden ? 'rotate(180deg)' : '';
210225
}
211226

212-
// History handling
213227
function addToHistory(query, opposites) {
214228
const historyItem = {
215229
query,
@@ -257,14 +271,12 @@ <h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300">Results:</h3>
257271
});
258272
}
259273

260-
// Notification system
261274
function showToast(message, duration = 3000) {
262275
toastEl.textContent = message;
263276
toastEl.classList.add('show');
264277
setTimeout(() => toastEl.classList.remove('show'), duration);
265278
}
266279

267-
// Copy functionality
268280
function copyToClipboard(text) {
269281
navigator.clipboard.writeText(text)
270282
.then(() => showToast(`Copied: "${text}"`))
@@ -279,14 +291,13 @@ <h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300">Results:</h3>
279291
.catch(() => showToast('Failed to copy text'));
280292
}
281293

282-
// Share functionality
283294
function shareResults() {
284295
if (currentResults.length === 0) return;
285-
const shareText = `OppositeFinder results for "${inputEl.value}":\n${currentResults.join('\n')}`;
296+
const shareText = `Opposite Word Generator results for "${inputEl.value}":\n${currentResults.join('\n')}`;
286297

287298
if (navigator.share) {
288299
navigator.share({
289-
title: 'OppositeFinder Results',
300+
title: 'Opposite Generator Results',
290301
text: shareText
291302
}).catch(() => fallbackShare(shareText));
292303
} else {
@@ -300,7 +311,6 @@ <h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300">Results:</h3>
300311
.catch(() => showToast('Failed to copy for sharing'));
301312
}
302313

303-
// Display results
304314
function displayOpposites(opposites) {
305315
resultEl.innerHTML = '';
306316
currentResults = opposites;
@@ -324,7 +334,6 @@ <h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300">Results:</h3>
324334
resultEl.appendChild(resultsGrid);
325335
}
326336

327-
// Main functionality
328337
async function findOpposite() {
329338
const inputText = inputEl.value.trim();
330339
if (!inputText) {
@@ -333,16 +342,16 @@ <h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300">Results:</h3>
333342
return;
334343
}
335344

336-
// Toggle states
337345
findOppositeBtn.disabled = true;
338346
findOppositeBtn.textContent = "Finding...";
339347
resultContainer.classList.remove('hidden');
340348
loadingEl.classList.remove('hidden');
341349

350+
const count = parseInt(countSlider.value);
342351
const creativity = creativitySlider.value / 100;
343352

344-
let botMessage = `I am currently functioning as the OppositeFinder API. I always strive to find the maximum possible amount of semantic opposites and will provide responses in this JSON format: {"opposites":["opposite1", "opposite2", ...]}`;
345-
let userMessage = `Find opposites for: ${inputText}`;
353+
let botMessage = `I am currently functioning as the OppositeFinder API. I will find exactly ${count} semantic opposites in the SAME LANGUAGE as the input text. I will provide responses in this JSON format: {"opposites":["opposite1", "opposite2", ...]}`;
354+
let userMessage = `input text: \`\`\`${inputText}\`\`\``;
346355

347356
try {
348357
const response = await fetch('https://chatgpt.tobiasmue91.workers.dev/', {

0 commit comments

Comments
 (0)