theWitcher commited on
Commit
76b0e4f
·
1 Parent(s): 24caf9c

Refactored tool filtering logic in index.html to enhance search functionality by including name and description matches. Updated tools.json to standardize tool names for clarity and consistency.

Browse files
Files changed (2) hide show
  1. index.html +30 -23
  2. tools.json +6 -6
index.html CHANGED
@@ -1427,33 +1427,40 @@ sagi test
1427
 
1428
  let filtered = toolsData.tools;
1429
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1430
  if (filteredStatView === 'topRated') {
1431
- filtered = filtered.filter((tool) => tool.rating === 5);
1432
  } else if (filteredStatView === 'newTools') {
1433
- filtered = filtered.filter((tool) => tool.isNew);
1434
  }
1435
 
1436
- return filtered.filter((tool) => {
1437
- const searchTermLower = currentSearchTerm.toLowerCase();
1438
- const nameMatch = tool.name.toLowerCase().includes(searchTermLower);
1439
- const descMatch = tool.description
1440
- .toLowerCase()
1441
- .includes(searchTermLower);
1442
- const categoryNameMatch = getCategoryName(tool.category)
1443
- .toLowerCase()
1444
- .includes(searchTermLower);
1445
- const matchesSearch = nameMatch || descMatch || categoryNameMatch;
1446
-
1447
- let matchesCategoryFilter = true;
1448
- if (currentCategory === 'free') {
1449
- matchesCategoryFilter = tool.free === true;
1450
- } else {
1451
- matchesCategoryFilter =
1452
- currentCategory === 'all' || tool.category === currentCategory;
1453
- }
1454
-
1455
- return matchesCategoryFilter && matchesSearch;
1456
- });
1457
  }
1458
 
1459
  function updateStats() {
 
1427
 
1428
  let filtered = toolsData.tools;
1429
 
1430
+ // Filter by favorites if selected
1431
+ if (currentCategory === 'favorites') {
1432
+ filtered = filtered.filter((_, index) =>
1433
+ favorites.includes(index.toString())
1434
+ );
1435
+ } else if (currentCategory === 'free') {
1436
+ filtered = filtered.filter((tool) => tool.free === true);
1437
+ } else if (currentCategory !== 'all') {
1438
+ filtered = filtered.filter(
1439
+ (tool) => tool.category === currentCategory
1440
+ );
1441
+ }
1442
+
1443
+ // Search by name and description
1444
+ if (currentSearchTerm) {
1445
+ const searchLower = currentSearchTerm.toLowerCase();
1446
+ filtered = filtered.filter((tool) => {
1447
+ const nameMatch =
1448
+ tool.name && tool.name.toLowerCase().includes(searchLower);
1449
+ const descMatch =
1450
+ tool.description &&
1451
+ tool.description.toLowerCase().includes(searchLower);
1452
+ return nameMatch || descMatch; // Include both name and description in search
1453
+ });
1454
+ }
1455
+
1456
+ // Check for filteredStatView
1457
  if (filteredStatView === 'topRated') {
1458
+ filtered = filtered.filter((tool) => tool.rating >= 5);
1459
  } else if (filteredStatView === 'newTools') {
1460
+ filtered = filtered.filter((tool) => tool.isNew);
1461
  }
1462
 
1463
+ return filtered;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1464
  }
1465
 
1466
  function updateStats() {
tools.json CHANGED
@@ -2140,7 +2140,7 @@
2140
  "free": true
2141
  },
2142
  {
2143
- "name": "CapCut AI מחולל תמונות מטקסט",
2144
  "description": "כתיבת פרומפט קצר ולקבל מיד תמונה מקורית, או לשדרג תמונה קיימת בעזרת Image-to-Image. המנוע תומך בשליטה בסגנון וברזולוציה גבוהה.",
2145
  "url": "https://www.capcut.com/magic-tools/generate-image",
2146
  "logo": "https://i.pinimg.com/736x/6f/00/de/6f00dee60ba4bad35cf9b29690a52792.jpg",
@@ -2154,7 +2154,7 @@
2154
  "dateAdded": "2025-04-23T14:05:00Z"
2155
  },
2156
  {
2157
- "name": "CapCut AI המרת טקסט לתמונה",
2158
  "description": "הזנת פרומפט קצר (או תמונת־ייחוס) וקבלת תמונה ייחודית בזמן-אמת.",
2159
  "url": "https://www.capcut.com/magic-tools/convert-text-to-image",
2160
  "logo": "https://i.pinimg.com/736x/6f/00/de/6f00dee60ba4bad35cf9b29690a52792.jpg",
@@ -2168,7 +2168,7 @@
2168
  "dateAdded": "2025-04-23T14:10:00Z"
2169
  },
2170
  {
2171
- "name": "CapCut AI – שדרוג תמונות ל-4K (Upscale Image)",
2172
  "description": "הגדלת תמונות עד 4K, משחזר פרטים, מפחית רעש ומחדד קצוות - בלחיצה אחת וללא ירידת איכות.",
2173
  "url": "https://www.capcut.com/magic-tools/upscale-image",
2174
  "logo": "https://i.pinimg.com/736x/6f/00/de/6f00dee60ba4bad35cf9b29690a52792.jpg",
@@ -2182,7 +2182,7 @@
2182
  "dateAdded": "2025-04-23T14:15:00Z"
2183
  },
2184
  {
2185
- "name": "CapCut AI – מחולל פורטרטים (Generate Portrait)",
2186
  "description": "כלי Magic Tools חינמי שיוצר פורטרטים ייחודיים בלחיצה אחת: מעלים תמונה או בוחרים סגנון, וה-AI מייצר דיוקן ריאליסטי או אומנותי במגוון סגנונות (3D, מנגה, פופ ארט ועוד).",
2187
  "url": "https://www.capcut.com/magic-tools/generate-portrait",
2188
  "logo": "https://i.pinimg.com/736x/6f/00/de/6f00dee60ba4bad35cf9b29690a52792.jpg",
@@ -2197,7 +2197,7 @@
2197
  },
2198
 
2199
  {
2200
- "name": "CapCut upscale video",
2201
  "description": "כלי מקוון חינמי לשדרוג איכות הווידאו עד 4K באמצעות טכנולוגיית AI. מאפשר חידוד, הסרת טשטוש והוספת פרטים לווידאו בלחיצה אחת.",
2202
  "url": "https://www.capcut.com/magic-tools/upscale-video",
2203
  "logo": "https://i.pinimg.com/736x/6f/00/de/6f00dee60ba4bad35cf9b29690a52792.jpg",
@@ -2210,7 +2210,7 @@
2210
  "free": true
2211
  },
2212
  {
2213
- "name": "CapCut AI סגנון תמונה (Stylize Photo)",
2214
  "description": "מאפשר להלביש על התמונה שלך סגנונות אומנותיים (קומיקס, ציור שמן, מנגה ועוד) בלחיצה אחת, באמצעות טכנולוגיית Neural Style Transfer מתקדמת.",
2215
  "url": "https://www.capcut.com/magic-tools/stylize-photo",
2216
  "logo": "https://i.pinimg.com/736x/6f/00/de/6f00dee60ba4bad35cf9b29690a52792.jpg",
 
2140
  "free": true
2141
  },
2142
  {
2143
+ "name": "CapCut - Generate Image",
2144
  "description": "כתיבת פרומפט קצר ולקבל מיד תמונה מקורית, או לשדרג תמונה קיימת בעזרת Image-to-Image. המנוע תומך בשליטה בסגנון וברזולוציה גבוהה.",
2145
  "url": "https://www.capcut.com/magic-tools/generate-image",
2146
  "logo": "https://i.pinimg.com/736x/6f/00/de/6f00dee60ba4bad35cf9b29690a52792.jpg",
 
2154
  "dateAdded": "2025-04-23T14:05:00Z"
2155
  },
2156
  {
2157
+ "name": "CapCut - Convert Text to Image",
2158
  "description": "הזנת פרומפט קצר (או תמונת־ייחוס) וקבלת תמונה ייחודית בזמן-אמת.",
2159
  "url": "https://www.capcut.com/magic-tools/convert-text-to-image",
2160
  "logo": "https://i.pinimg.com/736x/6f/00/de/6f00dee60ba4bad35cf9b29690a52792.jpg",
 
2168
  "dateAdded": "2025-04-23T14:10:00Z"
2169
  },
2170
  {
2171
+ "name": "CapCut - Upscale Image",
2172
  "description": "הגדלת תמונות עד 4K, משחזר פרטים, מפחית רעש ומחדד קצוות - בלחיצה אחת וללא ירידת איכות.",
2173
  "url": "https://www.capcut.com/magic-tools/upscale-image",
2174
  "logo": "https://i.pinimg.com/736x/6f/00/de/6f00dee60ba4bad35cf9b29690a52792.jpg",
 
2182
  "dateAdded": "2025-04-23T14:15:00Z"
2183
  },
2184
  {
2185
+ "name": "CapCut - Generate Portrait",
2186
  "description": "כלי Magic Tools חינמי שיוצר פורטרטים ייחודיים בלחיצה אחת: מעלים תמונה או בוחרים סגנון, וה-AI מייצר דיוקן ריאליסטי או אומנותי במגוון סגנונות (3D, מנגה, פופ ארט ועוד).",
2187
  "url": "https://www.capcut.com/magic-tools/generate-portrait",
2188
  "logo": "https://i.pinimg.com/736x/6f/00/de/6f00dee60ba4bad35cf9b29690a52792.jpg",
 
2197
  },
2198
 
2199
  {
2200
+ "name": "CapCut - Upscale Video",
2201
  "description": "כלי מקוון חינמי לשדרוג איכות הווידאו עד 4K באמצעות טכנולוגיית AI. מאפשר חידוד, הסרת טשטוש והוספת פרטים לווידאו בלחיצה אחת.",
2202
  "url": "https://www.capcut.com/magic-tools/upscale-video",
2203
  "logo": "https://i.pinimg.com/736x/6f/00/de/6f00dee60ba4bad35cf9b29690a52792.jpg",
 
2210
  "free": true
2211
  },
2212
  {
2213
+ "name": "CapCut – Stylize Photo",
2214
  "description": "מאפשר להלביש על התמונה שלך סגנונות אומנותיים (קומיקס, ציור שמן, מנגה ועוד) בלחיצה אחת, באמצעות טכנולוגיית Neural Style Transfer מתקדמת.",
2215
  "url": "https://www.capcut.com/magic-tools/stylize-photo",
2216
  "logo": "https://i.pinimg.com/736x/6f/00/de/6f00dee60ba4bad35cf9b29690a52792.jpg",