vorstcavry commited on
Commit
f190595
·
verified ·
1 Parent(s): 2c29705

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +325 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Test12
3
- emoji: 📚
4
- colorFrom: green
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: test12
3
+ emoji: 🐳
4
+ colorFrom: yellow
5
+ colorTo: red
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,325 @@
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>Dual Website Viewer</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
+ .resize-handle {
11
+ width: 8px;
12
+ background: #e5e7eb;
13
+ cursor: col-resize;
14
+ transition: background 0.2s;
15
+ }
16
+ .resize-handle:hover {
17
+ background: #3b82f6;
18
+ }
19
+ .iframe-container {
20
+ transition: width 0.3s ease;
21
+ }
22
+ .tab-button {
23
+ transition: all 0.2s ease;
24
+ }
25
+ .tab-button.active {
26
+ background-color: #3b82f6;
27
+ color: white;
28
+ }
29
+ .tab-button:hover:not(.active) {
30
+ background-color: #e5e7eb;
31
+ }
32
+ </style>
33
+ </head>
34
+ <body class="bg-gray-100 min-h-screen">
35
+ <div class="container mx-auto px-4 py-6">
36
+ <!-- Header -->
37
+ <header class="flex items-center justify-between mb-6">
38
+ <div class="flex items-center space-x-2">
39
+ <i class="fas fa-atom text-blue-500 text-2xl"></i>
40
+ <h1 class="text-xl font-bold text-gray-800">Dual Website Viewer</h1>
41
+ </div>
42
+ <div class="flex space-x-2">
43
+ <button id="reset-btn" class="px-3 py-1 bg-gray-200 rounded-md hover:bg-gray-300 text-sm">
44
+ <i class="fas fa-sync-alt mr-1"></i> Reset
45
+ </button>
46
+ <button id="fullscreen-btn" class="px-3 py-1 bg-blue-500 text-white rounded-md hover:bg-blue-600 text-sm">
47
+ <i class="fas fa-expand mr-1"></i> Fullscreen
48
+ </button>
49
+ </div>
50
+ </header>
51
+
52
+ <!-- URL Input Section -->
53
+ <div class="bg-white rounded-lg shadow-md p-4 mb-6">
54
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
55
+ <div>
56
+ <label for="url1" class="block text-sm font-medium text-gray-700 mb-1">Left Website URL</label>
57
+ <div class="flex">
58
+ <input type="text" id="url1" placeholder="https://example.com"
59
+ class="flex-1 px-3 py-2 border border-gray-300 rounded-l-md focus:outline-none focus:ring-2 focus:ring-blue-500">
60
+ <button id="load1" class="px-4 py-2 bg-blue-500 text-white rounded-r-md hover:bg-blue-600">
61
+ <i class="fas fa-arrow-right"></i>
62
+ </button>
63
+ </div>
64
+ </div>
65
+ <div>
66
+ <label for="url2" class="block text-sm font-medium text-gray-700 mb-1">Right Website URL</label>
67
+ <div class="flex">
68
+ <input type="text" id="url2" placeholder="https://example.com"
69
+ class="flex-1 px-3 py-2 border border-gray-300 rounded-l-md focus:outline-none focus:ring-2 focus:ring-blue-500">
70
+ <button id="load2" class="px-4 py-2 bg-blue-500 text-white rounded-r-md hover:bg-blue-600">
71
+ <i class="fas fa-arrow-right"></i>
72
+ </button>
73
+ </div>
74
+ </div>
75
+ </div>
76
+ </div>
77
+
78
+ <!-- View Mode Selector -->
79
+ <div class="flex mb-4 bg-white rounded-lg shadow-sm overflow-hidden">
80
+ <button id="split-view" class="tab-button active flex-1 py-2 text-center border-r border-gray-200">
81
+ <i class="fas fa-columns mr-2"></i> Split View
82
+ </button>
83
+ <button id="left-only" class="tab-button flex-1 py-2 text-center border-r border-gray-200">
84
+ <i class="fas fa-arrow-left mr-2"></i> Left Only
85
+ </button>
86
+ <button id="right-only" class="tab-button flex-1 py-2 text-center">
87
+ <i class="fas fa-arrow-right mr-2"></i> Right Only
88
+ </button>
89
+ </div>
90
+
91
+ <!-- Website Viewers -->
92
+ <div class="flex bg-white rounded-lg shadow-md overflow-hidden" style="height: 70vh;">
93
+ <!-- Left Website -->
94
+ <div id="iframe-container1" class="iframe-container h-full relative" style="width: 50%;">
95
+ <div class="absolute top-0 left-0 right-0 bg-gray-100 px-3 py-1 flex justify-between items-center">
96
+ <span class="text-xs text-gray-600 truncate" id="url-display1">No website loaded</span>
97
+ <div class="flex space-x-1">
98
+ <button class="iframe-control p-1 text-gray-500 hover:text-blue-500">
99
+ <i class="fas fa-redo text-xs"></i>
100
+ </button>
101
+ <button class="iframe-control p-1 text-gray-500 hover:text-blue-500">
102
+ <i class="fas fa-external-link-alt text-xs"></i>
103
+ </button>
104
+ </div>
105
+ </div>
106
+ <iframe id="iframe1" class="w-full h-full border-0" style="height: calc(100% - 28px);"></iframe>
107
+ </div>
108
+
109
+ <!-- Resize Handle -->
110
+ <div id="resize-handle" class="resize-handle h-full"></div>
111
+
112
+ <!-- Right Website -->
113
+ <div id="iframe-container2" class="iframe-container h-full relative" style="width: 50%;">
114
+ <div class="absolute top-0 left-0 right-0 bg-gray-100 px-3 py-1 flex justify-between items-center">
115
+ <span class="text-xs text-gray-600 truncate" id="url-display2">No website loaded</span>
116
+ <div class="flex space-x-1">
117
+ <button class="iframe-control p-1 text-gray-500 hover:text-blue-500">
118
+ <i class="fas fa-redo text-xs"></i>
119
+ </button>
120
+ <button class="iframe-control p-1 text-gray-500 hover:text-blue-500">
121
+ <i class="fas fa-external-link-alt text-xs"></i>
122
+ </button>
123
+ </div>
124
+ </div>
125
+ <iframe id="iframe2" class="w-full h-full border-0" style="height: calc(100% - 28px);"></iframe>
126
+ </div>
127
+ </div>
128
+
129
+ <!-- Responsive Presets -->
130
+ <div class="mt-4 flex flex-wrap gap-2">
131
+ <span class="text-sm text-gray-600 mr-2">Device Presets:</span>
132
+ <button class="preset-btn px-3 py-1 bg-gray-200 rounded-md text-xs hover:bg-gray-300" data-width="25">
133
+ <i class="fas fa-mobile-alt mr-1"></i> Mobile (25%)
134
+ </button>
135
+ <button class="preset-btn px-3 py-1 bg-gray-200 rounded-md text-xs hover:bg-gray-300" data-width="50">
136
+ <i class="fas fa-tablet-alt mr-1"></i> Tablet (50%)
137
+ </button>
138
+ <button class="preset-btn px-3 py-1 bg-gray-200 rounded-md text-xs hover:bg-gray-300" data-width="75">
139
+ <i class="fas fa-laptop mr-1"></i> Laptop (75%)
140
+ </button>
141
+ <button class="preset-btn px-3 py-1 bg-gray-200 rounded-md text-xs hover:bg-gray-300" data-width="100">
142
+ <i class="fas fa-desktop mr-1"></i> Full (100%)
143
+ </button>
144
+ </div>
145
+ </div>
146
+
147
+ <script>
148
+ document.addEventListener('DOMContentLoaded', function() {
149
+ // Elements
150
+ const iframe1 = document.getElementById('iframe1');
151
+ const iframe2 = document.getElementById('iframe2');
152
+ const url1Input = document.getElementById('url1');
153
+ const url2Input = document.getElementById('url2');
154
+ const loadBtn1 = document.getElementById('load1');
155
+ const loadBtn2 = document.getElementById('load2');
156
+ const urlDisplay1 = document.getElementById('url-display1');
157
+ const urlDisplay2 = document.getElementById('url-display2');
158
+ const iframeContainer1 = document.getElementById('iframe-container1');
159
+ const iframeContainer2 = document.getElementById('iframe-container2');
160
+ const resizeHandle = document.getElementById('resize-handle');
161
+ const resetBtn = document.getElementById('reset-btn');
162
+ const fullscreenBtn = document.getElementById('fullscreen-btn');
163
+ const splitViewBtn = document.getElementById('split-view');
164
+ const leftOnlyBtn = document.getElementById('left-only');
165
+ const rightOnlyBtn = document.getElementById('right-only');
166
+ const presetBtns = document.querySelectorAll('.preset-btn');
167
+ const tabButtons = document.querySelectorAll('.tab-button');
168
+
169
+ // Default URLs
170
+ const defaultUrl1 = 'https://huggingface.co';
171
+ const defaultUrl2 = 'https://github.com';
172
+ url1Input.value = defaultUrl1;
173
+ url2Input.value = defaultUrl2;
174
+ loadIframe(iframe1, defaultUrl1, urlDisplay1);
175
+ loadIframe(iframe2, defaultUrl2, urlDisplay2);
176
+
177
+ // Load buttons
178
+ loadBtn1.addEventListener('click', () => {
179
+ const url = url1Input.value.trim();
180
+ if (url) {
181
+ loadIframe(iframe1, url, urlDisplay1);
182
+ }
183
+ });
184
+
185
+ loadBtn2.addEventListener('click', () => {
186
+ const url = url2Input.value.trim();
187
+ if (url) {
188
+ loadIframe(iframe2, url, urlDisplay2);
189
+ }
190
+ });
191
+
192
+ // Enter key to load
193
+ url1Input.addEventListener('keypress', (e) => {
194
+ if (e.key === 'Enter') loadBtn1.click();
195
+ });
196
+
197
+ url2Input.addEventListener('keypress', (e) => {
198
+ if (e.key === 'Enter') loadBtn2.click();
199
+ });
200
+
201
+ // Reset button
202
+ resetBtn.addEventListener('click', () => {
203
+ url1Input.value = defaultUrl1;
204
+ url2Input.value = defaultUrl2;
205
+ loadIframe(iframe1, defaultUrl1, urlDisplay1);
206
+ loadIframe(iframe2, defaultUrl2, urlDisplay2);
207
+ setViewMode('split');
208
+ iframeContainer1.style.width = '50%';
209
+ iframeContainer2.style.width = '50%';
210
+ });
211
+
212
+ // Fullscreen button
213
+ fullscreenBtn.addEventListener('click', () => {
214
+ if (!document.fullscreenElement) {
215
+ document.documentElement.requestFullscreen();
216
+ } else {
217
+ if (document.exitFullscreen) {
218
+ document.exitFullscreen();
219
+ }
220
+ }
221
+ });
222
+
223
+ // View mode buttons
224
+ splitViewBtn.addEventListener('click', () => setViewMode('split'));
225
+ leftOnlyBtn.addEventListener('click', () => setViewMode('left'));
226
+ rightOnlyBtn.addEventListener('click', () => setViewMode('right'));
227
+
228
+ // Preset buttons
229
+ presetBtns.forEach(btn => {
230
+ btn.addEventListener('click', () => {
231
+ const width = parseInt(btn.dataset.width);
232
+ if (width === 100) {
233
+ setViewMode('split');
234
+ iframeContainer1.style.width = '50%';
235
+ iframeContainer2.style.width = '50%';
236
+ } else {
237
+ setViewMode('left');
238
+ iframeContainer1.style.width = `${width}%`;
239
+ iframeContainer2.style.width = `${100 - width}%`;
240
+ }
241
+ });
242
+ });
243
+
244
+ // Resize functionality
245
+ let isResizing = false;
246
+ resizeHandle.addEventListener('mousedown', (e) => {
247
+ isResizing = true;
248
+ document.body.style.cursor = 'col-resize';
249
+ document.addEventListener('mousemove', handleResize);
250
+ document.addEventListener('mouseup', () => {
251
+ isResizing = false;
252
+ document.body.style.cursor = '';
253
+ document.removeEventListener('mousemove', handleResize);
254
+ });
255
+ });
256
+
257
+ function handleResize(e) {
258
+ if (!isResizing) return;
259
+
260
+ const containerRect = iframeContainer1.parentElement.getBoundingClientRect();
261
+ const containerWidth = containerRect.width;
262
+ const mouseX = e.clientX - containerRect.left;
263
+
264
+ // Calculate new widths (minimum 20% each)
265
+ const newLeftWidth = Math.max(20, Math.min(80, (mouseX / containerWidth) * 100));
266
+
267
+ iframeContainer1.style.width = `${newLeftWidth}%`;
268
+ iframeContainer2.style.width = `${100 - newLeftWidth}%`;
269
+ }
270
+
271
+ // Helper functions
272
+ function loadIframe(iframe, url, displayElement) {
273
+ if (!url.startsWith('http://') && !url.startsWith('https://')) {
274
+ url = 'https://' + url;
275
+ }
276
+ iframe.src = url;
277
+ displayElement.textContent = url;
278
+ }
279
+
280
+ function setViewMode(mode) {
281
+ // Update active tab
282
+ tabButtons.forEach(btn => btn.classList.remove('active'));
283
+
284
+ if (mode === 'split') {
285
+ splitViewBtn.classList.add('active');
286
+ iframeContainer1.style.display = 'block';
287
+ iframeContainer2.style.display = 'block';
288
+ resizeHandle.style.display = 'block';
289
+ iframeContainer1.style.width = '50%';
290
+ iframeContainer2.style.width = '50%';
291
+ } else if (mode === 'left') {
292
+ leftOnlyBtn.classList.add('active');
293
+ iframeContainer1.style.display = 'block';
294
+ iframeContainer2.style.display = 'none';
295
+ resizeHandle.style.display = 'none';
296
+ iframeContainer1.style.width = '100%';
297
+ } else if (mode === 'right') {
298
+ rightOnlyBtn.classList.add('active');
299
+ iframeContainer1.style.display = 'none';
300
+ iframeContainer2.style.display = 'block';
301
+ resizeHandle.style.display = 'none';
302
+ iframeContainer2.style.width = '100%';
303
+ }
304
+ }
305
+
306
+ // Iframe controls
307
+ document.querySelectorAll('.iframe-control').forEach(btn => {
308
+ btn.addEventListener('click', function() {
309
+ const iframeContainer = this.closest('.iframe-container');
310
+ const iframe = iframeContainer.querySelector('iframe');
311
+ const urlDisplay = iframeContainer.querySelector('.text-xs');
312
+
313
+ if (this.querySelector('.fa-redo')) {
314
+ // Refresh button
315
+ iframe.src = iframe.src;
316
+ } else if (this.querySelector('.fa-external-link-alt')) {
317
+ // Open in new tab
318
+ window.open(iframe.src, '_blank');
319
+ }
320
+ });
321
+ });
322
+ });
323
+ </script>
324
+ <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=vorstcavry/test12" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
325
+ </html>