joermd commited on
Commit
aebc6bd
·
verified ·
1 Parent(s): ab2a446

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +254 -19
index.html CHANGED
@@ -1,19 +1,254 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html dir="rtl" lang="ar">
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
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
10
+ margin: 0;
11
+ padding: 20px;
12
+ background-color: #f5f5f5;
13
+ }
14
+ .chat-container {
15
+ max-width: 800px;
16
+ margin: 0 auto;
17
+ background: white;
18
+ border-radius: 15px;
19
+ box-shadow: 0 2px 15px rgba(0,0,0,0.1);
20
+ padding: 20px;
21
+ }
22
+ .header {
23
+ text-align: center;
24
+ margin-bottom: 20px;
25
+ padding: 10px;
26
+ background-color: #004d99;
27
+ color: white;
28
+ border-radius: 10px;
29
+ }
30
+ .chat-box {
31
+ height: 400px;
32
+ overflow-y: auto;
33
+ border: 1px solid #ddd;
34
+ padding: 15px;
35
+ margin-bottom: 20px;
36
+ border-radius: 8px;
37
+ background-color: #fafafa;
38
+ }
39
+ .input-container {
40
+ display: flex;
41
+ gap: 10px;
42
+ margin-bottom: 10px;
43
+ }
44
+ input {
45
+ flex: 1;
46
+ padding: 12px;
47
+ border: 2px solid #004d99;
48
+ border-radius: 8px;
49
+ font-size: 16px;
50
+ }
51
+ button {
52
+ padding: 12px 25px;
53
+ background-color: #004d99;
54
+ color: white;
55
+ border: none;
56
+ border-radius: 8px;
57
+ cursor: pointer;
58
+ font-weight: bold;
59
+ }
60
+ button:hover {
61
+ background-color: #003366;
62
+ }
63
+ .message {
64
+ margin-bottom: 12px;
65
+ padding: 12px;
66
+ border-radius: 8px;
67
+ max-width: 80%;
68
+ }
69
+ .user-message {
70
+ background-color: #e3f2fd;
71
+ margin-left: 20%;
72
+ }
73
+ .bot-message {
74
+ background-color: #f0f4f8;
75
+ margin-right: 20%;
76
+ }
77
+ .faq-container {
78
+ display: grid;
79
+ grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
80
+ gap: 10px;
81
+ margin-bottom: 15px;
82
+ }
83
+ .faq-button {
84
+ background-color: #e3f2fd;
85
+ border: 1px solid #004d99;
86
+ padding: 8px;
87
+ border-radius: 5px;
88
+ cursor: pointer;
89
+ transition: background-color 0.3s;
90
+ }
91
+ .faq-button:hover {
92
+ background-color: #bbdefb;
93
+ }
94
+ </style>
95
+ </head>
96
+ <body>
97
+ <div class="chat-container">
98
+ <div class="header">
99
+ <h1>مكتبة النور</h1>
100
+ <p>خدمة العملاء - متوفرين على مدار الساعة</p>
101
+ </div>
102
+ <div class="faq-container">
103
+ <button class="faq-button" onclick="askFAQ('اسعار الورق')">أسعار الورق</button>
104
+ <button class="faq-button" onclick="askFAQ('عن المكتبة')">عن المكتبة</button>
105
+ <button class="faq-button" onclick="askFAQ('قائمة المنتجات')">قائمة المنتجات</button>
106
+ <button class="faq-button" onclick="askFAQ('العروض')">العروض والخصومات</button>
107
+ <button class="faq-button" onclick="askFAQ('طرق الدفع')">طرق الدفع</button>
108
+ </div>
109
+ <div class="chat-box" id="chatBox"></div>
110
+ <div class="input-container">
111
+ <input type="text" id="userInput" placeholder="اكتب سؤالك هنا...">
112
+ <button onclick="sendMessage()">إرسال</button>
113
+ </div>
114
+ </div>
115
+
116
+ <script>
117
+ const storeInfo = {
118
+ name: "مكتبة النور",
119
+ description: "مكتبة النور هي وجهتك الأولى للقرطاسية والأدوات المكتبية. نقدم منتجات عالية الجودة بأسعار تنافسية منذ عام 1990.",
120
+ location: "شارع التحرير - وسط البلد",
121
+ hours: "من 9 صباحاً حتى 10 مساءً",
122
+ phone: "02-XXXXXXXX",
123
+ payment: "نقبل الدفع نقداً، بالبطاقات البنكية، ومحافظ الموبايل"
124
+ };
125
+
126
+ const products = {
127
+ 'ورق طباعة': {
128
+ 'ورق طباعة A4 مستورد درجة أولى': '700 جنيه',
129
+ 'ورق طباعة A4 مستورد درجة ثانية': '650 جنيه',
130
+ 'ورق طباعة A4 محلي': '600 جنيه',
131
+ 'ورق طباعة A3 مستورد': '1200 جنيه',
132
+ 'ورق طباعة ملون A4': '900 جنيه'
133
+ },
134
+ 'ورق وكراسات': {
135
+ 'دفتر سلك 100 ورقة': '35 جنيه',
136
+ 'دفتر تحضير مدرس': '45 جنيه',
137
+ 'ورق كانسون ملون': '12 جنيه',
138
+ 'كراسة رسم A4': '15 جنيه',
139
+ 'دفتر سلك 200 ورقة': '60 جنيه',
140
+ 'مذكرة مقسمة': '40 جنيه',
141
+ 'دفتر محاضرات': '25 جنيه'
142
+ },
143
+ 'أقلام وأدوات كتابة': {
144
+ 'قلم جاف أزرق': '5 جنيه',
145
+ 'قلم رصاص HB': '3 جنيه',
146
+ 'طقم أقلام ملونة 12 لون': '45 جنيه',
147
+ 'قلم سبورة': '8 جنيه',
148
+ 'قلم حبر سائل': '15 جنيه',
149
+ 'قلم تحديد': '12 جنيه',
150
+ 'طقم أقلام رصاص 2B': '30 جنيه'
151
+ },
152
+ 'مستلزمات مكتبية': {
153
+ 'دباسة': '25 جنيه',
154
+ 'مقص': '12 جنيه',
155
+ 'شريط لاصق شفاف': '7 جنيه',
156
+ 'حافظة ملفات': '30 جنيه',
157
+ 'صمغ': '8 جنيه',
158
+ 'مبراة كهربائية': '150 جنيه',
159
+ 'آلة حاسبة علمية': '180 جنيه',
160
+ 'خرامة ورق': '45 جنيه'
161
+ },
162
+ 'أدوات هندسية': {
163
+ 'مسطرة 30 سم': '10 جنيه',
164
+ 'منقلة': '8 جنيه',
165
+ 'فرجار': '25 جنيه',
166
+ 'طقم هندسة كامل': '65 جنيه',
167
+ 'مثلثات هندسية': '20 جنيه'
168
+ }
169
+ };
170
+
171
+ function askFAQ(question) {
172
+ addMessage(question, 'user-message');
173
+ const response = getBotResponse(question);
174
+ addMessage(response, 'bot-message');
175
+ }
176
+
177
+ function sendMessage() {
178
+ const input = document.getElementById('userInput');
179
+ const message = input.value.trim();
180
+
181
+ if (message) {
182
+ addMessage(message, 'user-message');
183
+ const response = getBotResponse(message);
184
+ addMessage(response, 'bot-message');
185
+ input.value = '';
186
+ }
187
+ }
188
+
189
+ function getBotResponse(input) {
190
+ input = input.trim().toLowerCase();
191
+
192
+ if (input.includes('عن المكتبة') || input.includes('تعريف')) {
193
+ return `${storeInfo.description}\n\nموقعنا: ${storeInfo.location}\nساعات العمل: ${storeInfo.hours}\nللتواصل: ${storeInfo.phone}`;
194
+ }
195
+
196
+ if (input.includes('طرق الدفع')) {
197
+ return `طرق الدفع المتاحة: ${storeInfo.payment}`;
198
+ }
199
+
200
+ if (input.includes('العروض')) {
201
+ return "العروض الحالية:\n- خصم 10% على مشتريات الورق فوق 1000 جنيه\n- خصم 15% على الأدوات الهندسية للمدارس\n- اشتري دفترين واحصل على الثالث مجاناً";
202
+ }
203
+
204
+ if (input.includes('سعر') || input.includes('اسعار')) {
205
+ if (input.includes('ورق')) {
206
+ return "أسعار الورق:\n\n" + formatCategoryProducts('ورق طباعة') + "\n" + formatCategoryProducts('ورق وكراسات');
207
+ }
208
+ if (input.includes('قلم') || input.includes('اقلام')) {
209
+ return formatCategoryProducts('أقلام وأدوات كتابة');
210
+ }
211
+ return "جميع أسعار منتجاتنا:\n\n" + formatAllProducts();
212
+ }
213
+
214
+ if (input.includes('منتجات') || input.includes('قائمة')) {
215
+ return formatAllProducts();
216
+ }
217
+
218
+ return "مرحباً! كيف يمكنني مساعدتك؟ يمكنك السؤال عن:\n- معلومات عن المكتبة\n- أسعار المنتجات\n- قائمة القرطاسية المتوفرة\n- العروض والخصومات\n- طرق الدفع";
219
+ }
220
+
221
+ function formatCategoryProducts(category) {
222
+ let response = `${category}:\n`;
223
+ for (let product in products[category]) {
224
+ response += `- ${product}: ${products[category][product]}\n`;
225
+ }
226
+ return response;
227
+ }
228
+
229
+ function formatAllProducts() {
230
+ let response = '';
231
+ for (let category in products) {
232
+ response += `\n${category}:\n`;
233
+ for (let product in products[category]) {
234
+ response += `- ${product}: ${products[category][product]}\n`;
235
+ }
236
+ }
237
+ return response;
238
+ }
239
+
240
+ function addMessage(text, className) {
241
+ const chatBox = document.getElementById('chatBox');
242
+ const messageDiv = document.createElement('div');
243
+ messageDiv.className = `message ${className}`;
244
+ messageDiv.textContent = text;
245
+ chatBox.appendChild(messageDiv);
246
+ chatBox.scrollTop = chatBox.scrollHeight;
247
+ }
248
+
249
+ window.onload = function() {
250
+ addMessage("مرحباً بك في مكتبة النور! كيف يمكنني مساعدتك اليوم؟", 'bot-message');
251
+ }
252
+ </script>
253
+ </body>
254
+ </html>