theWitcher commited on
Commit
6fa48cc
·
1 Parent(s): 52a0f9c

add manifest

Browse files
chatbot.html CHANGED
@@ -1,143 +1,153 @@
1
  <!DOCTYPE html>
2
  <html lang="he" dir="rtl">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>צ'אטבוט</title>
7
- <style>
8
- body {
9
- margin: 0;
10
- font-family: 'Arial', sans-serif;
11
- background-color: #f3f4f6;
12
- }
13
- .chat-container {
14
- display: flex;
15
- flex-direction: column;
16
- height: 100vh;
17
- }
18
- .chat-header {
19
- background: linear-gradient(90deg, #3b82f6, #8b5cf6);
20
- color: white;
21
- padding: 16px;
22
- font-size: 18px;
23
- font-weight: bold;
24
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
25
- }
26
- .chat-messages {
27
- flex: 1;
28
- padding: 16px;
29
- overflow-y: auto;
30
- background-color: #ffffff;
31
- }
32
- .chat-bubble {
33
- max-width: 80%;
34
- margin-bottom: 10px;
35
- padding: 10px 14px;
36
- border-radius: 20px;
37
- line-height: 1.5;
38
- font-size: 14px;
39
- }
40
- .user-bubble {
41
- background-color: #3b82f6;
42
- color: white;
43
- margin-left: auto;
44
- border-bottom-right-radius: 0;
45
- }
46
- .bot-bubble {
47
- background-color: #e5e7eb;
48
- color: #111827;
49
- margin-right: auto;
50
- border-bottom-left-radius: 0;
51
- }
52
- .chat-input {
53
- display: flex;
54
- padding: 12px;
55
- border-top: 1px solid #d1d5db;
56
- background-color: #f9fafb;
57
- }
58
- .chat-input input {
59
- flex: 1;
60
- padding: 10px;
61
- border-radius: 9999px;
62
- border: 1px solid #d1d5db;
63
- font-size: 14px;
64
- outline: none;
65
- }
66
- .chat-input button {
67
- margin-right: 8px;
68
- background-color: #8b5cf6;
69
- color: white;
70
- border: none;
71
- border-radius: 9999px;
72
- padding: 10px 16px;
73
- font-size: 14px;
74
- cursor: pointer;
75
- }
76
- </style>
77
- <!-- Google tag (gtag.js) -->
78
- <script async src="https://www.googletagmanager.com/gtag/js?id=G-JVF8N1DVSG"></script>
79
- <script>
80
- window.dataLayer = window.dataLayer || [];
81
- function gtag(){dataLayer.push(arguments);}
82
- gtag('js', new Date());
83
-
84
- gtag('config', 'G-JVF8N1DVSG');
85
- </script>
86
- </head>
87
- <body>
88
- <div class="chat-container">
89
- <div class="chat-header">
90
- צ'אט עם הבינה של שגיא
91
- <span id="toolsCount" class="ml-2 text-sm bg-white text-purple-600 font-semibold px-2 py-1 rounded-full shadow-sm"></span>
92
- </div>
93
 
94
- <div class="chat-messages" id="chatMessages">
95
- <div class="chat-bubble bot-bubble">שלום! איך אפשר לעזור לך היום?</div>
96
- </div>
97
- <div class="chat-input">
98
- <input type="text" id="chatInput" placeholder="הקלד הודעה...">
99
- <button onclick="sendMessage()">שלח</button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  </div>
101
- </div>
102
 
103
- <script>
104
- // קריאת tools.json ועדכון כמות הכלים
105
- fetch('tools.json')
106
- .then(res => res.json())
107
- .then(tools => {
108
- const count = tools.length;
109
- document.getElementById('toolsCount').textContent = `${count} כלים זמינים`;
110
- })
111
- .catch(err => {
112
- console.error("שגיאה בטעינת כמות הכלים:", err);
113
- document.getElementById('toolsCount').textContent = 'טעינה נכשלה';
114
- });
115
-
116
- function sendMessage() {
117
- const input = document.getElementById('chatInput');
118
- const message = input.value.trim();
119
- if (!message) return;
120
-
121
- const messagesDiv = document.getElementById('chatMessages');
 
 
122
 
123
- const userBubble = document.createElement('div');
124
- userBubble.className = 'chat-bubble user-bubble';
125
- userBubble.textContent = message;
126
- messagesDiv.appendChild(userBubble);
127
 
128
- const botBubble = document.createElement('div');
129
- botBubble.className = 'chat-bubble bot-bubble';
130
- botBubble.textContent = getBotResponse(message);
131
- messagesDiv.appendChild(botBubble);
132
 
133
- input.value = '';
134
- messagesDiv.scrollTop = messagesDiv.scrollHeight;
135
- }
136
 
137
- function getBotResponse(userText) {
138
- // כאן תוכל לשלב לוגיקה אמיתית או חיבור ל-AI
139
- return 'זוהי תגובה אוטומטית :)';
140
- }
141
- </script>
142
- </body>
143
- </html>
 
1
  <!DOCTYPE html>
2
  <html lang="he" dir="rtl">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>צ'אטבוט</title>
7
+ <style>
8
+ body {
9
+ margin: 0;
10
+ font-family: 'Arial', sans-serif;
11
+ background-color: #f3f4f6;
12
+ }
13
+ .chat-container {
14
+ display: flex;
15
+ flex-direction: column;
16
+ height: 100vh;
17
+ }
18
+ .chat-header {
19
+ background: linear-gradient(90deg, #3b82f6, #8b5cf6);
20
+ color: white;
21
+ padding: 16px;
22
+ font-size: 18px;
23
+ font-weight: bold;
24
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
25
+ }
26
+ .chat-messages {
27
+ flex: 1;
28
+ padding: 16px;
29
+ overflow-y: auto;
30
+ background-color: #ffffff;
31
+ }
32
+ .chat-bubble {
33
+ max-width: 80%;
34
+ margin-bottom: 10px;
35
+ padding: 10px 14px;
36
+ border-radius: 20px;
37
+ line-height: 1.5;
38
+ font-size: 14px;
39
+ }
40
+ .user-bubble {
41
+ background-color: #3b82f6;
42
+ color: white;
43
+ margin-left: auto;
44
+ border-bottom-right-radius: 0;
45
+ }
46
+ .bot-bubble {
47
+ background-color: #e5e7eb;
48
+ color: #111827;
49
+ margin-right: auto;
50
+ border-bottom-left-radius: 0;
51
+ }
52
+ .chat-input {
53
+ display: flex;
54
+ padding: 12px;
55
+ border-top: 1px solid #d1d5db;
56
+ background-color: #f9fafb;
57
+ }
58
+ .chat-input input {
59
+ flex: 1;
60
+ padding: 10px;
61
+ border-radius: 9999px;
62
+ border: 1px solid #d1d5db;
63
+ font-size: 14px;
64
+ outline: none;
65
+ }
66
+ .chat-input button {
67
+ margin-right: 8px;
68
+ background-color: #8b5cf6;
69
+ color: white;
70
+ border: none;
71
+ border-radius: 9999px;
72
+ padding: 10px 16px;
73
+ font-size: 14px;
74
+ cursor: pointer;
75
+ }
76
+ </style>
77
+ <!-- Google tag (gtag.js) -->
78
+ <script
79
+ async
80
+ src="https://www.googletagmanager.com/gtag/js?id=G-JVF8N1DVSG"
81
+ ></script>
82
+ <script>
83
+ window.dataLayer = window.dataLayer || [];
84
+ function gtag() {
85
+ dataLayer.push(arguments);
86
+ }
87
+ gtag('js', new Date());
 
 
 
 
 
88
 
89
+ gtag('config', 'G-JVF8N1DVSG');
90
+ </script>
91
+ </head>
92
+ <body>
93
+ <div class="chat-container">
94
+ <div class="chat-header">
95
+ צ'אט עם הבינה של שגיא
96
+ <span
97
+ id="toolsCount"
98
+ class="ml-2 text-sm bg-white text-purple-600 font-semibold px-2 py-1 rounded-full shadow-sm"
99
+ ></span>
100
+ </div>
101
+
102
+ <div class="chat-messages" id="chatMessages">
103
+ <div class="chat-bubble bot-bubble">שלום! איך אפשר לעזור לך היום?</div>
104
+ </div>
105
+ <div class="chat-input">
106
+ <input type="text" id="chatInput" placeholder="הקלד הודעה..." />
107
+ <button onclick="sendMessage()">שלח</button>
108
+ </div>
109
  </div>
 
110
 
111
+ <script>
112
+ // קריאת tools.json ועדכון כמות הכלים
113
+ fetch('tools.json')
114
+ .then((res) => res.json())
115
+ .then((tools) => {
116
+ const count = tools.length;
117
+ document.getElementById(
118
+ 'toolsCount'
119
+ ).textContent = `${count} כלים זמינים`;
120
+ })
121
+ .catch((err) => {
122
+ console.error('שגיאה בטעינת כמות הכלים:', err);
123
+ document.getElementById('toolsCount').textContent = 'טעינה נכשלה';
124
+ });
125
+
126
+ function sendMessage() {
127
+ const input = document.getElementById('chatInput');
128
+ const message = input.value.trim();
129
+ if (!message) return;
130
+
131
+ const messagesDiv = document.getElementById('chatMessages');
132
 
133
+ const userBubble = document.createElement('div');
134
+ userBubble.className = 'chat-bubble user-bubble';
135
+ userBubble.textContent = message;
136
+ messagesDiv.appendChild(userBubble);
137
 
138
+ const botBubble = document.createElement('div');
139
+ botBubble.className = 'chat-bubble bot-bubble';
140
+ botBubble.textContent = getBotResponse(message);
141
+ messagesDiv.appendChild(botBubble);
142
 
143
+ input.value = '';
144
+ messagesDiv.scrollTop = messagesDiv.scrollHeight;
145
+ }
146
 
147
+ function getBotResponse(userText) {
148
+ // כאן תוכל לשלב לוגיקה אמיתית או חיבור ל-AI
149
+ return 'זוהי תגובה אוטומטית :)';
150
+ }
151
+ </script>
152
+ </body>
153
+ </html>
favicon-32x32.png ADDED

Git LFS Details

  • SHA256: e655860621f71bb2456f0f68789270d79f1019a4bb352c5f998fc8be929a1220
  • Pointer size: 132 Bytes
  • Size of remote file: 1.12 MB
icon-192.png ADDED

Git LFS Details

  • SHA256: d48505af256fc743194529a221a857cfa95216e783c3c16ab2a57658576163dc
  • Pointer size: 132 Bytes
  • Size of remote file: 1.07 MB
icon-512x512.png ADDED

Git LFS Details

  • SHA256: 9990fb934269ae924299d277a319745be7ee239793416f21b732ee4ddac40b50
  • Pointer size: 132 Bytes
  • Size of remote file: 1.01 MB
index.html CHANGED
The diff for this file is too large to render. See raw diff
 
index_with_pwa_favicon.html ADDED
@@ -0,0 +1,1212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--
2
+ https://thewitcher-sagi-ai-tools.static.hf.space/index.html
3
+ https://huggingface.co/spaces/theWitcher/sagi-ai-tools
4
+
5
+ https://chatgpt.com/c/67efa5ae-ab80-8005-a7d4-de3ced6ccec4
6
+
7
+ -->
8
+ <!DOCTYPE html>
9
+
10
+ <html dir="rtl" lang="he">
11
+ <head>
12
+ <meta charset="utf-8"/>
13
+ <meta content="width=device-width, initial-scale=1.0" name="viewport"/>
14
+ <title>ארגז הכלים שלי לבינה מלאכותית</title>
15
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet"/>
16
+ <style>
17
+ @import url('https://fonts.googleapis.com/css2?family=Arimo:wght@400;500;600;700&display=swap');
18
+
19
+ body {
20
+ font-family: 'Arimo', sans-serif;
21
+ background-color: #f9fafb;
22
+ }
23
+
24
+ .tool-card:hover {
25
+ transform: translateY(-5px);
26
+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
27
+ }
28
+
29
+ .category-filter .active {
30
+ background-color: #3b82f6;
31
+ color: white;
32
+ }
33
+
34
+ .gradient-text {
35
+ background: linear-gradient(90deg, #3b82f6, #8b5cf6);
36
+ -webkit-background-clip: text;
37
+ background-clip: text;
38
+ color: transparent;
39
+ }
40
+
41
+ /* RTL specific styles */
42
+ [dir="rtl"] .rotate-180 {
43
+ transform: rotate(180deg);
44
+ }
45
+
46
+ /* Mobile menu styles */
47
+ .mobile-menu {
48
+ max-height: 0;
49
+ overflow: hidden;
50
+ transition: max-height 0.3s ease-out;
51
+ }
52
+
53
+ .mobile-menu.open {
54
+ max-height: 500px;
55
+ }
56
+
57
+ /* Admin badge */
58
+ .admin-badge {
59
+ position: absolute;
60
+ top: -8px;
61
+ right: -8px;
62
+ background-color: #ef4444;
63
+ color: white;
64
+ border-radius: 9999px;
65
+ width: 20px;
66
+ height: 20px;
67
+ display: flex;
68
+ align-items: center;
69
+ justify-content: center;
70
+ font-size: 10px;
71
+ }
72
+
73
+ /* Futuristic profile image */
74
+ .profile-container {
75
+ position: relative;
76
+ width: 200px;
77
+ height: 200px;
78
+ margin: 0 auto;
79
+ }
80
+
81
+ .profile-image {
82
+ width: 100%;
83
+ height: 100%;
84
+ border-radius: 50%;
85
+ object-fit: cover;
86
+ border: 4px solid #3b82f6;
87
+ box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
88
+ position: relative;
89
+ z-index: 2;
90
+ }
91
+
92
+ .tech-circle {
93
+ position: absolute;
94
+ border-radius: 50%;
95
+ border: 2px solid rgba(59, 130, 246, 0.7);
96
+ animation: rotate infinite linear;
97
+ }
98
+
99
+ .tech-circle-1 {
100
+ width: 220px;
101
+ height: 220px;
102
+ top: -10px;
103
+ left: -10px;
104
+ animation-duration: 15s;
105
+ border-style: dashed;
106
+ }
107
+
108
+ .tech-circle-2 {
109
+ width: 240px;
110
+ height: 240px;
111
+ top: -20px;
112
+ left: -20px;
113
+ animation-duration: 20s;
114
+ animation-direction: reverse;
115
+ }
116
+
117
+ .tech-circle-3 {
118
+ width: 260px;
119
+ height: 260px;
120
+ top: -30px;
121
+ left: -30px;
122
+ animation-duration: 25s;
123
+ border-style: dotted;
124
+ }
125
+
126
+ @keyframes rotate {
127
+ from { transform: rotate(0deg); }
128
+ to { transform: rotate(360deg); }
129
+ }
130
+
131
+ .tech-dots {
132
+ position: absolute;
133
+ width: 100%;
134
+ height: 100%;
135
+ border-radius: 50%;
136
+ z-index: 1;
137
+ }
138
+
139
+ .tech-dot {
140
+ position: absolute;
141
+ width: 8px;
142
+ height: 8px;
143
+ background-color: #8b5cf6;
144
+ border-radius: 50%;
145
+ transform: translate(-50%, -50%);
146
+ }
147
+
148
+ /* Futuristic AI elements */
149
+ .ai-particle {
150
+ position: absolute;
151
+ background: linear-gradient(135deg, #3b82f6, #8b5cf6);
152
+ border-radius: 50%;
153
+ opacity: 0.6;
154
+ filter: blur(10px);
155
+ z-index: 0;
156
+ }
157
+
158
+ .ai-circuit {
159
+ position: absolute;
160
+ width: 100%;
161
+ height: 100%;
162
+ background-image:
163
+ radial-gradient(circle at center, transparent 0%, #f9fafb 100%),
164
+ linear-gradient(90deg, transparent 49%, rgba(59, 130, 246, 0.1) 50%, transparent 51%),
165
+ linear-gradient(0deg, transparent 49%, rgba(59, 130, 246, 0.1) 50%, transparent 51%);
166
+ background-size: 20px 20px;
167
+ border-radius: 50%;
168
+ opacity: 0.3;
169
+ }
170
+ /* Added cursor style for clickable stats */
171
+ .clickable-stat:hover {
172
+ cursor: pointer;
173
+ background-color: #f3f4f6; /* Slightly lighter gray on hover */
174
+ }
175
+ </style>
176
+ <!-- Google tag (gtag.js) -->
177
+ <script async="" src="https://www.googletagmanager.com/gtag/js?id=G-JVF8N1DVSG"></script>
178
+ <script>
179
+ window.dataLayer = window.dataLayer || [];
180
+ function gtag(){dataLayer.push(arguments);}
181
+ gtag('js', new Date());
182
+
183
+ gtag('config', 'G-JVF8N1DVSG');
184
+ </script>
185
+ <link href="favicon-32.png" rel="icon" sizes="32x32" type="image/png"/><link href="manifest.json" rel="manifest"/><meta content="yes" name="apple-mobile-web-app-capable"/><meta content="AI Tools" name="apple-mobile-web-app-title"/><link href="icon-192.png" rel="apple-touch-icon"/><meta content="#3b82f6" name="theme-color"/></head>
186
+ <body class="min-h-screen">
187
+ <div class="hidden bg-green-100 text-green-800 text-center py-2 text-sm font-semibold" id="newToolBanner">
188
+ 🎉 התווסף כלי חדש: <span id="newToolName"></span> – <a class="underline" href="#toolsContainer">צפו עכשיו</a>
189
+ <button class="ml-4 text-green-800 font-bold" id="closeBanner">×</button>
190
+ </div>
191
+ <!-- Header -->
192
+ <header class="sticky top-0 z-50 backdrop-blur-md bg-white/80 shadow-md border-b border-gray-200">
193
+ <div class="container mx-auto px-4 py-4">
194
+ <div class="flex justify-between items-center">
195
+ <div class="flex items-center">
196
+ <!-- Mobile menu button -->
197
+ <button class="md:hidden text-gray-600 mr-4" id="mobileMenuButton">
198
+ <i class="fas fa-bars text-xl"></i>
199
+ </button>
200
+ <div>
201
+ <h1 class="text-2xl md:text-3xl font-bold gradient-text">ארגז הכלים שלי ל-AI</h1>
202
+ <p class="text-gray-600 text-sm md:text-base mt-1">אוסף כלי הבינה המלאכותית המומלצים שלי</p>
203
+ </div>
204
+ </div>
205
+ <div class="hidden md:flex items-center space-x-4 space-x-reverse">
206
+ <!-- /* --- Refresh Button - Still useful for resetting filters/sort --- */ -->
207
+ <button class="px-5 py-2 rounded-xl bg-gradient-to-l from-blue-600 to-indigo-500 text-white shadow-md hover:shadow-lg hover:from-blue-700 hover:to-indigo-600 transition-all duration-300" id="refreshBtn">
208
+ <i class="fas fa-sync-alt ml-2"></i> אפס תצוגה
209
+ </button>
210
+ <!-- /* --- Admin Edit Button - Uncomment if needed --- */ -->
211
+ <button class="px-5 py-2 rounded-xl bg-gradient-to-l from-pink-500 to-purple-600 text-white shadow-md hover:shadow-lg hover:from-pink-600 hover:to-purple-700 transition-all duration-300 relative" id="editJsonBtn">
212
+ <i class="fas fa-edit ml-2"></i> הציעו כלי חדש
213
+ <span class="admin-badge">N</span>
214
+ </button>
215
+ </div>
216
+ </div>
217
+ <!-- /* --- Mobile menu --- */ -->
218
+ <div class="mobile-menu md:hidden mt-4" id="mobileMenu">
219
+ <div class="flex flex-col space-y-2 py-2">
220
+ <button class="px-5 py-2 rounded-xl bg-gradient-to-l from-blue-600 to-indigo-500 text-white shadow-md hover:shadow-lg hover:from-blue-700 hover:to-indigo-600 transition-all duration-300" id="refreshBtnMobile">
221
+ <i class="fas fa-sync-alt ml-2"></i> אפס תצוגה
222
+ </button>
223
+ <!-- /* --- Admin Edit Button (Mobile) - Uncomment if needed --- */ -->
224
+ <button class="px-5 py-2 rounded-xl bg-gradient-to-l from-pink-500 to-purple-600 text-white shadow-md hover:shadow-lg hover:from-pink-600 hover:to-purple-700 transition-all duration-300 relative" id="editJsonBtn">
225
+ <i class="fas fa-edit ml-2"></i> הציעו כלי חדש
226
+ <span class="admin-badge">N</span>
227
+ </button>
228
+ </div>
229
+ </div>
230
+ </div>
231
+ </header>
232
+ <!-- /* --- Main Content --- */ -->
233
+ <main class="container mx-auto px-4 py-8">
234
+ <!-- /* --- About Me Section --- */ -->
235
+ <div class="bg-white rounded-lg shadow-sm p-6 border border-gray-100 mb-8 relative overflow-hidden">
236
+ <!-- /* ... (content unchanged) ... */ -->
237
+ <div class="ai-particle" style="width: 100px; height: 100px; top: -30px; right: -30px;"></div>
238
+ <div class="ai-particle" style="width: 150px; height: 150px; bottom: -50px; left: -50px;"></div>
239
+ <div class="ai-particle" style="width: 80px; height: 80px; top: 50%; right: 20%;"></div>
240
+ <h2 class="text-2xl font-bold mb-6 text-gray-800 border-b pb-2">קצת עליי</h2>
241
+ <div class="flex flex-col md:flex-row gap-6">
242
+ <div class="md:w-1/3">
243
+ <div class="profile-container">
244
+ <div class="ai-circuit"></div>
245
+ <div class="tech-circle tech-circle-1"></div>
246
+ <div class="tech-circle tech-circle-2"></div>
247
+ <div class="tech-circle tech-circle-3"></div>
248
+ <div class="tech-dots">
249
+ <div class="tech-dot" style="top: 10%; left: 50%;"></div>
250
+ <div class="tech-dot" style="top: 50%; left: 10%;"></div>
251
+ <div class="tech-dot" style="top: 90%; left: 50%;"></div>
252
+ <div class="tech-dot" style="top: 50%; left: 90%;"></div>
253
+ <div class="tech-dot" style="top: 30%; left: 30%;"></div>
254
+ <div class="tech-dot" style="top: 70%; left: 70%;"></div>
255
+ <div class="tech-dot" style="top: 30%; left: 70%;"></div>
256
+ <div class="tech-dot" style="top: 70%; left: 30%;"></div>
257
+ </div>
258
+ <img alt="שגיא בר און" class="profile-image" src="https://i.imgur.com/cnlxCuj.jpeg"/>
259
+ </div>
260
+ </div>
261
+ <div class="md:w-2/3">
262
+ <h3 class="text-xl font-semibold mb-4">שגיא בר און</h3>
263
+ <p class="text-gray-700 mb-4">
264
+ אני חוקר ויועץ בתחום הבינה המלאכותית, מאסטר NLP, ובעל ניסיון של למעלה מ-25 שנה בתעשיית ההייטק. בעל מומחיות רחבה בפיתוח תוכנה, אוטומציה, ניהול פרויקטים ואסטרטגיה עסקית.
265
+ </p>
266
+ <p class="text-gray-700 mb-4">
267
+ מרצה אורח באוניברסיטת רייכמן וחבר בסגל הבוחנים של מה"ט - המכון הממשלתי להכשרה בטכנולוגיה ובמדע - לבחינות מהנדסי תוכנה באוניברסיטאות ובמכללות, וכן מנטור לAI במסגרת משרד החינוך.
268
+ </p>
269
+ <p class="text-gray-700 mb-4">
270
+ בעל תואר שני במנהל עסקים עם התמחות בבינה מלאכותית, תואר ראשון (BSc) במדעי המחשב והנדסאי תוכנה. ההרצאות משלבות ידע עדכני, חשיבה ביקורתית והתנסות חווייתית, מתוך מטרה להעצים אנשים ולאפשר להם להשתמש בטכנולוגיה בחוכמה ובקלות.
271
+ </p>
272
+ <p class="text-gray-700">
273
+ שמתי לי למטרה להנגיש, להסביר ולחבר את הטכנולוגיה בצורה פשוטה וברורה לכולם.
274
+ </p>
275
+ </div>
276
+ </div>
277
+ </div>
278
+ <!-- /* --- Search and Filters --- */ -->
279
+ <div class="mb-8">
280
+ <!-- /* ... (content unchanged) ... */ -->
281
+ <div class="flex flex-col md:flex-row md:items-center md:justify-between gap-4">
282
+ <div class="relative w-full md:w-96">
283
+ <input class="w-full pr-10 pl-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition" id="searchInput" placeholder="חפש כלים..." type="text"/>
284
+ <i class="fas fa-search absolute right-3 top-3.5 text-gray-400"></i>
285
+ </div>
286
+ <div class="flex items-center space-x-2 space-x-reverse">
287
+ <span class="text-gray-600 hidden md:block">סנן לפי:</span>
288
+ <div class="category-filter flex flex-wrap gap-2">
289
+ <button class="filter-btn px-3 py-1 rounded-full border text-sm transition border-gray-300 text-gray-700 bg-white hover:bg-blue-50" data-category="all">הכל</button>
290
+ <button class="filter-btn px-3 py-1 rounded-full border text-sm transition border-gray-300 text-gray-700 bg-white hover:bg-blue-50" data-category="productivity">פרודוקטיביות</button>
291
+ <button class="filter-btn px-3 py-1 rounded-full border text-sm transition border-gray-300 text-gray-700 bg-white hover:bg-blue-50" data-category="writing">כתיבה</button>
292
+ <button class="filter-btn px-3 py-1 rounded-full border text-sm transition border-gray-300 text-gray-700 bg-white hover:bg-blue-50" data-category="design">עיצוב</button>
293
+ <button class="filter-btn px-3 py-1 rounded-full border text-sm transition border-gray-300 text-gray-700 bg-white hover:bg-blue-50" data-category="coding">תכנות</button>
294
+ <button class="filter-btn px-3 py-1 rounded-full border text-sm transition border-gray-300 text-gray-700 bg-white hover:bg-blue-50" data-category="video">וידאו</button>
295
+ </div>
296
+ </div>
297
+ </div>
298
+ </div>
299
+ <!-- /* --- Stats --- */ -->
300
+ <div class="grid grid-cols-2 md:grid-cols-4 gap-4 mb-8">
301
+ <!-- /* ... (content unchanged, including clickable stat boxes) ... */ -->
302
+ <div class="bg-white p-4 rounded-lg shadow-sm border border-gray-100">
303
+ <div class="flex items-center">
304
+ <div class="p-3 rounded-full bg-blue-50 text-blue-600 ml-3"> <i class="fas fa-tools text-lg"></i> </div>
305
+ <div> <p class="text-gray-500 text-sm">סה"כ כלים</p> <h3 class="text-xl font-semibold" id="totalTools">0</h3> </div>
306
+ </div>
307
+ </div>
308
+ <div class="bg-white p-4 rounded-lg shadow-sm border border-gray-100 transition clickable-stat" id="topRatedStatBox">
309
+ <div class="flex items-center">
310
+ <div class="p-3 rounded-full bg-purple-50 text-purple-600 ml-3"> <i class="fas fa-star text-lg"></i> </div>
311
+ <div> <p class="text-gray-500 text-sm">מובילים בדירוג</p> <h3 class="text-xl font-semibold" id="topRated">0</h3> </div>
312
+ </div>
313
+ </div>
314
+ <div class="bg-white p-4 rounded-lg shadow-sm border border-gray-100 transition clickable-stat" id="newToolsStatBox">
315
+ <div class="flex items-center">
316
+ <div class="p-3 rounded-full bg-green-50 text-green-600 ml-3"> <i class="fas fa-bolt text-lg"></i> </div>
317
+ <div> <p class="text-gray-500 text-sm">חדשים השבוע</p> <h3 class="text-xl font-semibold" id="newTools">0</h3> </div>
318
+ </div>
319
+ </div>
320
+ <div class="bg-white p-4 rounded-lg shadow-sm border border-gray-100">
321
+ <div class="flex items-center">
322
+ <div class="p-3 rounded-full bg-yellow-50 text-yellow-600 ml-3"> <i class="fas fa-tags text-lg"></i> </div>
323
+ <div> <p class="text-gray-500 text-sm">קטגוריות</p> <h3 class="text-xl font-semibold" id="totalCategories">0</h3> </div>
324
+ </div>
325
+ </div>
326
+ </div>
327
+ <!-- /* --- Tools Grid --- */ -->
328
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" id="toolsContainer">
329
+ <!-- /* --- Tools will be loaded here --- */ -->
330
+ <p class="text-center text-gray-500 col-span-full" id="loadingMessage">טוען כלים...</p>
331
+ </div>
332
+ <!-- /* --- YouTube Videos Section --- */ -->
333
+ <div class="mt-16">
334
+ <!-- /* ... (content unchanged) ... */ -->
335
+ <h2 class="text-2xl font-bold mb-6 text-gray-800 border-b pb-2">סרטונים נבחרים מערוץ היוטיוב שלי</h2>
336
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" id="videosContainer">
337
+ <!-- /* --- Videos will be loaded here --- */ -->
338
+ </div>
339
+ </div>
340
+ </main>
341
+ <!-- /* --- JSON Editor Modal (Admin Feature) --- */ -->
342
+ <div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden" id="jsonEditorModal">
343
+ <!-- /* ... (content unchanged) ... */ -->
344
+ <div class="bg-white rounded-lg shadow-xl w-full max-w-4xl max-h-[90vh] flex flex-col">
345
+ <div class="px-6 py-4 border-b border-gray-200 flex justify-between items-center">
346
+ <h3 class="text-lg font-semibold">עריכת הנתונים ב-JSON</h3>
347
+ <button class="text-gray-500 hover:text-gray-700" id="closeModalBtn"><i class="fas fa-times"></i></button>
348
+ </div>
349
+ <div class="p-6 flex-1 overflow-auto">
350
+ <div class="flex mb-4">
351
+ <button class="px-4 py-2 bg-blue-600 text-white rounded-l-lg" id="showToolsBtn">כלים</button>
352
+ <button class="px-4 py-2 bg-gray-200 text-gray-700 rounded-r-lg" id="showVideosBtn">סרטונים</button>
353
+ </div>
354
+ <textarea class="w-full h-96 p-4 border border-gray-300 rounded-lg font-mono text-sm spellcheck=" false"="" id="jsonEditor" style="direction: ltr; text-align: left;"></textarea>
355
+ </div>
356
+ <div class="px-6 py-4 border-t border-gray-200 flex justify-end space-x-3 space-x-reverse">
357
+ <button class="px-4 py-2 border border-gray-300 rounded-lg hover:bg-gray-50 transition" id="cancelEditBtn">ביטול</button>
358
+ <button class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition" id="saveJsonBtn">שמור שינויים (באחסון המקומי)</button>
359
+ </div>
360
+ </div>
361
+ </div>
362
+ <div class="fixed inset-0 bg-black bg-opacity-40 flex items-center justify-center z-[9999] px-4 hidden" id="suggestToolModal">
363
+ <div class="bg-white rounded-lg w-full max-w-md shadow-lg max-h-[90vh] overflow-hidden flex flex-col text-right relative">
364
+ <!-- תוכן -->
365
+ <div class="p-6 overflow-y-auto flex-grow">
366
+ <h2 class="text-xl font-semibold mb-4">הצעת כלי חדש</h2>
367
+ <form class="space-y-4" id="suggestToolForm">
368
+ <div>
369
+ <label class="block mb-1">שם הכלי</label>
370
+ <input class="w-full border rounded p-2" name="name" required="" type="text"/>
371
+ </div>
372
+ <div>
373
+ <label class="block mb-1">לינק</label>
374
+ <input class="w-full border rounded p-2" dir="ltr" name="url" placeholder="כתובת URL של הכלי: לדוגמא: https://linktr.ee/sagib" required="" type="url"/>
375
+ </div>
376
+ <div>
377
+ <label class="block mb-1">תיאור קצר</label>
378
+ <textarea class="w-full border rounded p-2" name="description" required=""></textarea>
379
+ </div>
380
+ <div>
381
+ <label class="block mb-1">השם שלך</label>
382
+ <input class="w-full border rounded p-2" name="userName" placeholder="איך לקרוא לך כשנחזור אליך?" type="text"/>
383
+ </div>
384
+ <div>
385
+ <label class="block mb-1">מס' טלפון נייד</label>
386
+ <input class="w-full border rounded p-2" dir="ltr" name="userPhone" placeholder="05X-XXXXXXX" type="tel"/>
387
+ </div>
388
+ <p class="text-sm text-gray-500">נשמח לחזור אליך כשהכלי שצעת נוסף לאתר ❤️</p>
389
+ <p class="text-sm text-gray-500 italic">✦ הפרטים שלך נשמרים אצלנו רק לצורך עדכון – אין שימוש אחר.</p>
390
+ </form>
391
+ </div>
392
+ <!-- כפתורים קבועים בתחתית -->
393
+ <div class="sticky bottom-0 bg-white/80 backdrop-blur-md px-6 py-4 border-t flex justify-center space-x-4 space-x-reverse z-10 rounded-b-lg">
394
+ <button class="px-5 py-2 bg-gray-200 text-gray-800 rounded hover:bg-gray-300" onclick="closeSuggestModal()" type="button">ביטול</button>
395
+ <button class="px-6 py-2 bg-purple-600 text-white rounded hover:bg-purple-700" form="suggestToolForm" type="submit">שלח</button>
396
+ </div>
397
+ </div>
398
+ </div>
399
+ <div class="fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center hidden z-[9999]" id="videoModal">
400
+ <div class="bg-white rounded-lg overflow-hidden w-full max-w-3xl shadow-lg relative">
401
+ <button class="absolute top-2 left-2 text-gray-700 hover:text-red-600 text-xl" onclick="closeVideoModal()">
402
+ <i class="fas fa-times"></i>
403
+ </button>
404
+ <iframe allowfullscreen="" class="w-full h-[300px] sm:h-[500px]" frameborder="0" id="videoIframe" src=""></iframe>
405
+ </div>
406
+ </div>
407
+ <!-- /* --- Footer --- */ -->
408
+ <footer class="fixed bottom-0 left-0 w-full z-50 backdrop-blur-md bg-white/80 shadow-xl border-t border-gray-200">
409
+ <!-- הוספת כפתור צ'אט צף לקובץ index.html -->
410
+ <!-- Improved Chat Component -->
411
+ <div class="fixed bottom-8 right-5 z-[9999]" id="chatBubble">
412
+ <!-- Introductory message -->
413
+ <div class="bg-white p-3 rounded-lg shadow-md mb-2 text-sm max-w-xs chat-intro-enter hidden" id="chatIntro">
414
+ שלום! אני עוזר AI של שגיא. אשמח ל��זור לך למצוא כלי AI מתאים או לענות על שאלות.
415
+ <button class="text-gray-500 float-left" onclick="hideChatIntro()">
416
+ <i class="fas fa-times"></i>
417
+ </button>
418
+ </div>
419
+ <!-- Chat Button -->
420
+ <button class="chat-pulse bg-gradient-to-r from-purple-500 to-indigo-600 hover:from-purple-600 hover:to-indigo-700 text-white px-4 py-3 rounded-full shadow-xl flex items-center space-x-2 space-x-reverse" id="chatButton" onclick="toggleChatWindow()">
421
+ <i class="fas fa-robot"></i>
422
+ <span>צ'אט</span>
423
+ </button>
424
+ <!-- Chat Window -->
425
+ <div class="hidden mt-3 w-[360px] h-[500px] bg-white rounded-2xl shadow-2xl border border-gray-200 overflow-hidden relative" id="chatWindow">
426
+ <!-- Chat Header -->
427
+ <div class="bg-gradient-to-r from-purple-500 to-indigo-600 text-white p-3 flex justify-between items-center">
428
+ <button class="text-white" onclick="toggleChatWindow()">
429
+ <i class="fas fa-times"></i>
430
+ </button>
431
+ <div class="chat-header">
432
+ צ'אט עם הבינה של שגיא
433
+ <span class="ml-2 text-sm bg-white text-purple-600 font-semibold px-2 py-1 rounded-full shadow-sm" id="toolsCount"></span>
434
+ </div>
435
+ <!-- <div class="font-medium">עוזר AI של שגיא</div> -->
436
+ <div class="w-6"></div> <!-- Spacer for balance -->
437
+ </div>
438
+ <!-- Chat iframe -->
439
+ <iframe class="w-full h-full border-none" src="https://sagi-ba-sagi-ai-tools-chatbot-main-g1prqf.streamlit.app/?embed=true"></iframe>
440
+ </div>
441
+ </div>
442
+ <script>
443
+ function toggleChatWindow() {
444
+ const chatWindow = document.getElementById("chatWindow");
445
+ chatWindow.classList.toggle("hidden");
446
+ }
447
+ </script>
448
+ <!-- <span>© 2025 כל הזכויות שמורות לשגיא בר און.</span> -->
449
+ <div class="container mx-auto px-4 py-3 text-center space-y-2">
450
+ <div class="flex justify-center gap-4">
451
+ <!-- אייקונים -->
452
+ <a class="w-9 h-9 rounded-full bg-white shadow flex items-center justify-center text-green-500 hover:bg-green-500 hover:text-white transition" href="https://chat.whatsapp.com/GPFASYBEA9CFGUMCVZ5RXP" target="_blank"><i class="fab fa-whatsapp"></i></a>
453
+ <a class="w-9 h-9 rounded-full bg-white shadow flex items-center justify-center text-blue-500 hover:bg-blue-700 hover:text-white transition" href="http://www.linkedin.com/in/sagi-bar-on" target="_blank"><i class="fab fa-linkedin-in"></i></a>
454
+ <a class="w-9 h-9 rounded-full bg-white shadow flex items-center justify-center text-blue-600 hover:bg-blue-800 hover:text-white transition" href="https://www.facebook.com/SAGI.BARON" target="_blank"><i class="fab fa-facebook-f"></i></a>
455
+ <a class="w-9 h-9 rounded-full bg-white shadow flex items-center justify-center text-red-500 hover:bg-red-700 hover:text-white transition" href="https://www.youtube.com/@SAGIBARON" target="_blank"><i class="fab fa-youtube"></i></a>
456
+ </div>
457
+ <button class="px-4 py-2 rounded-xl bg-gradient-to-br from-pink-500 to-purple-600 text-white font-bold shadow hover:scale-105 transition" id="editJsonBtnFooter">
458
+ <i class="fas fa-pen-to-square ml-2"></i> הציעו כלי חדש
459
+ </button>
460
+ <p class="text-gray-500 text-xs">© 2025 כל הזכויות שמורות לשגיא בר און</p>
461
+ </div>
462
+
463
+ </footer>
464
+ <!-- /* --- Load Tailwind CSS via CDN --- */ -->
465
+ <script src="https://cdn.tailwindcss.com"></script>
466
+ <!-- /* ----------------------------------- */
467
+ /* ------- START OF JAVASCRIPT ------- */
468
+ /* ----------------------------------- */ -->
469
+ <script>
470
+ // --- DOM Elements ---
471
+ const toolsContainer = document.getElementById('toolsContainer');
472
+ const videosContainer = document.getElementById('videosContainer');
473
+ const searchInput = document.getElementById('searchInput');
474
+ const filterButtons = document.querySelectorAll('.filter-btn');
475
+ const totalToolsElement = document.getElementById('totalTools');
476
+ const topRatedElement = document.getElementById('topRated');
477
+ const newToolsElement = document.getElementById('newTools');
478
+ const totalCategoriesElement = document.getElementById('totalCategories');
479
+ const mobileMenuButton = document.getElementById('mobileMenuButton');
480
+ const mobileMenu = document.getElementById('mobileMenu');
481
+ const jsonEditorModal = document.getElementById('jsonEditorModal');
482
+ const jsonEditor = document.getElementById('jsonEditor');
483
+ const closeModalBtn = document.getElementById('closeModalBtn');
484
+ const cancelEditBtn = document.getElementById('cancelEditBtn');
485
+ const saveJsonBtn = document.getElementById('saveJsonBtn');
486
+ const showToolsBtn = document.getElementById('showToolsBtn');
487
+ const showVideosBtn = document.getElementById('showVideosBtn');
488
+ const refreshBtn = document.getElementById('refreshBtn');
489
+ const refreshBtnMobile = document.getElementById('refreshBtnMobile');
490
+ const loadingMessage = document.getElementById('loadingMessage'); // For showing loading status
491
+
492
+ const topRatedStatBox = document.getElementById('topRatedStatBox');
493
+ const newToolsStatBox = document.getElementById('newToolsStatBox');
494
+ const totalToolsStatBox = document.querySelector('[id="totalTools"]').closest('.bg-white');
495
+ let filteredStatView = null; // 'topRated', 'newTools', או null
496
+
497
+ if (totalToolsStatBox) {
498
+ totalToolsStatBox.classList.add('clickable-stat');
499
+ totalToolsStatBox.addEventListener('click', () => {
500
+ filteredStatView = null;
501
+ currentSearchTerm = '';
502
+ currentCategory = 'all';
503
+ document.querySelectorAll('.filter-btn').forEach(btn => btn.classList.remove('active'));
504
+ const allBtn = document.querySelector('.filter-btn[data-category="all"]');
505
+ if (allBtn) allBtn.classList.add('active');
506
+ renderTools();
507
+ scrollToTools();
508
+ });
509
+ }
510
+
511
+ if (topRatedStatBox) {
512
+ topRatedStatBox.addEventListener('click', () => {
513
+ filteredStatView = 'topRated';
514
+ currentSearchTerm = '';
515
+ currentCategory = 'all';
516
+ renderTools();
517
+ scrollToTools();
518
+ });
519
+ }
520
+
521
+ if (newToolsStatBox) {
522
+ newToolsStatBox.addEventListener('click', () => {
523
+ filteredStatView = 'newTools';
524
+ currentSearchTerm = '';
525
+ currentCategory = 'all';
526
+ renderTools();
527
+ scrollToTools();
528
+ });
529
+ }
530
+
531
+ // --- State ---
532
+ let currentCategory = 'all';
533
+ let currentSearchTerm = '';
534
+ let toolsData = { tools: [], videos: [] }; // Holds the data fetched from server
535
+ let currentSort = 'newest'; // 'newest', 'rating'
536
+
537
+ // --- Initialize ---
538
+ async function init() {
539
+ showLoading();
540
+ try {
541
+ const savedSearch = localStorage.getItem('searchTerm');
542
+ if (savedSearch) {
543
+ searchInput.value = savedSearch;
544
+ currentSearchTerm = savedSearch;
545
+ }
546
+
547
+ await loadData(); // ← הנתונים נטענים כאן
548
+ sortTools(currentSort);
549
+ renderTools();
550
+ renderVideos();
551
+ updateStats();
552
+ setupEventListeners();
553
+
554
+ // 👇 כאן נוסיף את הקריאה לבאנר לאחר שהכלים נטענו
555
+ showNewToolBanner();
556
+
557
+ if (!currentSearchTerm) {
558
+ const allFilterBtn = document.querySelector('.filter-btn[data-category="all"]');
559
+ if (allFilterBtn) {
560
+ allFilterBtn.classList.add('active');
561
+ }
562
+ }
563
+ } catch (error) {
564
+ console.error("Initialization failed:", error);
565
+ showError("שגיאה בטעינת הנתונים הראשונית. נסה לרענן את הדף.");
566
+ } finally {
567
+ hideLoading();
568
+ }
569
+ }
570
+
571
+
572
+
573
+ const speechSynthesis = window.speechSynthesis;
574
+ let currentUtterance = null;
575
+
576
+ // פונקציה להקראת טקסט בעברית
577
+ function speakText(text) {
578
+ // עצירת הקראה קודמת אם יש
579
+ if (speechSynthesis.speaking) {
580
+ speechSynthesis.cancel();
581
+
582
+ // אם זאת אותה הקראה שכבר פועלת, פשוט נעצור ונצא
583
+ if (currentUtterance && currentUtterance.text === text) {
584
+ currentUtterance = null;
585
+ return;
586
+ }
587
+ }
588
+
589
+ // יצירת הקראה חדשה
590
+ const utterance = new SpeechSynthesisUtterance(text);
591
+
592
+ // הגדרת השפה לעברית
593
+ utterance.lang = 'he-IL';
594
+
595
+ // בדיקת קולות זמינים ובחירת קול עברי
596
+ const voices = speechSynthesis.getVoices();
597
+
598
+
599
+ if (voices.length) {
600
+ const hebrewVoice = voices.find(voice => /he|hebrew|ivrit/i.test(voice.lang));
601
+
602
+ if (hebrewVoice) {
603
+ utterance.voice = hebrewVoice;
604
+ console.log("נבחר קול עברי:", hebrewVoice.name);
605
+ } else {
606
+ console.log("לא נמצא קול עברי, משתמש בקול ברירת מחדל");
607
+ }
608
+ // ננסה להשתמש בקול גוגל
609
+ const googleVoice = voices.find(voice =>
610
+ voice.name.includes('Google') &&
611
+ (voice.name.includes('US') || voice.name.includes('UK'))
612
+ );
613
+
614
+
615
+ if (googleVoice) {
616
+ utterance.voice = googleVoice;
617
+ }
618
+ } else {
619
+ // במקרה שהקולות עדיין לא נטענו, נגדיר מאזין חד-פעמי
620
+ speechSynthesis.addEventListener('voiceschanged', function loadVoice() {
621
+ const voices = speechSynthesis.getVoices();
622
+ const hebrewVoice = voices.find(voice => /he|hebrew|ivrit/i.test(voice.lang));
623
+ if (hebrewVoice) {
624
+ utterance.voice = hebrewVoice;
625
+ console.log("נבחר קול עברי (מדחייה):", hebrewVoice.name);
626
+ }
627
+ // הסרת המאזין אחרי הפעלה ראשונה
628
+ speechSynthesis.removeEventListener('voiceschanged', loadVoice);
629
+ }, { once: true });
630
+ }
631
+
632
+ // שמירת ההקראה הנוכחית
633
+ currentUtterance = utterance;
634
+
635
+ // טיפול באירוע סיום הקראה
636
+ utterance.onend = () => {
637
+ currentUtterance = null;
638
+
639
+ // עדכון כל הכפתורים למצב "לא מנגן"
640
+ document.querySelectorAll('.speak-button').forEach(btn => {
641
+ btn.innerHTML = '<i class="fas fa-volume-up"></i>';
642
+ btn.classList.remove('speaking');
643
+ });
644
+ };
645
+
646
+ // הפעלת ההקראה
647
+ speechSynthesis.speak(utterance);
648
+ }
649
+
650
+ // --- UI Feedback ---
651
+ function showLoading() {
652
+ if (loadingMessage) loadingMessage.style.display = 'block';
653
+ if (toolsContainer) toolsContainer.innerHTML = ''; // Clear container while loading
654
+ }
655
+
656
+ function hideLoading() {
657
+ if (loadingMessage) loadingMessage.style.display = 'none';
658
+ }
659
+
660
+ function showError(message) {
661
+ if (toolsContainer) {
662
+ toolsContainer.innerHTML = `<p class="text-center text-red-600 col-span-full">${message}</p>`;
663
+ }
664
+ hideLoading(); // Make sure loading message is hidden
665
+ }
666
+
667
+ // --- Data Fetching ---
668
+ async function fetchDefaultData() {
669
+ console.log("Fetching latest data from server..."); // Log fetching attempt
670
+ try {
671
+ const [toolsResponse, videosResponse] = await Promise.all([
672
+ fetch('tools.json?cacheBust=' + Date.now()), // Cache busting
673
+ fetch('videos.json?cacheBust=' + Date.now()) // Cache busting
674
+ ]);
675
+
676
+ if (!toolsResponse.ok || !videosResponse.ok) {
677
+ const errorMsg = `HTTP error! Status: Tools ${toolsResponse.status}, Videos ${videosResponse.status}`;
678
+ console.error(errorMsg);
679
+ throw new Error("שגיאה בקבלת נתונים מהשרת."); // User-friendly error
680
+ }
681
+
682
+ const [toolsArray, videosArray] = await Promise.all([
683
+ toolsResponse.json(),
684
+ videosResponse.json()
685
+ ]);
686
+
687
+ // --- Process fetched data with defaults ---
688
+ const processedTools = toolsArray.map(tool => ({
689
+ ...tool, rating: tool.rating ?? 0, isNew: tool.isNew ?? false,
690
+ category: tool.category ?? 'general', icon: tool.icon || 'fas fa-tools',
691
+ url: tool.url || '#', description: tool.description || 'אין תיאור זמין.',
692
+ name: tool.name || 'שם לא ידוע'
693
+ }));
694
+ const processedVideos = videosArray.map(video => ({
695
+ ...video, url: video.url || '#', title: video.title || 'כותרת חסרה',
696
+ description: video.description || 'אין תיאור זמין.',
697
+ date: video.date ?? new Date().toISOString()
698
+ }));
699
+
700
+ console.log("Data fetched successfully.");
701
+ return { tools: processedTools, videos: processedVideos };
702
+
703
+ } catch (error) {
704
+ console.error("Failed to fetch default data:", error);
705
+ // Re-throw the error or a more specific one to be caught by the caller
706
+ throw new Error("כשל בטעינת נתוני ברירת המחדל מהשרת. בדוק את הקבצים tools.json ו-videos.json.");
707
+ }
708
+ }
709
+
710
+ // --- Data Loading Strategy ---
711
+ // MODIFIED: Always fetch fresh data from the server on load.
712
+ async function loadData() {
713
+ console.log("loadData called - fetching fresh data.");
714
+ try {
715
+ toolsData = await fetchDefaultData();
716
+ // Note: We are NOT saving to localStorage here anymore for loading purposes.
717
+ // saveData(); // Removed - No longer saving fetched data automatically
718
+ } catch (error) {
719
+ console.error("Error in loadData:", error);
720
+ toolsData = { tools: [], videos: [] }; // Set empty data on error
721
+ // Re-throw error so init() can handle UI feedback
722
+ throw error;
723
+ }
724
+ }
725
+
726
+ // --- Save Data to Local Storage (Used ONLY by JSON Editor) ---
727
+ // Note: Data saved here will be overwritten on next page load/refresh.
728
+ function saveData() {
729
+ try {
730
+ // Save the current state (potentially modified by editor) to localStorage
731
+ localStorage.setItem('aiToolsData', JSON.stringify(toolsData));
732
+ console.log("Data saved to localStorage (by editor). Will be overwritten on next load.");
733
+ } catch (e) {
734
+ console.error("Error saving data to localStorage:", e);
735
+ alert("שגיאה בשמירת הנתונים באחסון המקומי.");
736
+ }
737
+ }
738
+
739
+ // --- Sorting Function (Unchanged) ---
740
+ function sortTools(sortBy) {
741
+ if (!toolsData || !Array.isArray(toolsData.tools)) return;
742
+ console.log("Sorting by:", sortBy);
743
+ currentSort = sortBy;
744
+ toolsData.tools.sort((a, b) => {
745
+ if (sortBy === 'newest') {
746
+ const aIsNew = a.isNew || false; const bIsNew = b.isNew || false;
747
+ if (aIsNew !== bIsNew) return bIsNew - aIsNew;
748
+ return 0;
749
+ } else if (sortBy === 'rating') {
750
+ const aRating = a.rating || 0; const bRating = b.rating || 0;
751
+ if (bRating !== aRating) return bRating - aRating;
752
+ return 0;
753
+ }
754
+ return 0;
755
+ });
756
+ }
757
+ function scrollToTools() {
758
+ const toolsSection = document.getElementById("toolsContainer");
759
+ if (toolsSection) {
760
+ toolsSection.scrollIntoView({ behavior: 'smooth', block: 'start' });
761
+ }
762
+ }
763
+
764
+ // --- Rendering Functions (Unchanged logic, but added hideLoading) ---
765
+ function renderTools() {
766
+ hideLoading(); // Ensure loading message is hidden before rendering
767
+ if (!toolsContainer || !toolsData || !Array.isArray(toolsData.tools)) {
768
+ console.error("Cannot render tools: Missing container or invalid data.");
769
+ showError("שגיאה בהצגת הכלים.");
770
+ return;
771
+ }
772
+ const filteredTools = filterTools();
773
+ toolsContainer.innerHTML = ''; // Clear previous content
774
+
775
+ if (filteredTools.length === 0 && currentSearchTerm === '' && currentCategory === 'all') {
776
+ // Show specific message if no tools loaded at all
777
+ showError("לא נטענו כלים. בדוק את קובץ tools.json או נסה לרענן.");
778
+ } else if (filteredTools.length === 0) {
779
+ toolsContainer.innerHTML = '<p class="text-center text-gray-500 col-span-full">לא נמצאו כלים התואמים את החיפוש, הסינון והמיון.</p>';
780
+ } else {
781
+ filteredTools.forEach(tool => {
782
+ const toolCard = document.createElement('div');
783
+ toolCard.className = `relative tool-card bg-white rounded-lg shadow-sm border border-gray-100 p-6 transition duration-300 ${tool.isFeatured ? 'ring-2 ring-blue-500' : ''}`;
784
+
785
+ // הכנת הטקסט להקראה - שילוב של שם הכלי והתיאור שלו
786
+ const speakableText = `${tool.name}. ${tool.description}`;
787
+ // `${tool.name}`;
788
+ //
789
+
790
+ toolCard.innerHTML = `
791
+ <div class="flex items-center justify-between mb-4">
792
+ <div class="flex items-center gap-4">
793
+ <!-- לוגו הכלי -->
794
+ <img src="${tool.logo}" alt="${tool.name} Logo" class="w-14 h-14 object-contain rounded bg-white p-1 shadow-sm">
795
+
796
+ <div>
797
+ <!-- שם הכלי, תגית 'חדש!' וכפתור רמקול -->
798
+ <div class="flex items-center gap-2">
799
+ <h3 class="text-xl font-semibold">${tool.name}</h3>
800
+ ${tool.isNew ? `<span class="text-xs bg-green-500 text-white px-2 py-1 rounded-full animate-pulse">חדש!</span>` : ''}
801
+ <button title="הקרא תיאור" onclick="event.stopPropagation(); speakText('${tool.description.replace(/'/g, "\\'")}')" class="text-blue-600 hover:text-blue-800 focus:outline-none">
802
+ <i class="fas fa-volume-up"></i>
803
+ </button>
804
+ </div>
805
+ <!-- תגית קטגוריה -->
806
+ <span class="text-xs px-2 py-1 rounded-full ${getCategoryBadgeColor(tool.category)}">
807
+ ${getCategoryName(tool.category)}
808
+ </span>
809
+ </div>
810
+ </div>
811
+
812
+ <!-- אייקון הכלי -->
813
+ <i class="${tool.icon} text-gray-500 text-2xl"></i>
814
+ </div>
815
+
816
+ <!-- תיאור -->
817
+ <p class="text-gray-700 mb-4 text-base leading-relaxed min-h-[60px]">${tool.description}</p>
818
+
819
+ <!-- דירוג + יוטיוב -->
820
+ <div class="flex justify-between items-center mb-4">
821
+ <div class="flex items-center gap-3">
822
+ ${renderRatingStars(tool.rating)}
823
+ ${tool.video ? `
824
+ <button title="צפה בהדרכה" onclick="openVideoModal('${tool.video}')" class="text-red-500 hover:text-red-600 transition text-xl">
825
+ <i class="fab fa-youtube"></i>
826
+ </button>` : ''
827
+ }
828
+ </div>
829
+ </div>
830
+
831
+ <!-- כפתור גישה לכלי -->
832
+ <a href="${tool.url}" target="_blank" rel="noopener noreferrer"
833
+ class="inline-block w-full text-center px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition ${tool.url === '#' ? 'opacity-50 cursor-not-allowed' : ''}">
834
+ <i class="fas fa-external-link-alt ml-2"></i> ${tool.url !== '#' ? 'גישה לכלי' : 'אין קישור'}
835
+ </a>
836
+ `;
837
+
838
+ toolsContainer.appendChild(toolCard);
839
+ });
840
+ // אנימציה של הופעה חלקה
841
+ requestAnimationFrame(() => {
842
+ toolCard.classList.add('visible');
843
+ });
844
+
845
+ // הוספת סגנון CSS לכפתור הקראה פעיל
846
+ if (!document.getElementById('speakButtonStyle')) {
847
+ const style = document.createElement('style');
848
+ style.id = 'speakButtonStyle';
849
+ style.innerHTML = `
850
+ .speak-button.speaking { color: #4f46e5; animation: pulse 1.5s infinite; }
851
+ @keyframes pulse {
852
+ 0% { transform: scale(1); }
853
+ 50% { transform: scale(1.2); }
854
+ 100% { transform: scale(1); }
855
+ }
856
+ `;
857
+ document.head.appendChild(style);
858
+ }
859
+ }
860
+ }
861
+
862
+ // פונקציה נוספת שמוחקת את ההקראה בעת עזיבת העמוד
863
+ function cleanupSpeech() {
864
+ if (speechSynthesis) {
865
+ speechSynthesis.cancel();
866
+ }
867
+ }
868
+
869
+ // הוספת אירוע לניקוי ההקראה בעת עזיבת העמוד
870
+ window.addEventListener('beforeunload', cleanupSpeech);
871
+
872
+ // עדכון אירוע הקלקה על כפתור הקראה - להוסיף מחלקת CSS ולשנות אייקון
873
+ document.addEventListener('click', function(e) {
874
+ if (e.target.closest('.speak-button')) {
875
+ const button = e.target.closest('.speak-button');
876
+
877
+ // החלפת האייקון והוספת מחלקת CSS מהבהבת
878
+ if (speechSynthesis.speaking && currentUtterance) {
879
+ // אם יש הקראה פעילה, נעדכן את כל הכפתורים
880
+ document.querySelectorAll('.speak-button').forEach(btn => {
881
+ btn.innerHTML = '<i class="fas fa-volume-up"></i>';
882
+ btn.classList.remove('speaking');
883
+ });
884
+
885
+ // ואז נעדכן את הכפתור הנוכחי אם ההקראה ממשיכה
886
+ if (!button.classList.contains('speaking')) {
887
+ button.innerHTML = '<i class="fas fa-volume-mute"></i>';
888
+ button.classList.add('speaking');
889
+ }
890
+ } else {
891
+ button.innerHTML = '<i class="fas fa-volume-up"></i>';
892
+ button.classList.remove('speaking');
893
+ }
894
+ }
895
+ });
896
+
897
+
898
+ function renderVideos() {
899
+ // ... (renderVideos logic remains the same as before) ...
900
+ if (!videosContainer || !toolsData || !Array.isArray(toolsData.videos)) {
901
+ console.error("Cannot render videos: Missing container or invalid data.");
902
+ if (videosContainer) videosContainer.innerHTML = '<p class="text-center text-red-500 col-span-full">שגיאה בהצגת הסרטונים.</p>';
903
+ return;
904
+ }
905
+ videosContainer.innerHTML = '';
906
+ if (toolsData.videos.length === 0) {
907
+ videosContainer.innerHTML = '<p class="text-center text-gray-500 col-span-full">אין סרטונים להצגה.</p>';
908
+ } else {
909
+ toolsData.videos.forEach(video => {
910
+ const videoId = getYouTubeID(video.url);
911
+ const embedUrl = videoId ? `https://www.youtube.com/embed/${videoId}` : '#';
912
+ const videoCard = document.createElement('div');
913
+ videoCard.className = 'bg-white rounded-lg shadow-sm border border-gray-100 overflow-hidden';
914
+ videoCard.innerHTML = `
915
+ <div class="relative pt-[56.25%] ${!videoId ? 'bg-gray-200 flex items-center justify-center' : ''}">
916
+ ${videoId ? `<iframe class="absolute top-0 left-0 w-full h-full" src="${embedUrl}" frameborder="0" title="${video.title}" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>` : `<p class="text-gray-500 text-sm p-4">${video.url === '#' ? 'אין קישור וידאו' : 'קישור וידאו לא תקין'}</p>`}
917
+ </div>
918
+ <div class="p-4">
919
+ <h3 class="text-lg font-semibold mb-2">${video.title}</h3>
920
+ <p class="text-gray-600 text-sm mb-3 min-h-[40px]">${video.description}</p>
921
+ <p class="text-gray-500 text-xs">${formatDate(video.date)}</p>
922
+ </div>`;
923
+ videosContainer.appendChild(videoCard);
924
+ });
925
+ }
926
+ }
927
+
928
+ // --- Helper Functions (Filtering, Stats, Stars, Category, Date - Unchanged) ---
929
+ function filterTools() {
930
+ if (!toolsData || !Array.isArray(toolsData.tools)) return [];
931
+
932
+ let filtered = toolsData.tools;
933
+
934
+ if (filteredStatView === 'topRated') {
935
+ filtered = filtered.filter(tool => tool.rating === 5);
936
+ } else if (filteredStatView === 'newTools') {
937
+ filtered = filtered.filter(tool => tool.isNew);
938
+ }
939
+
940
+ return filtered.filter(tool => {
941
+ const searchTermLower = currentSearchTerm.toLowerCase();
942
+ const nameMatch = tool.name.toLowerCase().includes(searchTermLower);
943
+ const descMatch = tool.description.toLowerCase().includes(searchTermLower);
944
+ const categoryNameMatch = getCategoryName(tool.category).toLowerCase().includes(searchTermLower);
945
+ const matchesSearch = nameMatch || descMatch || categoryNameMatch;
946
+ const matchesCategoryFilter = currentCategory === 'all' || tool.category === currentCategory;
947
+ return matchesCategoryFilter && matchesSearch;
948
+ });
949
+ }
950
+
951
+ function updateStats() { /* ... (unchanged) ... */
952
+ const toolsCount = (toolsData && Array.isArray(toolsData.tools)) ? toolsData.tools.length : 0;
953
+ totalToolsElement.textContent = toolsCount;
954
+ const topRatedCount = toolsCount > 0 ? toolsData.tools.filter(tool => tool.rating >= 5).length : 0;
955
+ topRatedElement.textContent = topRatedCount;
956
+ const newToolsCount = toolsCount > 0 ? toolsData.tools.filter(tool => tool.isNew).length : 0;
957
+ newToolsElement.textContent = newToolsCount;
958
+ const categories = toolsCount > 0 ? new Set(toolsData.tools.map(tool => tool.category)) : new Set();
959
+ totalCategoriesElement.textContent = categories.size;
960
+ }
961
+
962
+ function renderRatingStars(rating) { /* ... (unchanged) ... */
963
+ let stars = '';
964
+ const filledStars = Math.max(0, Math.min(5, Math.round(rating)));
965
+ for (let i = 1; i <= 5; i++) {
966
+ stars += `<i class="${i <= filledStars ? 'fas fa-star text-yellow-400' : 'far fa-star text-gray-300'} ml-1"></i>`;
967
+ }
968
+ return stars;
969
+ }
970
+ function getCategoryName(category) { /* ... (unchanged) ... */
971
+ const categories = { 'ai-agents': 'סוכן AI','productivity': 'פרודוקטיביות', 'writing': 'כתיבה', 'design': 'עיצוב', 'coding': 'תכנות', 'video': 'וידאו', 'image': 'תמונה', 'education': 'חינוך', 'data': 'נתונים', 'search': 'חיפוש', 'builder': 'בנייה', 'customer-support': 'תמיכה', 'automation': 'אוטומציה', 'hosting': 'אחסון', 'agents': 'סוכנים', 'directory': 'אינדקס', 'utility': 'כלי עזר', 'platform': 'פלטפורמה', 'media': 'מדיה', 'presentation': 'מצגות', 'audio': 'שמע', 'infrastructure': 'תשתיות', 'nlp': 'עיבוד שפה', 'accessibility': 'נגישות', 'general': 'כללי' };
972
+ return categories[category] || category || 'כללי';
973
+ }
974
+ function getCategoryColor(category) { /* ... (unchanged) ... */
975
+ const colors = { 'productivity': 'bg-blue-600', 'writing': 'bg-purple-600', 'design': 'bg-pink-600', 'coding': 'bg-green-600', 'video': 'bg-red-600', 'image': 'bg-yellow-600', 'education': 'bg-indigo-600', 'data': 'bg-cyan-600', 'search': 'bg-teal-600', 'builder': 'bg-orange-600', 'customer-support': 'bg-lime-600', 'automation': 'bg-sky-600', 'hosting': 'bg-amber-600', 'agents': 'bg-violet-600', 'directory': 'bg-fuchsia-600', 'utility': 'bg-rose-600', 'platform': 'bg-emerald-600', 'media': 'bg-stone-600', 'presentation': 'bg-red-500', 'audio': 'bg-blue-500', 'infrastructure': 'bg-gray-700', 'nlp': 'bg-purple-500', 'accessibility': 'bg-green-500', 'general': 'bg-gray-600' };
976
+ return colors[category] || 'bg-gray-600';
977
+ }
978
+ function getCategoryBadgeColor(category) { /* ... (unchanged) ... */
979
+ const colors = { 'productivity': 'bg-blue-100 text-blue-800', 'writing': 'bg-purple-100 text-purple-800', 'design': 'bg-pink-100 text-pink-800', 'coding': 'bg-green-100 text-green-800', 'video': 'bg-red-100 text-red-800', 'image': 'bg-yellow-100 text-yellow-800', 'education': 'bg-indigo-100 text-indigo-800', 'data': 'bg-cyan-100 text-cyan-800', 'search': 'bg-teal-100 text-teal-800', 'builder': 'bg-orange-100 text-orange-800', 'customer-support': 'bg-lime-100 text-lime-800', 'automation': 'bg-sky-100 text-sky-800', 'hosting': 'bg-amber-100 text-amber-800', 'agents': 'bg-violet-100 text-violet-800', 'directory': 'bg-fuchsia-100 text-fuchsia-800', 'utility': 'bg-rose-100 text-rose-800', 'platform': 'bg-emerald-100 text-emerald-800', 'media': 'bg-stone-100 text-stone-800', 'presentation': 'bg-red-100 text-red-800', 'audio': 'bg-blue-100 text-blue-800', 'infrastructure': 'bg-gray-200 text-gray-800', 'nlp': 'bg-purple-100 text-purple-800', 'accessibility': 'bg-green-100 text-green-800', 'general': 'bg-gray-100 text-gray-800' };
980
+ return colors[category] || 'bg-gray-100 text-gray-800';
981
+ }
982
+ function getYouTubeID(url) { /* ... (unchanged) ... */
983
+ if (!url || url === '#') return '';
984
+ const match = url.match(/(?:youtu\.be\/|youtube\.com\/(?:watch\?v=|embed\/|v\/|shorts\/))([^?&\/\s]+)/);
985
+ return match ? match[1] : '';
986
+ }
987
+ function formatDate(dateString) { /* ... (unchanged, includes fallback parsing) ... */
988
+ if (!dateString) return 'תאריך לא זמין';
989
+ try {
990
+ const date = new Date(dateString);
991
+ if (isNaN(date.getTime())) {
992
+ console.warn("Could not parse date directly:", dateString);
993
+ const parts = dateString.match(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/);
994
+ if (parts) {
995
+ const isoDate = new Date(`${parts[3]}-${parts[2].padStart(2, '0')}-${parts[1].padStart(2, '0')}T00:00:00Z`);
996
+ if (!isNaN(isoDate.getTime())) return isoDate.toLocaleDateString('he-IL', { year: 'numeric', month: 'long', day: 'numeric' });
997
+ } return 'תאריך לא תקין';
998
+ }
999
+ return date.toLocaleDateString('he-IL', { year: 'numeric', month: 'long', day: 'numeric' });
1000
+ } catch (e) { console.error("Error formatting date:", dateString, e); return 'תאריך לא תקין'; }
1001
+ }
1002
+
1003
+ // --- Event Listeners Setup ---
1004
+ function setupEventListeners() {
1005
+ // Search input
1006
+ searchInput.addEventListener('input', (e) => {
1007
+ currentSearchTerm = e.target.value;
1008
+ localStorage.setItem('searchTerm', currentSearchTerm); // שמור בזיכרון הדפדפן
1009
+ renderTools();
1010
+ });
1011
+
1012
+
1013
+ // Filter buttons
1014
+ filterButtons.forEach(button => {
1015
+ button.addEventListener('click', () => {
1016
+ filterButtons.forEach(btn => btn.classList.remove('active'));
1017
+ button.classList.add('active');
1018
+ currentCategory = button.dataset.category;
1019
+ renderTools();
1020
+ });
1021
+ });
1022
+
1023
+ // Mobile menu toggle
1024
+ mobileMenuButton.addEventListener('click', () => {
1025
+ mobileMenu.classList.toggle('open');
1026
+ });
1027
+
1028
+ // Uncomment if using admin buttons
1029
+ const editJsonBtn = document.getElementById('editJsonBtn');
1030
+ const editJsonBtnMobile = document.getElementById('editJsonBtnMobile');
1031
+ document.getElementById('editJsonBtnFooter')?.addEventListener('click', openEditorHandler);
1032
+
1033
+ if (editJsonBtn) editJsonBtn.addEventListener('click', openEditorHandler);
1034
+ if (editJsonBtnMobile) editJsonBtnMobile.addEventListener('click', openEditorHandler);
1035
+
1036
+ closeModalBtn.addEventListener('click', () => jsonEditorModal.classList.add('hidden'));
1037
+ cancelEditBtn.addEventListener('click', () => jsonEditorModal.classList.add('hidden'));
1038
+
1039
+ // JSON Editor Save Button -> Saves ONLY to localStorage for the current session
1040
+ saveJsonBtn.addEventListener('click', () => {
1041
+ try {
1042
+ const rawData = JSON.parse(jsonEditor.value);
1043
+ if (!Array.isArray(rawData)) throw new Error("Data must be an array.");
1044
+ if (showToolsBtn.classList.contains('bg-blue-600')) {
1045
+ // Update in-memory data and sort
1046
+ toolsData.tools = rawData.map(tool => ({ /* add defaults */ ...tool, rating: tool.rating ?? 0, isNew: tool.isNew ?? false, category: tool.category ?? 'general', icon: tool.icon || 'fas fa-tools', url: tool.url || '#', description: tool.description || 'אין תיאור זמין.', name: tool.name || 'שם לא ידוע' }));
1047
+ sortTools(currentSort);
1048
+ } else {
1049
+ toolsData.videos = rawData.map(video => ({ /* add defaults */ ...video, url: video.url || '#', title: video.title || 'כותרת חסרה', description: video.description || 'אין תיאור זמין.', date: video.date ?? new Date().toISOString() }));
1050
+ }
1051
+ // Save the edited data to localStorage (will be lost on next full load)
1052
+ saveData();
1053
+ // Re-render the UI with the edited data for the current session
1054
+ renderTools();
1055
+ renderVideos();
1056
+ updateStats();
1057
+ jsonEditorModal.classList.add('hidden');
1058
+ alert("הנתונים נשמרו זמנית (באחסון המקומי). הם יתעדכנו מחדש מהשרת בטעינה הבאה של הדף.");
1059
+ } catch (e) { alert('JSON לא תקין או שגיאה בשמירה:\n' + e.message); console.error("JSON Save Error:", e); }
1060
+ });
1061
+
1062
+ showToolsBtn.addEventListener('click', () => { /* ... (unchanged editor tab logic) ... */
1063
+ showToolsBtn.classList.add('bg-blue-600', 'text-white'); showToolsBtn.classList.remove('bg-gray-200', 'text-gray-700');
1064
+ showVideosBtn.classList.add('bg-gray-200', 'text-gray-700'); showVideosBtn.classList.remove('bg-blue-600', 'text-white');
1065
+ jsonEditor.value = JSON.stringify(toolsData.tools, null, 2); // Show current in-memory tools data
1066
+ });
1067
+ showVideosBtn.addEventListener('click', () => { /* ... (unchanged editor tab logic) ... */
1068
+ showVideosBtn.classList.add('bg-blue-600', 'text-white'); showVideosBtn.classList.remove('bg-gray-200', 'text-gray-700');
1069
+ showToolsBtn.classList.add('bg-gray-200', 'text-gray-700'); showToolsBtn.classList.remove('bg-blue-600', 'text-white');
1070
+ jsonEditor.value = JSON.stringify(toolsData.videos, null, 2); // Show current in-memory videos data
1071
+ });
1072
+
1073
+ // Sorting stat boxes (Unchanged)
1074
+ if (topRatedStatBox) {
1075
+ topRatedStatBox.addEventListener('click', () => {
1076
+ sortTools('rating');
1077
+ renderTools();
1078
+ scrollToTools(); // גלילה חלקה לתחילת רשימת הכלים
1079
+ });
1080
+ }
1081
+
1082
+ if (newToolsStatBox) {
1083
+ newToolsStatBox.addEventListener('click', () => {
1084
+ sortTools('newest');
1085
+ renderTools();
1086
+ scrollToTools(); // גלילה חלקה לתחילת רשימת הכלים
1087
+ });
1088
+ }
1089
+
1090
+
1091
+ // Refresh buttons - Now primarily resets filters/sort/search and re-renders current data
1092
+ // It *could* re-fetch, but init() already does that on load.
1093
+ // Let's make it just reset the view state.
1094
+ const resetViewHandler = () => {
1095
+ console.log("Resetting view state (filters, sort, search)...");
1096
+ // Reset filters and search
1097
+ searchInput.value = '';
1098
+ currentSearchTerm = '';
1099
+ filterButtons.forEach(btn => btn.classList.remove('active'));
1100
+ const allFilterBtn = document.querySelector('.filter-btn[data-category="all"]');
1101
+ if (allFilterBtn) allFilterBtn.classList.add('active');
1102
+ currentCategory = 'all';
1103
+
1104
+ // Reset sort to newest and re-render
1105
+ sortTools('newest');
1106
+ renderTools();
1107
+ // No need to re-render videos unless their source changes, which this button doesn't do
1108
+ // No need to update stats as the underlying data hasn't changed
1109
+ alert("התצוגה אופסה (פילטרים, מיון וחיפוש נוקו).");
1110
+ };
1111
+
1112
+ refreshBtn.addEventListener('click', resetViewHandler);
1113
+ refreshBtnMobile.addEventListener('click', resetViewHandler);
1114
+ }
1115
+
1116
+ // --- Initialize the app ---
1117
+ document.addEventListener('DOMContentLoaded', init);
1118
+
1119
+ // JSON Editor Modal Logic (If admin buttons are enabled)
1120
+ const openEditorHandler = () => {
1121
+ document.getElementById('suggestToolModal').classList.remove('hidden');
1122
+ };
1123
+
1124
+ const closeSuggestModal = () => {
1125
+ document.getElementById('suggestToolModal').classList.add('hidden');
1126
+ };
1127
+
1128
+ document.getElementById('suggestToolForm').addEventListener('submit', async (e) => {
1129
+ e.preventDefault();
1130
+ const form = e.target;
1131
+ const rawPhone = form.userPhone.value;
1132
+ const cleanedPhone = rawPhone.replace(/\D/g, ''); // מסיר כל תו שאינו ספרה
1133
+ // alert(cleanedPhone)
1134
+ const data = {
1135
+ name: form.name.value,
1136
+ url: form.url.value,
1137
+ description: form.description.value,
1138
+ userName: form.userName.value,
1139
+ userPhone: cleanedPhone,
1140
+ };
1141
+
1142
+ try {
1143
+ await fetch("https://hook.eu2.make.com/lgo6nh36dk804dq1msfmwxo34nzf4o3y", {
1144
+ method: "POST",
1145
+ headers: {
1146
+ "Content-Type": "application/json"
1147
+ },
1148
+ body: JSON.stringify(data)
1149
+ });
1150
+
1151
+ alert("הכלי נשלח בהצלחה!");
1152
+ closeSuggestModal();
1153
+ form.reset();
1154
+ } catch (err) {
1155
+ alert("שגיאה בשליחה 😢");
1156
+ console.error(err);
1157
+ }
1158
+ });
1159
+ function openVideoModal(url) {
1160
+ const modal = document.getElementById('videoModal');
1161
+ const iframe = document.getElementById('videoIframe');
1162
+ iframe.src = url;
1163
+ modal.classList.remove('hidden');
1164
+ }
1165
+
1166
+ function closeVideoModal() {
1167
+ const modal = document.getElementById('videoModal');
1168
+ const iframe = document.getElementById('videoIframe');
1169
+ iframe.src = "";
1170
+ modal.classList.add('hidden');
1171
+ };
1172
+ fetch('tools.json')
1173
+ .then(res => res.json())
1174
+ .then(tools => {
1175
+ const count = tools.length;
1176
+ document.getElementById('toolsCount').textContent = `${count} כלים זמינים`;
1177
+ })
1178
+ .catch(err => {
1179
+ console.error("שגיאה בטעינת כמות הכלים:", err);
1180
+ document.getElementById('toolsCount').textContent = 'טעינה נכשלה';
1181
+ });
1182
+ function showNewToolBanner() {
1183
+ const tools = toolsData.tools;
1184
+ const lastSeenToolDate = localStorage.getItem('lastSeenToolDate');
1185
+ const newTools = tools.filter(tool => tool.isNew);
1186
+ if (newTools.length === 0) return;
1187
+
1188
+ const latestTool = newTools.reduce((latest, tool) => {
1189
+ return new Date(tool.dateAdded) > new Date(latest.dateAdded) ? tool : latest;
1190
+ }, newTools[0]);
1191
+
1192
+ if (!lastSeenToolDate || new Date(latestTool.dateAdded) > new Date(lastSeenToolDate)) {
1193
+ const banner = document.getElementById('newToolBanner');
1194
+ const toolNameSpan = document.getElementById('newToolName');
1195
+ const closeBtn = document.getElementById('closeBanner');
1196
+
1197
+ toolNameSpan.textContent = latestTool.name;
1198
+ banner.classList.remove('hidden');
1199
+
1200
+ closeBtn.addEventListener('click', () => {
1201
+ banner.classList.add('hidden');
1202
+ localStorage.setItem('lastSeenToolDate', latestTool.dateAdded);
1203
+ });
1204
+ }
1205
+ }
1206
+
1207
+ </script>
1208
+ <!-- /* --------------------------------- */
1209
+ /* ------- END OF JAVASCRIPT ------- */
1210
+ /* --------------------------------- */ -->
1211
+ </body>
1212
+ </html>
manifest.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "ארגז כלי AI של שגיא בר און",
3
+ "short_name": "AI Tools",
4
+ "start_url": "/index.html",
5
+ "display": "standalone",
6
+ "background_color": "#f9fafb",
7
+ "theme_color": "#3b82f6",
8
+ "icons": [
9
+ {
10
+ "src": "icon-192.png",
11
+ "sizes": "192x192",
12
+ "type": "image/png"
13
+ },
14
+ {
15
+ "src": "icon-512.png",
16
+ "sizes": "512x512",
17
+ "type": "image/png"
18
+ }
19
+ ]
20
+ }
service-worker.js ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ self.addEventListener('install', event => {
2
+ event.waitUntil(
3
+ caches.open('ai-tools-cache-v1').then(cache => {
4
+ return cache.addAll([
5
+ '/',
6
+ '/index.html',
7
+ '/manifest.json',
8
+ '/styles.css',
9
+ '/scripts.js'
10
+ ]);
11
+ })
12
+ );
13
+ });
14
+
15
+ self.addEventListener('fetch', event => {
16
+ event.respondWith(
17
+ caches.match(event.request).then(response => {
18
+ return response || fetch(event.request);
19
+ })
20
+ );
21
+ });