File size: 16,007 Bytes
f190595
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Dual Website Viewer</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        .resize-handle {
            width: 8px;
            background: #e5e7eb;
            cursor: col-resize;
            transition: background 0.2s;
        }
        .resize-handle:hover {
            background: #3b82f6;
        }
        .iframe-container {
            transition: width 0.3s ease;
        }
        .tab-button {
            transition: all 0.2s ease;
        }
        .tab-button.active {
            background-color: #3b82f6;
            color: white;
        }
        .tab-button:hover:not(.active) {
            background-color: #e5e7eb;
        }
    </style>
</head>
<body class="bg-gray-100 min-h-screen">
    <div class="container mx-auto px-4 py-6">
        <!-- Header -->
        <header class="flex items-center justify-between mb-6">
            <div class="flex items-center space-x-2">
                <i class="fas fa-atom text-blue-500 text-2xl"></i>
                <h1 class="text-xl font-bold text-gray-800">Dual Website Viewer</h1>
            </div>
            <div class="flex space-x-2">
                <button id="reset-btn" class="px-3 py-1 bg-gray-200 rounded-md hover:bg-gray-300 text-sm">
                    <i class="fas fa-sync-alt mr-1"></i> Reset
                </button>
                <button id="fullscreen-btn" class="px-3 py-1 bg-blue-500 text-white rounded-md hover:bg-blue-600 text-sm">
                    <i class="fas fa-expand mr-1"></i> Fullscreen
                </button>
            </div>
        </header>

        <!-- URL Input Section -->
        <div class="bg-white rounded-lg shadow-md p-4 mb-6">
            <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                <div>
                    <label for="url1" class="block text-sm font-medium text-gray-700 mb-1">Left Website URL</label>
                    <div class="flex">
                        <input type="text" id="url1" placeholder="https://example.com" 
                            class="flex-1 px-3 py-2 border border-gray-300 rounded-l-md focus:outline-none focus:ring-2 focus:ring-blue-500">
                        <button id="load1" class="px-4 py-2 bg-blue-500 text-white rounded-r-md hover:bg-blue-600">
                            <i class="fas fa-arrow-right"></i>
                        </button>
                    </div>
                </div>
                <div>
                    <label for="url2" class="block text-sm font-medium text-gray-700 mb-1">Right Website URL</label>
                    <div class="flex">
                        <input type="text" id="url2" placeholder="https://example.com" 
                            class="flex-1 px-3 py-2 border border-gray-300 rounded-l-md focus:outline-none focus:ring-2 focus:ring-blue-500">
                        <button id="load2" class="px-4 py-2 bg-blue-500 text-white rounded-r-md hover:bg-blue-600">
                            <i class="fas fa-arrow-right"></i>
                        </button>
                    </div>
                </div>
            </div>
        </div>

        <!-- View Mode Selector -->
        <div class="flex mb-4 bg-white rounded-lg shadow-sm overflow-hidden">
            <button id="split-view" class="tab-button active flex-1 py-2 text-center border-r border-gray-200">
                <i class="fas fa-columns mr-2"></i> Split View
            </button>
            <button id="left-only" class="tab-button flex-1 py-2 text-center border-r border-gray-200">
                <i class="fas fa-arrow-left mr-2"></i> Left Only
            </button>
            <button id="right-only" class="tab-button flex-1 py-2 text-center">
                <i class="fas fa-arrow-right mr-2"></i> Right Only
            </button>
        </div>

        <!-- Website Viewers -->
        <div class="flex bg-white rounded-lg shadow-md overflow-hidden" style="height: 70vh;">
            <!-- Left Website -->
            <div id="iframe-container1" class="iframe-container h-full relative" style="width: 50%;">
                <div class="absolute top-0 left-0 right-0 bg-gray-100 px-3 py-1 flex justify-between items-center">
                    <span class="text-xs text-gray-600 truncate" id="url-display1">No website loaded</span>
                    <div class="flex space-x-1">
                        <button class="iframe-control p-1 text-gray-500 hover:text-blue-500">
                            <i class="fas fa-redo text-xs"></i>
                        </button>
                        <button class="iframe-control p-1 text-gray-500 hover:text-blue-500">
                            <i class="fas fa-external-link-alt text-xs"></i>
                        </button>
                    </div>
                </div>
                <iframe id="iframe1" class="w-full h-full border-0" style="height: calc(100% - 28px);"></iframe>
            </div>

            <!-- Resize Handle -->
            <div id="resize-handle" class="resize-handle h-full"></div>

            <!-- Right Website -->
            <div id="iframe-container2" class="iframe-container h-full relative" style="width: 50%;">
                <div class="absolute top-0 left-0 right-0 bg-gray-100 px-3 py-1 flex justify-between items-center">
                    <span class="text-xs text-gray-600 truncate" id="url-display2">No website loaded</span>
                    <div class="flex space-x-1">
                        <button class="iframe-control p-1 text-gray-500 hover:text-blue-500">
                            <i class="fas fa-redo text-xs"></i>
                        </button>
                        <button class="iframe-control p-1 text-gray-500 hover:text-blue-500">
                            <i class="fas fa-external-link-alt text-xs"></i>
                        </button>
                    </div>
                </div>
                <iframe id="iframe2" class="w-full h-full border-0" style="height: calc(100% - 28px);"></iframe>
            </div>
        </div>

        <!-- Responsive Presets -->
        <div class="mt-4 flex flex-wrap gap-2">
            <span class="text-sm text-gray-600 mr-2">Device Presets:</span>
            <button class="preset-btn px-3 py-1 bg-gray-200 rounded-md text-xs hover:bg-gray-300" data-width="25">
                <i class="fas fa-mobile-alt mr-1"></i> Mobile (25%)
            </button>
            <button class="preset-btn px-3 py-1 bg-gray-200 rounded-md text-xs hover:bg-gray-300" data-width="50">
                <i class="fas fa-tablet-alt mr-1"></i> Tablet (50%)
            </button>
            <button class="preset-btn px-3 py-1 bg-gray-200 rounded-md text-xs hover:bg-gray-300" data-width="75">
                <i class="fas fa-laptop mr-1"></i> Laptop (75%)
            </button>
            <button class="preset-btn px-3 py-1 bg-gray-200 rounded-md text-xs hover:bg-gray-300" data-width="100">
                <i class="fas fa-desktop mr-1"></i> Full (100%)
            </button>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // Elements
            const iframe1 = document.getElementById('iframe1');
            const iframe2 = document.getElementById('iframe2');
            const url1Input = document.getElementById('url1');
            const url2Input = document.getElementById('url2');
            const loadBtn1 = document.getElementById('load1');
            const loadBtn2 = document.getElementById('load2');
            const urlDisplay1 = document.getElementById('url-display1');
            const urlDisplay2 = document.getElementById('url-display2');
            const iframeContainer1 = document.getElementById('iframe-container1');
            const iframeContainer2 = document.getElementById('iframe-container2');
            const resizeHandle = document.getElementById('resize-handle');
            const resetBtn = document.getElementById('reset-btn');
            const fullscreenBtn = document.getElementById('fullscreen-btn');
            const splitViewBtn = document.getElementById('split-view');
            const leftOnlyBtn = document.getElementById('left-only');
            const rightOnlyBtn = document.getElementById('right-only');
            const presetBtns = document.querySelectorAll('.preset-btn');
            const tabButtons = document.querySelectorAll('.tab-button');

            // Default URLs
            const defaultUrl1 = 'https://huggingface.co';
            const defaultUrl2 = 'https://github.com';
            url1Input.value = defaultUrl1;
            url2Input.value = defaultUrl2;
            loadIframe(iframe1, defaultUrl1, urlDisplay1);
            loadIframe(iframe2, defaultUrl2, urlDisplay2);

            // Load buttons
            loadBtn1.addEventListener('click', () => {
                const url = url1Input.value.trim();
                if (url) {
                    loadIframe(iframe1, url, urlDisplay1);
                }
            });

            loadBtn2.addEventListener('click', () => {
                const url = url2Input.value.trim();
                if (url) {
                    loadIframe(iframe2, url, urlDisplay2);
                }
            });

            // Enter key to load
            url1Input.addEventListener('keypress', (e) => {
                if (e.key === 'Enter') loadBtn1.click();
            });

            url2Input.addEventListener('keypress', (e) => {
                if (e.key === 'Enter') loadBtn2.click();
            });

            // Reset button
            resetBtn.addEventListener('click', () => {
                url1Input.value = defaultUrl1;
                url2Input.value = defaultUrl2;
                loadIframe(iframe1, defaultUrl1, urlDisplay1);
                loadIframe(iframe2, defaultUrl2, urlDisplay2);
                setViewMode('split');
                iframeContainer1.style.width = '50%';
                iframeContainer2.style.width = '50%';
            });

            // Fullscreen button
            fullscreenBtn.addEventListener('click', () => {
                if (!document.fullscreenElement) {
                    document.documentElement.requestFullscreen();
                } else {
                    if (document.exitFullscreen) {
                        document.exitFullscreen();
                    }
                }
            });

            // View mode buttons
            splitViewBtn.addEventListener('click', () => setViewMode('split'));
            leftOnlyBtn.addEventListener('click', () => setViewMode('left'));
            rightOnlyBtn.addEventListener('click', () => setViewMode('right'));

            // Preset buttons
            presetBtns.forEach(btn => {
                btn.addEventListener('click', () => {
                    const width = parseInt(btn.dataset.width);
                    if (width === 100) {
                        setViewMode('split');
                        iframeContainer1.style.width = '50%';
                        iframeContainer2.style.width = '50%';
                    } else {
                        setViewMode('left');
                        iframeContainer1.style.width = `${width}%`;
                        iframeContainer2.style.width = `${100 - width}%`;
                    }
                });
            });

            // Resize functionality
            let isResizing = false;
            resizeHandle.addEventListener('mousedown', (e) => {
                isResizing = true;
                document.body.style.cursor = 'col-resize';
                document.addEventListener('mousemove', handleResize);
                document.addEventListener('mouseup', () => {
                    isResizing = false;
                    document.body.style.cursor = '';
                    document.removeEventListener('mousemove', handleResize);
                });
            });

            function handleResize(e) {
                if (!isResizing) return;
                
                const containerRect = iframeContainer1.parentElement.getBoundingClientRect();
                const containerWidth = containerRect.width;
                const mouseX = e.clientX - containerRect.left;
                
                // Calculate new widths (minimum 20% each)
                const newLeftWidth = Math.max(20, Math.min(80, (mouseX / containerWidth) * 100));
                
                iframeContainer1.style.width = `${newLeftWidth}%`;
                iframeContainer2.style.width = `${100 - newLeftWidth}%`;
            }

            // Helper functions
            function loadIframe(iframe, url, displayElement) {
                if (!url.startsWith('http://') && !url.startsWith('https://')) {
                    url = 'https://' + url;
                }
                iframe.src = url;
                displayElement.textContent = url;
            }

            function setViewMode(mode) {
                // Update active tab
                tabButtons.forEach(btn => btn.classList.remove('active'));
                
                if (mode === 'split') {
                    splitViewBtn.classList.add('active');
                    iframeContainer1.style.display = 'block';
                    iframeContainer2.style.display = 'block';
                    resizeHandle.style.display = 'block';
                    iframeContainer1.style.width = '50%';
                    iframeContainer2.style.width = '50%';
                } else if (mode === 'left') {
                    leftOnlyBtn.classList.add('active');
                    iframeContainer1.style.display = 'block';
                    iframeContainer2.style.display = 'none';
                    resizeHandle.style.display = 'none';
                    iframeContainer1.style.width = '100%';
                } else if (mode === 'right') {
                    rightOnlyBtn.classList.add('active');
                    iframeContainer1.style.display = 'none';
                    iframeContainer2.style.display = 'block';
                    resizeHandle.style.display = 'none';
                    iframeContainer2.style.width = '100%';
                }
            }

            // Iframe controls
            document.querySelectorAll('.iframe-control').forEach(btn => {
                btn.addEventListener('click', function() {
                    const iframeContainer = this.closest('.iframe-container');
                    const iframe = iframeContainer.querySelector('iframe');
                    const urlDisplay = iframeContainer.querySelector('.text-xs');
                    
                    if (this.querySelector('.fa-redo')) {
                        // Refresh button
                        iframe.src = iframe.src;
                    } else if (this.querySelector('.fa-external-link-alt')) {
                        // Open in new tab
                        window.open(iframe.src, '_blank');
                    }
                });
            });
        });
    </script>
<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>
</html>