Mackin7 commited on
Commit
9c57894
·
verified ·
1 Parent(s): 0e889a8

Creat a page enhancer tools for web browers that can enlarge web pages into 360.the idea is to make web pages more viewable and larger when click - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +6 -4
  2. index.html +350 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
  title: 360pluginenhancer
3
- emoji:
4
- colorFrom: green
5
- colorTo: indigo
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: 360pluginenhancer
3
+ emoji: 🐳
4
+ colorFrom: yellow
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,350 @@
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>360° Page Enhancer</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
+ /* Custom CSS for the 360 effect */
11
+ .page-container {
12
+ transition: all 0.3s ease;
13
+ transform-origin: center center;
14
+ }
15
+
16
+ .enhanced-view {
17
+ transform: scale(1.5);
18
+ overflow-x: auto;
19
+ width: 150%;
20
+ margin-left: -25%;
21
+ background-color: white;
22
+ box-shadow: 0 0 20px rgba(0,0,0,0.2);
23
+ min-height: 100vh;
24
+ }
25
+
26
+ .toolbar {
27
+ position: fixed;
28
+ bottom: 20px;
29
+ right: 20px;
30
+ z-index: 9999;
31
+ transition: all 0.3s ease;
32
+ }
33
+
34
+ .toolbar-expanded {
35
+ width: 300px;
36
+ background: rgba(255,255,255,0.95);
37
+ border-radius: 15px;
38
+ box-shadow: 0 5px 15px rgba(0,0,0,0.2);
39
+ padding: 15px;
40
+ }
41
+
42
+ .pan-indicator {
43
+ position: fixed;
44
+ top: 10px;
45
+ right: 10px;
46
+ background: rgba(0,0,0,0.7);
47
+ color: white;
48
+ padding: 5px 10px;
49
+ border-radius: 20px;
50
+ font-size: 12px;
51
+ z-index: 9999;
52
+ display: none;
53
+ }
54
+
55
+ @media (max-width: 768px) {
56
+ .enhanced-view {
57
+ transform: scale(1.3);
58
+ width: 130%;
59
+ margin-left: -15%;
60
+ }
61
+
62
+ .toolbar {
63
+ bottom: 10px;
64
+ right: 10px;
65
+ }
66
+
67
+ .toolbar-expanded {
68
+ width: 280px;
69
+ }
70
+ }
71
+ </style>
72
+ </head>
73
+ <body>
74
+ <!-- Main page container that will be enhanced -->
75
+ <div id="pageContainer" class="page-container">
76
+ <!-- This would be the existing webpage content -->
77
+ <div class="p-8">
78
+ <h1 class="text-4xl font-bold mb-6">Sample Web Page</h1>
79
+ <p class="text-lg mb-4">This is a demonstration of how the 360° Page Enhancer would work on a typical webpage. When you click the enhance button, this content will expand to be more viewable.</p>
80
+
81
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6 my-8">
82
+ <div class="bg-blue-100 p-6 rounded-lg">
83
+ <h2 class="text-xl font-semibold mb-3">Feature 1</h2>
84
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris.</p>
85
+ </div>
86
+ <div class="bg-green-100 p-6 rounded-lg">
87
+ <h2 class="text-xl font-semibold mb-3">Feature 2</h2>
88
+ <p>Vivamus suscipit tortor eget felis porttitor volutpat. Curabitur non nulla sit amet nisl.</p>
89
+ </div>
90
+ <div class="bg-purple-100 p-6 rounded-lg">
91
+ <h2 class="text-xl font-semibold mb-3">Feature 3</h2>
92
+ <p>Pellentesque in ipsum id orci porta dapibus. Proin eget tortor risus.</p>
93
+ </div>
94
+ </div>
95
+
96
+ <div class="mt-10">
97
+ <img src="https://via.placeholder.com/1200x500" alt="Sample image" class="w-full rounded-lg shadow-md mb-6">
98
+ <p class="text-gray-700">This image and the surrounding content will become larger and more readable when the 360° enhancement is activated.</p>
99
+ </div>
100
+ </div>
101
+ </div>
102
+
103
+ <!-- Pan indicator (shown during enhanced view) -->
104
+ <div id="panIndicator" class="pan-indicator">
105
+ <i class="fas fa-arrows-alt mr-2"></i> Pan Mode Active
106
+ </div>
107
+
108
+ <!-- Enhancement toolbar -->
109
+ <div id="enhancerToolbar" class="toolbar">
110
+ <div id="toolbarContent" class="hidden">
111
+ <div class="flex justify-between items-center mb-4">
112
+ <h3 class="text-lg font-semibold">360° Page Enhancer</h3>
113
+ <button id="closeToolbar" class="text-gray-500 hover:text-gray-700">
114
+ <i class="fas fa-times"></i>
115
+ </button>
116
+ </div>
117
+
118
+ <div class="mb-4">
119
+ <label class="block text-sm font-medium text-gray-700 mb-1">Zoom Level</label>
120
+ <div class="flex items-center">
121
+ <button id="zoomOut" class="bg-gray-200 hover:bg-gray-300 p-2 rounded-l">
122
+ <i class="fas fa-search-minus"></i>
123
+ </button>
124
+ <div class="bg-gray-100 px-4 py-2 text-center w-full">
125
+ <span id="zoomLevel">100%</span>
126
+ </div>
127
+ <button id="zoomIn" class="bg-gray-200 hover:bg-gray-300 p-2 rounded-r">
128
+ <i class="fas fa-search-plus"></i>
129
+ </button>
130
+ </div>
131
+ </div>
132
+
133
+ <div class="flex space-x-2 mb-4">
134
+ <button id="panMode" class="flex-1 bg-blue-100 hover:bg-blue-200 text-blue-800 py-2 px-4 rounded flex items-center justify-center">
135
+ <i class="fas fa-arrows-alt mr-2"></i> Pan Mode
136
+ </button>
137
+ <button id="resetView" class="flex-1 bg-gray-100 hover:bg-gray-200 text-gray-800 py-2 px-4 rounded flex items-center justify-center">
138
+ <i class="fas fa-sync-alt mr-2"></i> Reset
139
+ </button>
140
+ </div>
141
+
142
+ <div class="text-xs text-gray-500">
143
+ <p>Tip: Use mouse wheel to zoom in/out when in pan mode.</p>
144
+ </div>
145
+ </div>
146
+
147
+ <button id="enhanceButton" class="bg-blue-600 hover:bg-blue-700 text-white rounded-full w-14 h-14 flex items-center justify-center shadow-lg">
148
+ <i class="fas fa-expand text-xl"></i>
149
+ </button>
150
+ </div>
151
+
152
+ <script>
153
+ document.addEventListener('DOMContentLoaded', function() {
154
+ const pageContainer = document.getElementById('pageContainer');
155
+ const enhancerToolbar = document.getElementById('enhancerToolbar');
156
+ const toolbarContent = document.getElementById('toolbarContent');
157
+ const enhanceButton = document.getElementById('enhanceButton');
158
+ const closeToolbar = document.getElementById('closeToolbar');
159
+ const zoomIn = document.getElementById('zoomIn');
160
+ const zoomOut = document.getElementById('zoomOut');
161
+ const zoomLevel = document.getElementById('zoomLevel');
162
+ const panMode = document.getElementById('panMode');
163
+ const resetView = document.getElementById('resetView');
164
+ const panIndicator = document.getElementById('panIndicator');
165
+
166
+ let isEnhanced = false;
167
+ let isPanMode = false;
168
+ let currentZoom = 1;
169
+ let startX, startY, scrollLeft, scrollTop;
170
+
171
+ // Toggle enhanced view
172
+ enhanceButton.addEventListener('click', function() {
173
+ isEnhanced = !isEnhanced;
174
+
175
+ if (isEnhanced) {
176
+ pageContainer.classList.add('enhanced-view');
177
+ toolbarContent.classList.remove('hidden');
178
+ enhancerToolbar.classList.add('toolbar-expanded');
179
+ enhanceButton.innerHTML = '<i class="fas fa-compress text-xl"></i>';
180
+
181
+ // Store original scroll position
182
+ scrollLeft = window.pageXOffset;
183
+ scrollTop = window.pageYOffset;
184
+
185
+ // Center the view
186
+ window.scrollTo(
187
+ (document.documentElement.scrollWidth - window.innerWidth) / 2,
188
+ (document.documentElement.scrollHeight - window.innerHeight) / 2
189
+ );
190
+ } else {
191
+ pageContainer.classList.remove('enhanced-view');
192
+ toolbarContent.classList.add('hidden');
193
+ enhancerToolbar.classList.remove('toolbar-expanded');
194
+ enhanceButton.innerHTML = '<i class="fas fa-expand text-xl"></i>';
195
+ disablePanMode();
196
+
197
+ // Restore original scroll position
198
+ window.scrollTo(scrollLeft, scrollTop);
199
+ }
200
+ });
201
+
202
+ // Close toolbar
203
+ closeToolbar.addEventListener('click', function() {
204
+ isEnhanced = false;
205
+ pageContainer.classList.remove('enhanced-view');
206
+ toolbarContent.classList.add('hidden');
207
+ enhancerToolbar.classList.remove('toolbar-expanded');
208
+ enhanceButton.innerHTML = '<i class="fas fa-expand text-xl"></i>';
209
+ disablePanMode();
210
+
211
+ // Restore original scroll position
212
+ window.scrollTo(scrollLeft, scrollTop);
213
+ });
214
+
215
+ // Zoom in
216
+ zoomIn.addEventListener('click', function() {
217
+ if (currentZoom < 3) {
218
+ currentZoom += 0.1;
219
+ updateZoom();
220
+ }
221
+ });
222
+
223
+ // Zoom out
224
+ zoomOut.addEventListener('click', function() {
225
+ if (currentZoom > 0.5) {
226
+ currentZoom -= 0.1;
227
+ updateZoom();
228
+ }
229
+ });
230
+
231
+ // Update zoom level
232
+ function updateZoom() {
233
+ pageContainer.style.transform = `scale(${currentZoom * 1.5})`;
234
+ zoomLevel.textContent = `${Math.round(currentZoom * 100)}%`;
235
+ }
236
+
237
+ // Toggle pan mode
238
+ panMode.addEventListener('click', function() {
239
+ isPanMode = !isPanMode;
240
+
241
+ if (isPanMode) {
242
+ enablePanMode();
243
+ } else {
244
+ disablePanMode();
245
+ }
246
+ });
247
+
248
+ // Enable pan mode
249
+ function enablePanMode() {
250
+ panMode.classList.add('bg-blue-500', 'text-white');
251
+ panMode.classList.remove('bg-blue-100', 'text-blue-800');
252
+ panIndicator.style.display = 'block';
253
+
254
+ // Make page container draggable
255
+ pageContainer.style.cursor = 'grab';
256
+ pageContainer.addEventListener('mousedown', startDrag);
257
+ document.addEventListener('mouseup', stopDrag);
258
+ document.addEventListener('mousemove', drag);
259
+
260
+ // Add wheel event for zooming during pan mode
261
+ pageContainer.addEventListener('wheel', handleWheel, { passive: false });
262
+ }
263
+
264
+ // Disable pan mode
265
+ function disablePanMode() {
266
+ isPanMode = false;
267
+ panMode.classList.remove('bg-blue-500', 'text-white');
268
+ panMode.classList.add('bg-blue-100', 'text-blue-800');
269
+ panIndicator.style.display = 'none';
270
+
271
+ // Remove draggable behavior
272
+ pageContainer.style.cursor = '';
273
+ pageContainer.removeEventListener('mousedown', startDrag);
274
+ document.removeEventListener('mouseup', stopDrag);
275
+ document.removeEventListener('mousemove', drag);
276
+ pageContainer.removeEventListener('wheel', handleWheel);
277
+ }
278
+
279
+ // Start drag
280
+ function startDrag(e) {
281
+ startX = e.pageX - pageContainer.offsetLeft;
282
+ startY = e.pageY - pageContainer.offsetTop;
283
+ pageContainer.style.cursor = 'grabbing';
284
+ }
285
+
286
+ // Stop drag
287
+ function stopDrag() {
288
+ pageContainer.style.cursor = 'grab';
289
+ }
290
+
291
+ // Drag movement
292
+ function drag(e) {
293
+ if (!isPanMode) return;
294
+ e.preventDefault();
295
+
296
+ const x = e.pageX - startX;
297
+ const y = e.pageY - startY;
298
+
299
+ // Calculate boundaries to prevent dragging too far
300
+ const maxX = (pageContainer.scrollWidth - window.innerWidth) / 2;
301
+ const maxY = (pageContainer.scrollHeight - window.innerHeight) / 2;
302
+
303
+ // Apply boundaries
304
+ const boundedX = Math.max(-maxX, Math.min(x, maxX));
305
+ const boundedY = Math.max(-maxY, Math.min(y, maxY));
306
+
307
+ pageContainer.style.left = `${boundedX}px`;
308
+ pageContainer.style.top = `${boundedY}px`;
309
+ }
310
+
311
+ // Handle wheel zoom
312
+ function handleWheel(e) {
313
+ if (!isPanMode) return;
314
+ e.preventDefault();
315
+
316
+ if (e.deltaY < 0) {
317
+ // Zoom in
318
+ if (currentZoom < 3) {
319
+ currentZoom += 0.05;
320
+ updateZoom();
321
+ }
322
+ } else {
323
+ // Zoom out
324
+ if (currentZoom > 0.5) {
325
+ currentZoom -= 0.05;
326
+ updateZoom();
327
+ }
328
+ }
329
+ }
330
+
331
+ // Reset view
332
+ resetView.addEventListener('click', function() {
333
+ currentZoom = 1;
334
+ updateZoom();
335
+ disablePanMode();
336
+
337
+ // Reset position
338
+ pageContainer.style.left = '0';
339
+ pageContainer.style.top = '0';
340
+
341
+ // Center the view
342
+ window.scrollTo(
343
+ (document.documentElement.scrollWidth - window.innerWidth) / 2,
344
+ (document.documentElement.scrollHeight - window.innerHeight) / 2
345
+ );
346
+ });
347
+ });
348
+ </script>
349
+ <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=Mackin7/360pluginenhancer" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
350
+ </html>