AhBoh commited on
Commit
d7be0c6
ยท
verified ยท
1 Parent(s): 96283b1

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +321 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Fuso Orari
3
- emoji: ๐Ÿข
4
- colorFrom: gray
5
- colorTo: blue
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: fuso-orari
3
+ emoji: ๐Ÿณ
4
+ colorFrom: pink
5
+ colorTo: gray
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,321 @@
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 lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>World Time Zones</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ .time-card {
11
+ transition: all 0.3s ease;
12
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
13
+ }
14
+ .time-card:hover {
15
+ transform: translateY(-5px);
16
+ box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
17
+ }
18
+ .search-input:focus {
19
+ outline: none;
20
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
21
+ }
22
+ .globe-spin {
23
+ animation: spin 10s linear infinite;
24
+ }
25
+ @keyframes spin {
26
+ from { transform: rotate(0deg); }
27
+ to { transform: rotate(360deg); }
28
+ }
29
+ .dark-mode {
30
+ background-color: #1a202c;
31
+ color: #f7fafc;
32
+ }
33
+ .dark-card {
34
+ background-color: #2d3748;
35
+ color: #f7fafc;
36
+ }
37
+ </style>
38
+ </head>
39
+ <body class="bg-gray-100 min-h-screen">
40
+ <div class="container mx-auto px-4 py-8">
41
+ <!-- Header -->
42
+ <header class="flex justify-between items-center mb-8">
43
+ <div class="flex items-center">
44
+ <i class="fas fa-globe-americas text-blue-500 text-4xl mr-3 globe-spin"></i>
45
+ <h1 class="text-3xl font-bold text-gray-800">World Time Zones</h1>
46
+ </div>
47
+ <button id="theme-toggle" class="p-2 rounded-full bg-gray-200 hover:bg-gray-300 transition">
48
+ <i class="fas fa-moon text-gray-700"></i>
49
+ </button>
50
+ </header>
51
+
52
+ <!-- Search and Controls -->
53
+ <div class="mb-8 flex flex-col md:flex-row gap-4">
54
+ <div class="relative flex-grow">
55
+ <input type="text" id="search" placeholder="Search time zones..."
56
+ class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:border-blue-500 search-input">
57
+ <i class="fas fa-search absolute right-3 top-3.5 text-gray-400"></i>
58
+ </div>
59
+ <button id="add-timezone" class="bg-blue-500 hover:bg-blue-600 text-white px-6 py-3 rounded-lg font-medium transition flex items-center justify-center">
60
+ <i class="fas fa-plus mr-2"></i> Add Timezone
61
+ </button>
62
+ </div>
63
+
64
+ <!-- Current Time Display -->
65
+ <div class="bg-white rounded-xl shadow-md p-6 mb-8 dark:dark-card">
66
+ <div class="flex flex-col md:flex-row justify-between items-center">
67
+ <div>
68
+ <h2 class="text-xl font-semibold text-gray-700 dark:text-gray-200">Current Local Time</h2>
69
+ <p id="local-time" class="text-4xl font-bold text-gray-800 dark:text-white mt-2"></p>
70
+ <p id="local-date" class="text-gray-500 dark:text-gray-300 mt-1"></p>
71
+ </div>
72
+ <div class="mt-4 md:mt-0">
73
+ <p class="text-gray-600 dark:text-gray-300">Your timezone:</p>
74
+ <p id="local-timezone" class="text-lg font-medium text-gray-800 dark:text-white"></p>
75
+ </div>
76
+ </div>
77
+ </div>
78
+
79
+ <!-- Timezone Cards Grid -->
80
+ <div id="timezones-container" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
81
+ <!-- Cards will be added here dynamically -->
82
+ </div>
83
+
84
+ <!-- Add Timezone Modal -->
85
+ <div id="timezone-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
86
+ <div class="bg-white rounded-xl p-6 w-full max-w-md dark:dark-card">
87
+ <div class="flex justify-between items-center mb-4">
88
+ <h3 class="text-xl font-bold text-gray-800 dark:text-white">Add Timezone</h3>
89
+ <button id="close-modal" class="text-gray-500 hover:text-gray-700 dark:text-gray-300 dark:hover:text-gray-100">
90
+ <i class="fas fa-times"></i>
91
+ </button>
92
+ </div>
93
+ <div class="mb-4">
94
+ <label for="timezone-select" class="block text-gray-700 dark:text-gray-300 mb-2">Select Timezone:</label>
95
+ <select id="timezone-select" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
96
+ <option value="">-- Select a timezone --</option>
97
+ <!-- Options will be added dynamically -->
98
+ </select>
99
+ </div>
100
+ <div class="mb-4">
101
+ <label for="timezone-label" class="block text-gray-700 dark:text-gray-300 mb-2">Custom Label (optional):</label>
102
+ <input type="text" id="timezone-label" placeholder="e.g. 'New York Office'"
103
+ class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
104
+ </div>
105
+ <button id="save-timezone" class="w-full bg-blue-500 hover:bg-blue-600 text-white px-6 py-3 rounded-lg font-medium transition">
106
+ Add Timezone
107
+ </button>
108
+ </div>
109
+ </div>
110
+ </div>
111
+
112
+ <script>
113
+ document.addEventListener('DOMContentLoaded', function() {
114
+ // DOM Elements
115
+ const themeToggle = document.getElementById('theme-toggle');
116
+ const searchInput = document.getElementById('search');
117
+ const addTimezoneBtn = document.getElementById('add-timezone');
118
+ const timezoneModal = document.getElementById('timezone-modal');
119
+ const closeModalBtn = document.getElementById('close-modal');
120
+ const saveTimezoneBtn = document.getElementById('save-timezone');
121
+ const timezoneSelect = document.getElementById('timezone-select');
122
+ const timezoneLabel = document.getElementById('timezone-label');
123
+ const timezonesContainer = document.getElementById('timezones-container');
124
+ const localTimeElement = document.getElementById('local-time');
125
+ const localDateElement = document.getElementById('local-date');
126
+ const localTimezoneElement = document.getElementById('local-timezone');
127
+
128
+ // Theme toggle
129
+ themeToggle.addEventListener('click', () => {
130
+ document.body.classList.toggle('dark-mode');
131
+ const icon = themeToggle.querySelector('i');
132
+ if (document.body.classList.contains('dark-mode')) {
133
+ icon.classList.remove('fa-moon');
134
+ icon.classList.add('fa-sun');
135
+ } else {
136
+ icon.classList.remove('fa-sun');
137
+ icon.classList.add('fa-moon');
138
+ }
139
+ });
140
+
141
+ // Timezone data - common timezones with their display names
142
+ const timezoneData = [
143
+ { id: 'America/New_York', name: 'New York', flag: '๐Ÿ‡บ๐Ÿ‡ธ' },
144
+ { id: 'America/Los_Angeles', name: 'Los Angeles', flag: '๐Ÿ‡บ๐Ÿ‡ธ' },
145
+ { id: 'America/Chicago', name: 'Chicago', flag: '๐Ÿ‡บ๐Ÿ‡ธ' },
146
+ { id: 'Europe/London', name: 'London', flag: '๐Ÿ‡ฌ๐Ÿ‡ง' },
147
+ { id: 'Europe/Paris', name: 'Paris', flag: '๐Ÿ‡ซ๐Ÿ‡ท' },
148
+ { id: 'Europe/Berlin', name: 'Berlin', flag: '๐Ÿ‡ฉ๐Ÿ‡ช' },
149
+ { id: 'Asia/Tokyo', name: 'Tokyo', flag: '๐Ÿ‡ฏ๐Ÿ‡ต' },
150
+ { id: 'Asia/Shanghai', name: 'Shanghai', flag: '๐Ÿ‡จ๐Ÿ‡ณ' },
151
+ { id: 'Asia/Dubai', name: 'Dubai', flag: '๐Ÿ‡ฆ๐Ÿ‡ช' },
152
+ { id: 'Australia/Sydney', name: 'Sydney', flag: '๐Ÿ‡ฆ๐Ÿ‡บ' },
153
+ { id: 'America/Toronto', name: 'Toronto', flag: '๐Ÿ‡จ๐Ÿ‡ฆ' },
154
+ { id: 'America/Sao_Paulo', name: 'Sรฃo Paulo', flag: '๐Ÿ‡ง๐Ÿ‡ท' },
155
+ { id: 'Africa/Johannesburg', name: 'Johannesburg', flag: '๐Ÿ‡ฟ๐Ÿ‡ฆ' },
156
+ { id: 'Asia/Kolkata', name: 'Mumbai', flag: '๐Ÿ‡ฎ๐Ÿ‡ณ' },
157
+ { id: 'Asia/Singapore', name: 'Singapore', flag: '๐Ÿ‡ธ๐Ÿ‡ฌ' }
158
+ ];
159
+
160
+ // Populate timezone select dropdown
161
+ timezoneData.forEach(tz => {
162
+ const option = document.createElement('option');
163
+ option.value = tz.id;
164
+ option.textContent = `${tz.flag} ${tz.name} (${tz.id})`;
165
+ timezoneSelect.appendChild(option);
166
+ });
167
+
168
+ // Modal controls
169
+ addTimezoneBtn.addEventListener('click', () => {
170
+ timezoneModal.classList.remove('hidden');
171
+ });
172
+
173
+ closeModalBtn.addEventListener('click', () => {
174
+ timezoneModal.classList.add('hidden');
175
+ });
176
+
177
+ // Save new timezone
178
+ saveTimezoneBtn.addEventListener('click', () => {
179
+ const selectedTimezone = timezoneSelect.value;
180
+ const customLabel = timezoneLabel.value.trim();
181
+
182
+ if (!selectedTimezone) {
183
+ alert('Please select a timezone');
184
+ return;
185
+ }
186
+
187
+ const timezoneInfo = timezoneData.find(tz => tz.id === selectedTimezone);
188
+ const label = customLabel || timezoneInfo.name;
189
+
190
+ addTimezoneCard(selectedTimezone, label, timezoneInfo.flag);
191
+ timezoneModal.classList.add('hidden');
192
+
193
+ // Reset form
194
+ timezoneSelect.value = '';
195
+ timezoneLabel.value = '';
196
+ });
197
+
198
+ // Add a timezone card
199
+ function addTimezoneCard(timezoneId, label, flag) {
200
+ const card = document.createElement('div');
201
+ card.className = 'bg-white rounded-xl shadow-md p-6 time-card dark:dark-card';
202
+ card.dataset.timezone = timezoneId;
203
+
204
+ const timezoneInfo = timezoneData.find(tz => tz.id === timezoneId);
205
+
206
+ card.innerHTML = `
207
+ <div class="flex justify-between items-start mb-4">
208
+ <div>
209
+ <h3 class="text-xl font-semibold text-gray-800 dark:text-white">${label}</h3>
210
+ <p class="text-gray-500 dark:text-gray-300">${timezoneId}</p>
211
+ </div>
212
+ <span class="text-2xl">${flag || '๐ŸŒ'}</span>
213
+ </div>
214
+ <div class="flex justify-between items-end">
215
+ <div>
216
+ <p class="text-3xl font-bold text-gray-800 dark:text-white" data-time>00:00:00</p>
217
+ <p class="text-gray-500 dark:text-gray-300" data-date>January 1, 1970</p>
218
+ </div>
219
+ <button class="delete-timezone p-2 text-gray-400 hover:text-red-500 transition">
220
+ <i class="fas fa-trash"></i>
221
+ </button>
222
+ </div>
223
+ `;
224
+
225
+ timezonesContainer.appendChild(card);
226
+
227
+ // Add delete functionality
228
+ const deleteBtn = card.querySelector('.delete-timezone');
229
+ deleteBtn.addEventListener('click', () => {
230
+ card.remove();
231
+ });
232
+
233
+ // Update time immediately
234
+ updateTimezoneTime(card, timezoneId);
235
+ }
236
+
237
+ // Update time for a specific timezone card
238
+ function updateTimezoneTime(card, timezoneId) {
239
+ const now = new Date();
240
+ const options = {
241
+ timeZone: timezoneId,
242
+ hour: '2-digit',
243
+ minute: '2-digit',
244
+ second: '2-digit',
245
+ hour12: false
246
+ };
247
+
248
+ const dateOptions = {
249
+ timeZone: timezoneId,
250
+ weekday: 'long',
251
+ year: 'numeric',
252
+ month: 'long',
253
+ day: 'numeric'
254
+ };
255
+
256
+ const timeStr = now.toLocaleTimeString('en-US', options);
257
+ const dateStr = now.toLocaleDateString('en-US', dateOptions);
258
+
259
+ card.querySelector('[data-time]').textContent = timeStr;
260
+ card.querySelector('[data-date]').textContent = dateStr;
261
+ }
262
+
263
+ // Update all timezone times
264
+ function updateAllTimes() {
265
+ const now = new Date();
266
+
267
+ // Update local time
268
+ const localTimeStr = now.toLocaleTimeString('en-US', {
269
+ hour: '2-digit',
270
+ minute: '2-digit',
271
+ second: '2-digit',
272
+ hour12: false
273
+ });
274
+
275
+ const localDateStr = now.toLocaleDateString('en-US', {
276
+ weekday: 'long',
277
+ year: 'numeric',
278
+ month: 'long',
279
+ day: 'numeric'
280
+ });
281
+
282
+ localTimeElement.textContent = localTimeStr;
283
+ localDateElement.textContent = localDateStr;
284
+ localTimezoneElement.textContent = Intl.DateTimeFormat().resolvedOptions().timeZone;
285
+
286
+ // Update all timezone cards
287
+ const cards = document.querySelectorAll('[data-timezone]');
288
+ cards.forEach(card => {
289
+ updateTimezoneTime(card, card.dataset.timezone);
290
+ });
291
+ }
292
+
293
+ // Search functionality
294
+ searchInput.addEventListener('input', () => {
295
+ const searchTerm = searchInput.value.toLowerCase();
296
+ const cards = document.querySelectorAll('[data-timezone]');
297
+
298
+ cards.forEach(card => {
299
+ const label = card.querySelector('h3').textContent.toLowerCase();
300
+ const timezone = card.querySelector('p').textContent.toLowerCase();
301
+
302
+ if (label.includes(searchTerm) || timezone.includes(searchTerm)) {
303
+ card.style.display = 'block';
304
+ } else {
305
+ card.style.display = 'none';
306
+ }
307
+ });
308
+ });
309
+
310
+ // Add some default timezones
311
+ addTimezoneCard('America/New_York', 'New York', '๐Ÿ‡บ๐Ÿ‡ธ');
312
+ addTimezoneCard('Europe/London', 'London', '๐Ÿ‡ฌ๐Ÿ‡ง');
313
+ addTimezoneCard('Asia/Tokyo', 'Tokyo', '๐Ÿ‡ฏ๐Ÿ‡ต');
314
+
315
+ // Update time every second
316
+ setInterval(updateAllTimes, 1000);
317
+ updateAllTimes(); // Initial update
318
+ });
319
+ </script>
320
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - ๐Ÿงฌ <a href="https://enzostvs-deepsite.hf.space?remix=AhBoh/fuso-orari" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
321
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Real inplementation of a World time zones App