Shinhati2023 commited on
Commit
4f82099
·
verified ·
1 Parent(s): ec6174a

Create index.html

Browse files
Files changed (1) hide show
  1. index.html +334 -18
index.html CHANGED
@@ -1,19 +1,335 @@
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>Windows Phone 8 OS</title>
7
+ <style>
8
+ /* --- METRO UI STYLING --- */
9
+ :root {
10
+ --theme-color: #00aba9; /* Teal */
11
+ --bg-color: #000000;
12
+ --text-color: #ffffff;
13
+ }
14
+
15
+ body {
16
+ margin: 0;
17
+ background-color: #111;
18
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
19
+ color: var(--text-color);
20
+ display: flex;
21
+ justify-content: center;
22
+ align-items: center;
23
+ height: 100vh;
24
+ overflow: hidden;
25
+ }
26
+
27
+ /* The Phone Bezel */
28
+ #phone-case {
29
+ width: 360px;
30
+ height: 640px;
31
+ background: #222;
32
+ border: 10px solid #444;
33
+ border-radius: 20px;
34
+ position: relative;
35
+ overflow: hidden;
36
+ box-shadow: 0 0 20px rgba(0,0,0,0.5);
37
+ }
38
+
39
+ /* The Screen */
40
+ #screen {
41
+ width: 100%;
42
+ height: 100%;
43
+ background-color: var(--bg-color);
44
+ overflow-y: auto; /* Allow scrolling like a real phone */
45
+ scrollbar-width: none; /* Hide scrollbar Firefox */
46
+ position: relative;
47
+ }
48
+ #screen::-webkit-scrollbar { display: none; }
49
+
50
+ /* Start Screen Header */
51
+ .header {
52
+ padding: 20px 20px 10px 20px;
53
+ font-size: 2rem;
54
+ font-weight: 300;
55
+ }
56
+ .header span { font-weight: bold; }
57
+
58
+ /* Tile Grid */
59
+ .tile-container {
60
+ display: grid;
61
+ grid-template-columns: 1fr 1fr;
62
+ gap: 10px;
63
+ padding: 0 20px 50px 20px;
64
+ }
65
+
66
+ .tile {
67
+ background-color: var(--theme-color);
68
+ height: 150px;
69
+ position: relative;
70
+ cursor: pointer;
71
+ transition: transform 0.1s;
72
+ display: flex;
73
+ flex-direction: column;
74
+ justify-content: flex-end;
75
+ padding: 10px;
76
+ box-sizing: border-box;
77
+ }
78
+
79
+ .tile:active { transform: scale(0.98); }
80
+ .tile.wide { grid-column: span 2; }
81
+ .tile.green { background-color: #60a917; }
82
+ .tile.blue { background-color: #2d89ef; }
83
+ .tile.orange { background-color: #fa6800; }
84
+ .tile.purple { background-color: #6459df; }
85
+
86
+ .tile-icon { font-size: 40px; margin-bottom: auto; margin-top: 10px;}
87
+ .tile-label { font-size: 14px; }
88
+
89
+ /* Live Tile Animation (Gallery) */
90
+ .live-tile-content {
91
+ position: absolute;
92
+ top: 0; left: 0; right: 0; bottom: 0;
93
+ background-size: cover;
94
+ background-position: center;
95
+ animation: flipTile 6s infinite;
96
+ opacity: 0.8;
97
+ }
98
+
99
+ @keyframes flipTile {
100
+ 0% { opacity: 0; }
101
+ 20% { opacity: 1; }
102
+ 80% { opacity: 1; }
103
+ 100% { opacity: 0; }
104
+ }
105
+
106
+ /* --- APPS (Overlays) --- */
107
+ .app-screen {
108
+ position: absolute;
109
+ top: 0; left: 0; width: 100%; height: 100%;
110
+ background: #000;
111
+ transform: translateX(100%); /* Hidden by default */
112
+ transition: transform 0.3s ease-out;
113
+ z-index: 10;
114
+ display: flex;
115
+ flex-direction: column;
116
+ }
117
+
118
+ .app-screen.open { transform: translateX(0); }
119
+
120
+ .app-header {
121
+ padding: 15px;
122
+ font-size: 24px;
123
+ background: #1f1f1f;
124
+ display: flex;
125
+ align-items: center;
126
+ }
127
+
128
+ .back-btn {
129
+ font-size: 24px;
130
+ margin-right: 15px;
131
+ cursor: pointer;
132
+ border: 2px solid white;
133
+ border-radius: 50%;
134
+ width: 30px;
135
+ height: 30px;
136
+ text-align: center;
137
+ line-height: 26px;
138
+ }
139
+
140
+ /* Gallery App Specifics */
141
+ #gallery-grid {
142
+ display: grid;
143
+ grid-template-columns: 1fr 1fr;
144
+ gap: 5px;
145
+ padding: 5px;
146
+ overflow-y: auto;
147
+ }
148
+ .gallery-img {
149
+ width: 100%;
150
+ height: 150px;
151
+ object-fit: cover;
152
+ background: #333;
153
+ }
154
+
155
+ /* Store App Specifics */
156
+ .store-item {
157
+ display: flex;
158
+ padding: 15px;
159
+ border-bottom: 1px solid #333;
160
+ }
161
+ .store-icon { width: 50px; height: 50px; background: grey; margin-right: 15px; }
162
+ .btn-install {
163
+ margin-left: auto;
164
+ background: var(--theme-color);
165
+ border: none;
166
+ color: white;
167
+ padding: 5px 15px;
168
+ cursor: pointer;
169
+ }
170
+
171
+ /* Browser App Specifics */
172
+ .browser-bar { display: flex; padding: 5px; background: #333; }
173
+ .browser-bar input { flex: 1; padding: 5px; border: none; }
174
+ iframe { flex: 1; border: none; background: white; }
175
+
176
+ </style>
177
+ </head>
178
+ <body>
179
+
180
+ <div id="phone-case">
181
+ <div id="screen">
182
+ <div class="header">Start</div>
183
+
184
+ <div class="tile-container">
185
+ <div class="tile blue" onclick="openApp('browser-app')">
186
+ <div class="tile-icon">🌐</div>
187
+ <div class="tile-label">Internet Explorer</div>
188
+ </div>
189
+
190
+ <div class="tile green" onclick="openApp('store-app')">
191
+ <div class="tile-icon">🛍️</div>
192
+ <div class="tile-label">Store</div>
193
+ </div>
194
+
195
+ <div class="tile wide purple" onclick="openApp('gallery-app')">
196
+ <div class="live-tile-content" id="live-tile-img"></div>
197
+ <div class="tile-icon">🖼️</div>
198
+ <div class="tile-label">Photos</div>
199
+ </div>
200
+
201
+ <div class="tile orange">
202
+ <div class="tile-icon">✉️</div>
203
+ <div class="tile-label">Mail</div>
204
+ </div>
205
+ <div class="tile wide">
206
+ <div class="tile-icon">📅</div>
207
+ <div class="tile-label">Calendar</div>
208
+ </div>
209
+ </div>
210
+ </div>
211
+
212
+ <div id="gallery-app" class="app-screen">
213
+ <div class="app-header">
214
+ <div class="back-btn" onclick="closeApp('gallery-app')">←</div>
215
+ Camera Roll
216
+ </div>
217
+ <div id="gallery-grid">
218
+ </div>
219
+ </div>
220
+
221
+ <div id="store-app" class="app-screen">
222
+ <div class="app-header">
223
+ <div class="back-btn" onclick="closeApp('store-app')">←</div>
224
+ Store
225
+ </div>
226
+ <div style="padding: 10px;">
227
+ <h3>Top Apps</h3>
228
+ <div class="store-item">
229
+ <div class="store-icon" style="background:#2d89ef"></div>
230
+ <div>
231
+ <div>Social Connect</div>
232
+ <small>Free</small>
233
+ </div>
234
+ <button class="btn-install" onclick="alert('Downloading...')">Get</button>
235
+ </div>
236
+ <div class="store-item">
237
+ <div class="store-icon" style="background:#fa6800"></div>
238
+ <div>
239
+ <div>Fruit Slicer</div>
240
+ <small>$0.99</small>
241
+ </div>
242
+ <button class="btn-install" onclick="alert('Purchased!')">Buy</button>
243
+ </div>
244
+ </div>
245
+ </div>
246
+
247
+ <div id="browser-app" class="app-screen">
248
+ <div class="app-header">
249
+ <div class="back-btn" onclick="closeApp('browser-app')">←</div>
250
+ Internet
251
+ </div>
252
+ <div class="browser-bar">
253
+ <input type="text" id="url-input" value="https://www.wikipedia.org">
254
+ <button onclick="loadUrl()">Go</button>
255
+ </div>
256
+ <iframe id="browser-frame" src="https://www.wikipedia.org"></iframe>
257
+ </div>
258
+
259
+ </div>
260
+
261
+ <script>
262
+ // --- CONFIGURATION ---
263
+ // List the EXACT names of files you upload to Hugging Face here
264
+ // If you upload 5 images, add them to this list.
265
+ const uploadedImages = [
266
+ 'img1.jpg',
267
+ 'img2.jpg',
268
+ 'img3.jpg'
269
+ ];
270
+
271
+ // --- SYSTEM FUNCTIONS ---
272
+
273
+ function openApp(appId) {
274
+ document.getElementById(appId).classList.add('open');
275
+
276
+ if(appId === 'gallery-app') {
277
+ loadGallery();
278
+ }
279
+ }
280
+
281
+ function closeApp(appId) {
282
+ document.getElementById(appId).classList.remove('open');
283
+ }
284
+
285
+ // --- GALLERY LOGIC ---
286
+
287
+ function loadGallery() {
288
+ const grid = document.getElementById('gallery-grid');
289
+ grid.innerHTML = ''; // Clear existing
290
+
291
+ // Detect if no images defined
292
+ if (uploadedImages.length === 0) {
293
+ grid.innerHTML = '<p style="padding:20px">No images found. Upload files to Hugging Face and update the code.</p>';
294
+ return;
295
+ }
296
+
297
+ uploadedImages.forEach(imgName => {
298
+ const img = document.createElement('img');
299
+ img.src = imgName; // In HF Static space, files are at root ./
300
+ img.className = 'gallery-img';
301
+ img.onerror = function() { this.style.display='none'; }; // Hide if missing
302
+ grid.appendChild(img);
303
+ });
304
+ }
305
+
306
+ // --- LIVE TILE LOGIC ---
307
+ function startLiveTile() {
308
+ if (uploadedImages.length > 0) {
309
+ const tile = document.getElementById('live-tile-img');
310
+ // Set initial
311
+ tile.style.backgroundImage = `url('${uploadedImages[0]}')`;
312
+
313
+ let index = 0;
314
+ setInterval(() => {
315
+ index = (index + 1) % uploadedImages.length;
316
+ tile.style.backgroundImage = `url('${uploadedImages[index]}')`;
317
+ }, 6000); // Change image every 6 seconds
318
+ }
319
+ }
320
+
321
+ // --- BROWSER LOGIC ---
322
+ function loadUrl() {
323
+ let url = document.getElementById('url-input').value;
324
+ if (!url.startsWith('http')) {
325
+ url = 'https://' + url;
326
+ }
327
+ document.getElementById('browser-frame').src = url;
328
+ }
329
+
330
+ // Initialize
331
+ startLiveTile();
332
+
333
+ </script>
334
+ </body>
335
  </html>