Spaces:
Running
Running
Creat a 3d web browser explorer for web pages than can enhance web pages when click at . The idea is to make pages more enhanced, larger n viewable - Initial Deployment
Browse files- README.md +7 -5
- index.html +322 -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: webpage360
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: pink
|
| 5 |
+
colorTo: gray
|
| 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,322 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>3D Web Explorer</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 |
+
.scene {
|
| 11 |
+
perspective: 1000px;
|
| 12 |
+
width: 100%;
|
| 13 |
+
height: 100vh;
|
| 14 |
+
overflow: hidden;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
.carousel {
|
| 18 |
+
width: 100%;
|
| 19 |
+
height: 100%;
|
| 20 |
+
position: relative;
|
| 21 |
+
transform-style: preserve-3d;
|
| 22 |
+
transition: transform 1s;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
.card {
|
| 26 |
+
position: absolute;
|
| 27 |
+
width: 300px;
|
| 28 |
+
height: 400px;
|
| 29 |
+
left: 50%;
|
| 30 |
+
top: 50%;
|
| 31 |
+
transform-origin: center center;
|
| 32 |
+
border-radius: 15px;
|
| 33 |
+
overflow: hidden;
|
| 34 |
+
box-shadow: 0 20px 40px rgba(0,0,0,0.3);
|
| 35 |
+
transition: all 0.5s ease;
|
| 36 |
+
cursor: pointer;
|
| 37 |
+
background: white;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
.card:hover {
|
| 41 |
+
transform: scale(1.05) !important;
|
| 42 |
+
box-shadow: 0 25px 50px rgba(0,0,0,0.4);
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
.card iframe {
|
| 46 |
+
width: 100%;
|
| 47 |
+
height: 80%;
|
| 48 |
+
border: none;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
.card-info {
|
| 52 |
+
padding: 15px;
|
| 53 |
+
height: 20%;
|
| 54 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 55 |
+
color: white;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.enhanced-view {
|
| 59 |
+
position: fixed;
|
| 60 |
+
top: 0;
|
| 61 |
+
left: 0;
|
| 62 |
+
width: 100%;
|
| 63 |
+
height: 100%;
|
| 64 |
+
background: rgba(0,0,0,0.9);
|
| 65 |
+
z-index: 100;
|
| 66 |
+
display: none;
|
| 67 |
+
justify-content: center;
|
| 68 |
+
align-items: center;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
.enhanced-content {
|
| 72 |
+
width: 90%;
|
| 73 |
+
height: 90%;
|
| 74 |
+
background: white;
|
| 75 |
+
border-radius: 10px;
|
| 76 |
+
overflow: hidden;
|
| 77 |
+
position: relative;
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
.enhanced-content iframe {
|
| 81 |
+
width: 100%;
|
| 82 |
+
height: 100%;
|
| 83 |
+
border: none;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
.close-btn {
|
| 87 |
+
position: absolute;
|
| 88 |
+
top: 10px;
|
| 89 |
+
right: 10px;
|
| 90 |
+
background: #ff4757;
|
| 91 |
+
color: white;
|
| 92 |
+
border: none;
|
| 93 |
+
width: 40px;
|
| 94 |
+
height: 40px;
|
| 95 |
+
border-radius: 50%;
|
| 96 |
+
font-size: 20px;
|
| 97 |
+
cursor: pointer;
|
| 98 |
+
z-index: 101;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
.enhance-effects {
|
| 102 |
+
position: absolute;
|
| 103 |
+
bottom: 20px;
|
| 104 |
+
left: 50%;
|
| 105 |
+
transform: translateX(-50%);
|
| 106 |
+
display: flex;
|
| 107 |
+
gap: 10px;
|
| 108 |
+
z-index: 101;
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
.effect-btn {
|
| 112 |
+
background: #4a69bd;
|
| 113 |
+
color: white;
|
| 114 |
+
border: none;
|
| 115 |
+
padding: 8px 15px;
|
| 116 |
+
border-radius: 20px;
|
| 117 |
+
cursor: pointer;
|
| 118 |
+
font-weight: bold;
|
| 119 |
+
transition: all 0.3s;
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
.effect-btn:hover {
|
| 123 |
+
background: #1e3799;
|
| 124 |
+
transform: translateY(-3px);
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
@media (max-width: 768px) {
|
| 128 |
+
.card {
|
| 129 |
+
width: 250px;
|
| 130 |
+
height: 350px;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
.enhance-effects {
|
| 134 |
+
flex-wrap: wrap;
|
| 135 |
+
justify-content: center;
|
| 136 |
+
width: 90%;
|
| 137 |
+
}
|
| 138 |
+
}
|
| 139 |
+
</style>
|
| 140 |
+
</head>
|
| 141 |
+
<body class="bg-gray-100">
|
| 142 |
+
<div class="scene">
|
| 143 |
+
<div class="carousel" id="carousel">
|
| 144 |
+
<!-- Cards will be added dynamically -->
|
| 145 |
+
</div>
|
| 146 |
+
</div>
|
| 147 |
+
|
| 148 |
+
<div class="enhanced-view" id="enhancedView">
|
| 149 |
+
<div class="enhanced-content">
|
| 150 |
+
<button class="close-btn" id="closeBtn"><i class="fas fa-times"></i></button>
|
| 151 |
+
<iframe id="enhancedFrame" src=""></iframe>
|
| 152 |
+
<div class="enhance-effects">
|
| 153 |
+
<button class="effect-btn" data-effect="zoom"><i class="fas fa-search-plus"></i> Zoom</button>
|
| 154 |
+
<button class="effect-btn" data-effect="contrast"><i class="fas fa-adjust"></i> Contrast</button>
|
| 155 |
+
<button class="effect-btn" data-effect="readable"><i class="fas fa-book-open"></i> Readable</button>
|
| 156 |
+
<button class="effect-btn" data-effect="dark"><i class="fas fa-moon"></i> Dark Mode</button>
|
| 157 |
+
</div>
|
| 158 |
+
</div>
|
| 159 |
+
</div>
|
| 160 |
+
|
| 161 |
+
<script>
|
| 162 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 163 |
+
// Sample websites to display
|
| 164 |
+
const websites = [
|
| 165 |
+
{
|
| 166 |
+
title: "Tech News",
|
| 167 |
+
url: "https://techcrunch.com",
|
| 168 |
+
color: "bg-blue-500"
|
| 169 |
+
},
|
| 170 |
+
{
|
| 171 |
+
title: "Science Daily",
|
| 172 |
+
url: "https://www.sciencedaily.com",
|
| 173 |
+
color: "bg-green-500"
|
| 174 |
+
},
|
| 175 |
+
{
|
| 176 |
+
title: "Design Inspiration",
|
| 177 |
+
url: "https://dribbble.com",
|
| 178 |
+
color: "bg-pink-500"
|
| 179 |
+
},
|
| 180 |
+
{
|
| 181 |
+
title: "Programming",
|
| 182 |
+
url: "https://stackoverflow.com",
|
| 183 |
+
color: "bg-orange-500"
|
| 184 |
+
},
|
| 185 |
+
{
|
| 186 |
+
title: "Space Exploration",
|
| 187 |
+
url: "https://www.nasa.gov",
|
| 188 |
+
color: "bg-indigo-500"
|
| 189 |
+
}
|
| 190 |
+
];
|
| 191 |
+
|
| 192 |
+
const carousel = document.getElementById('carousel');
|
| 193 |
+
const enhancedView = document.getElementById('enhancedView');
|
| 194 |
+
const enhancedFrame = document.getElementById('enhancedFrame');
|
| 195 |
+
const closeBtn = document.getElementById('closeBtn');
|
| 196 |
+
|
| 197 |
+
// Create cards for each website
|
| 198 |
+
websites.forEach((site, index) => {
|
| 199 |
+
const card = document.createElement('div');
|
| 200 |
+
card.className = 'card';
|
| 201 |
+
card.innerHTML = `
|
| 202 |
+
<iframe src="${site.url}" loading="lazy"></iframe>
|
| 203 |
+
<div class="card-info ${site.color} flex flex-col justify-center items-center">
|
| 204 |
+
<h3 class="text-xl font-bold">${site.title}</h3>
|
| 205 |
+
<p class="text-sm opacity-80">Click to enhance</p>
|
| 206 |
+
</div>
|
| 207 |
+
`;
|
| 208 |
+
|
| 209 |
+
// Position cards in 3D space
|
| 210 |
+
const angle = (index / websites.length) * Math.PI * 2;
|
| 211 |
+
const radius = websites.length * 30;
|
| 212 |
+
|
| 213 |
+
const x = Math.cos(angle) * radius;
|
| 214 |
+
const z = Math.sin(angle) * radius;
|
| 215 |
+
|
| 216 |
+
card.style.transform = `translate(-50%, -50%) translateZ(${z}px) translateX(${x}px) rotateY(${angle}rad)`;
|
| 217 |
+
|
| 218 |
+
// Add click event to enhance the page
|
| 219 |
+
card.addEventListener('click', () => {
|
| 220 |
+
enhancePage(site.url);
|
| 221 |
+
});
|
| 222 |
+
|
| 223 |
+
carousel.appendChild(card);
|
| 224 |
+
});
|
| 225 |
+
|
| 226 |
+
// Rotate carousel continuously
|
| 227 |
+
let angle = 0;
|
| 228 |
+
setInterval(() => {
|
| 229 |
+
angle += 0.002;
|
| 230 |
+
carousel.style.transform = `rotateY(${angle}rad)`;
|
| 231 |
+
}, 16);
|
| 232 |
+
|
| 233 |
+
// Enhance page function
|
| 234 |
+
function enhancePage(url) {
|
| 235 |
+
enhancedFrame.src = url;
|
| 236 |
+
enhancedView.style.display = 'flex';
|
| 237 |
+
document.body.style.overflow = 'hidden';
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
// Close enhanced view
|
| 241 |
+
closeBtn.addEventListener('click', () => {
|
| 242 |
+
enhancedView.style.display = 'none';
|
| 243 |
+
document.body.style.overflow = 'auto';
|
| 244 |
+
enhancedFrame.src = '';
|
| 245 |
+
});
|
| 246 |
+
|
| 247 |
+
// Enhancement effects
|
| 248 |
+
const effectButtons = document.querySelectorAll('.effect-btn');
|
| 249 |
+
effectButtons.forEach(button => {
|
| 250 |
+
button.addEventListener('click', function() {
|
| 251 |
+
const effect = this.getAttribute('data-effect');
|
| 252 |
+
applyEffect(effect);
|
| 253 |
+
});
|
| 254 |
+
});
|
| 255 |
+
|
| 256 |
+
function applyEffect(effect) {
|
| 257 |
+
const iframeDoc = enhancedFrame.contentDocument || enhancedFrame.contentWindow.document;
|
| 258 |
+
|
| 259 |
+
try {
|
| 260 |
+
// Create a style element if it doesn't exist
|
| 261 |
+
let style = iframeDoc.getElementById('enhancement-style');
|
| 262 |
+
if (!style) {
|
| 263 |
+
style = iframeDoc.createElement('style');
|
| 264 |
+
style.id = 'enhancement-style';
|
| 265 |
+
iframeDoc.head.appendChild(style);
|
| 266 |
+
}
|
| 267 |
+
|
| 268 |
+
switch(effect) {
|
| 269 |
+
case 'zoom':
|
| 270 |
+
style.innerHTML = `
|
| 271 |
+
body {
|
| 272 |
+
zoom: 1.5;
|
| 273 |
+
}
|
| 274 |
+
img, video {
|
| 275 |
+
max-width: 100% !important;
|
| 276 |
+
height: auto !important;
|
| 277 |
+
}
|
| 278 |
+
`;
|
| 279 |
+
break;
|
| 280 |
+
case 'contrast':
|
| 281 |
+
style.innerHTML = `
|
| 282 |
+
body {
|
| 283 |
+
filter: contrast(1.2) brightness(1.1);
|
| 284 |
+
}
|
| 285 |
+
`;
|
| 286 |
+
break;
|
| 287 |
+
case 'readable':
|
| 288 |
+
style.innerHTML = `
|
| 289 |
+
body {
|
| 290 |
+
font-size: 18px !important;
|
| 291 |
+
line-height: 1.6 !important;
|
| 292 |
+
max-width: 800px !important;
|
| 293 |
+
margin: 0 auto !important;
|
| 294 |
+
padding: 20px !important;
|
| 295 |
+
}
|
| 296 |
+
p, li {
|
| 297 |
+
margin-bottom: 1em !important;
|
| 298 |
+
}
|
| 299 |
+
`;
|
| 300 |
+
break;
|
| 301 |
+
case 'dark':
|
| 302 |
+
style.innerHTML = `
|
| 303 |
+
body {
|
| 304 |
+
background-color: #222 !important;
|
| 305 |
+
color: #eee !important;
|
| 306 |
+
filter: invert(1) hue-rotate(180deg);
|
| 307 |
+
}
|
| 308 |
+
img, video {
|
| 309 |
+
filter: invert(1) hue-rotate(180deg) !important;
|
| 310 |
+
}
|
| 311 |
+
`;
|
| 312 |
+
break;
|
| 313 |
+
}
|
| 314 |
+
} catch (e) {
|
| 315 |
+
console.log("Could not apply effect due to cross-origin restrictions");
|
| 316 |
+
// In a real implementation, you would need a proxy server to bypass CORS
|
| 317 |
+
}
|
| 318 |
+
}
|
| 319 |
+
});
|
| 320 |
+
</script>
|
| 321 |
+
<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/webpage360" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 322 |
+
</html>
|