Spaces:
Running
Running
Add 2 files
Browse files- README.md +7 -5
- index.html +144 -19
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
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: as
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: pink
|
5 |
+
colorTo: purple
|
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,144 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Web 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 |
+
.webview-container {
|
11 |
+
transition: all 0.3s ease;
|
12 |
+
}
|
13 |
+
.webview-focused {
|
14 |
+
position: fixed;
|
15 |
+
top: 0;
|
16 |
+
left: 0;
|
17 |
+
width: 100%;
|
18 |
+
height: 100%;
|
19 |
+
z-index: 100;
|
20 |
+
background: white;
|
21 |
+
}
|
22 |
+
.webview-minimized {
|
23 |
+
width: 0;
|
24 |
+
opacity: 0;
|
25 |
+
pointer-events: none;
|
26 |
+
}
|
27 |
+
.iframe-container {
|
28 |
+
position: relative;
|
29 |
+
width: 100%;
|
30 |
+
height: 100%;
|
31 |
+
}
|
32 |
+
iframe {
|
33 |
+
width: 100%;
|
34 |
+
height: 100%;
|
35 |
+
border: none;
|
36 |
+
}
|
37 |
+
.control-bar {
|
38 |
+
position: absolute;
|
39 |
+
top: 0;
|
40 |
+
left: 0;
|
41 |
+
right: 0;
|
42 |
+
background: rgba(0,0,0,0.7);
|
43 |
+
color: white;
|
44 |
+
padding: 8px;
|
45 |
+
display: flex;
|
46 |
+
justify-content: space-between;
|
47 |
+
align-items: center;
|
48 |
+
z-index: 10;
|
49 |
+
}
|
50 |
+
.url-input {
|
51 |
+
flex-grow: 1;
|
52 |
+
margin: 0 10px;
|
53 |
+
padding: 5px;
|
54 |
+
border-radius: 4px;
|
55 |
+
border: none;
|
56 |
+
}
|
57 |
+
</style>
|
58 |
+
</head>
|
59 |
+
<body class="bg-gray-100">
|
60 |
+
<div class="container mx-auto p-4">
|
61 |
+
<h1 class="text-3xl font-bold text-center mb-6">Dual Web Viewer</h1>
|
62 |
+
<p class="text-center mb-8 text-gray-600">View two websites simultaneously. Click the expand button to focus on one while the other continues running.</p>
|
63 |
+
|
64 |
+
<div class="flex flex-col md:flex-row gap-4 h-screen">
|
65 |
+
<!-- Web 1 Container -->
|
66 |
+
<div id="web1-container" class="webview-container flex-1 bg-white rounded-lg shadow-lg overflow-hidden relative">
|
67 |
+
<div class="iframe-container">
|
68 |
+
<div class="control-bar">
|
69 |
+
<button onclick="toggleFullscreen('web1')" class="bg-blue-500 hover:bg-blue-600 text-white px-3 py-1 rounded">
|
70 |
+
<i class="fas fa-expand"></i>
|
71 |
+
</button>
|
72 |
+
<input type="text" id="web1-url" class="url-input" value="https://www.wikipedia.org" placeholder="Enter URL">
|
73 |
+
<button onclick="loadUrl('web1')" class="bg-green-500 hover:bg-green-600 text-white px-3 py-1 rounded">
|
74 |
+
<i class="fas fa-arrow-right"></i>
|
75 |
+
</button>
|
76 |
+
</div>
|
77 |
+
<iframe id="web1-frame" src="https://www.wikipedia.org"></iframe>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
|
81 |
+
<!-- Web 2 Container -->
|
82 |
+
<div id="web2-container" class="webview-container flex-1 bg-white rounded-lg shadow-lg overflow-hidden relative">
|
83 |
+
<div class="iframe-container">
|
84 |
+
<div class="control-bar">
|
85 |
+
<button onclick="toggleFullscreen('web2')" class="bg-blue-500 hover:bg-blue-600 text-white px-3 py-1 rounded">
|
86 |
+
<i class="fas fa-expand"></i>
|
87 |
+
</button>
|
88 |
+
<input type="text" id="web2-url" class="url-input" value="https://www.github.com" placeholder="Enter URL">
|
89 |
+
<button onclick="loadUrl('web2')" class="bg-green-500 hover:bg-green-600 text-white px-3 py-1 rounded">
|
90 |
+
<i class="fas fa-arrow-right"></i>
|
91 |
+
</button>
|
92 |
+
</div>
|
93 |
+
<iframe id="web2-frame" src="https://www.github.com"></iframe>
|
94 |
+
</div>
|
95 |
+
</div>
|
96 |
+
</div>
|
97 |
+
</div>
|
98 |
+
|
99 |
+
<script>
|
100 |
+
let fullscreenWeb = null;
|
101 |
+
|
102 |
+
function toggleFullscreen(webId) {
|
103 |
+
const container = document.getElementById(`${webId}-container`);
|
104 |
+
const otherWebId = webId === 'web1' ? 'web2' : 'web1';
|
105 |
+
const otherContainer = document.getElementById(`${otherWebId}-container`);
|
106 |
+
|
107 |
+
if (fullscreenWeb === webId) {
|
108 |
+
// Exit fullscreen
|
109 |
+
container.classList.remove('webview-focused');
|
110 |
+
otherContainer.classList.remove('webview-minimized');
|
111 |
+
fullscreenWeb = null;
|
112 |
+
} else {
|
113 |
+
// Enter fullscreen
|
114 |
+
container.classList.add('webview-focused');
|
115 |
+
otherContainer.classList.add('webview-minimized');
|
116 |
+
fullscreenWeb = webId;
|
117 |
+
}
|
118 |
+
}
|
119 |
+
|
120 |
+
function loadUrl(webId) {
|
121 |
+
const urlInput = document.getElementById(`${webId}-url`);
|
122 |
+
const frame = document.getElementById(`${webId}-frame`);
|
123 |
+
let url = urlInput.value.trim();
|
124 |
+
|
125 |
+
// Add https:// if not present
|
126 |
+
if (!url.startsWith('http://') && !url.startsWith('https://')) {
|
127 |
+
url = 'https://' + url;
|
128 |
+
urlInput.value = url;
|
129 |
+
}
|
130 |
+
|
131 |
+
frame.src = url;
|
132 |
+
}
|
133 |
+
|
134 |
+
// Handle URL input on Enter key
|
135 |
+
document.getElementById('web1-url').addEventListener('keypress', function(e) {
|
136 |
+
if (e.key === 'Enter') loadUrl('web1');
|
137 |
+
});
|
138 |
+
|
139 |
+
document.getElementById('web2-url').addEventListener('keypress', function(e) {
|
140 |
+
if (e.key === 'Enter') loadUrl('web2');
|
141 |
+
});
|
142 |
+
|
143 |
+
//
|
144 |
+
</html>
|