Ffury commited on
Commit
a50ea87
·
verified ·
1 Parent(s): b7cb784

undefined - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +6 -4
  2. index.html +246 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Ar Project
3
- emoji: 🏃
4
  colorFrom: yellow
5
- colorTo: green
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: ar-project
3
+ emoji: 🐳
4
  colorFrom: yellow
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,246 @@
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>AR Model Viewer</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <script type="module" src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"></script>
9
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
10
+ <style>
11
+ @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
12
+
13
+ body {
14
+ font-family: 'Poppins', sans-serif;
15
+ background: linear-gradient(135deg, #1a2a6c, #b21f1f, #1a2a6c);
16
+ min-height: 100vh;
17
+ overflow-x: hidden;
18
+ }
19
+
20
+ .card {
21
+ backdrop-filter: blur(10px);
22
+ background: rgba(255, 255, 255, 0.1);
23
+ border-radius: 20px;
24
+ box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
25
+ border: 1px solid rgba(255, 255, 255, 0.1);
26
+ }
27
+
28
+ .glow {
29
+ text-shadow: 0 0 10px rgba(255, 255, 255, 0.8),
30
+ 0 0 20px rgba(255, 255, 255, 0.6),
31
+ 0 0 30px rgba(255, 255, 255, 0.4);
32
+ }
33
+
34
+ .pulse {
35
+ animation: pulse 2s infinite;
36
+ }
37
+
38
+ @keyframes pulse {
39
+ 0% {
40
+ transform: scale(1);
41
+ box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
42
+ }
43
+ 70% {
44
+ transform: scale(1.05);
45
+ box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
46
+ }
47
+ 100% {
48
+ transform: scale(1);
49
+ box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
50
+ }
51
+ }
52
+
53
+ .floating {
54
+ animation: floating 3s ease-in-out infinite;
55
+ }
56
+
57
+ @keyframes floating {
58
+ 0% { transform: translateY(0px); }
59
+ 50% { transform: translateY(-10px); }
60
+ 100% { transform: translateY(0px); }
61
+ }
62
+
63
+ .model-container {
64
+ transition: all 0.3s ease;
65
+ border-radius: 16px;
66
+ overflow: hidden;
67
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
68
+ }
69
+
70
+ .model-container:hover {
71
+ transform: scale(1.02);
72
+ }
73
+
74
+ .feature-card {
75
+ transition: all 0.3s ease;
76
+ }
77
+
78
+ .feature-card:hover {
79
+ transform: translateY(-5px);
80
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
81
+ }
82
+
83
+ .ar-button {
84
+ transition: all 0.3s ease;
85
+ }
86
+
87
+ .ar-button:hover {
88
+ transform: scale(1.05);
89
+ }
90
+ </style>
91
+ </head>
92
+ <body class="text-white">
93
+ <div class="min-h-screen flex flex-col items-center py-8 px-4">
94
+ <!-- Header -->
95
+ <header class="w-full max-w-4xl text-center mb-8">
96
+ <h1 class="text-4xl md:text-5xl font-bold mb-4 glow">AR Model Viewer</h1>
97
+ <p class="text-xl opacity-90">Experience 3D models in augmented reality on your mobile device</p>
98
+ </header>
99
+
100
+ <!-- Main Content -->
101
+ <main class="w-full max-w-4xl flex flex-col md:flex-row gap-8 mb-12">
102
+ <!-- Model Viewer -->
103
+ <div class="flex-1">
104
+ <div class="card p-4 h-full">
105
+ <div class="model-container">
106
+ <model-viewer
107
+ id="model-viewer"
108
+ src="https://modelviewer.dev/shared-assets/models/Astronaut.glb"
109
+ alt="A 3D model of an astronaut"
110
+ ar
111
+ ar-modes="webxr scene-viewer quick-look"
112
+ environment-image="neutral"
113
+ shadow-intensity="1"
114
+ camera-controls
115
+ touch-action="pan-y"
116
+ auto-rotate
117
+ ar-scale="auto"
118
+ style="width: 100%; height: 500px;"
119
+ >
120
+ <!-- Loading spinner -->
121
+ <div slot="progress-bar" class="w-full h-12 flex justify-center items-center">
122
+ <div class="w-12 h-12 border-4 border-blue-500 border-t-transparent rounded-full animate-spin"></div>
123
+ </div>
124
+
125
+ <!-- AR Button -->
126
+ <button slot="ar-button" class="ar-button absolute bottom-4 left-1/2 transform -translate-x-1/2 bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-6 rounded-full flex items-center pulse">
127
+ <i class="fas fa-cube mr-2"></i> View in AR
128
+ </button>
129
+ </model-viewer>
130
+ </div>
131
+ </div>
132
+ </div>
133
+
134
+ <!-- Info Panel -->
135
+ <div class="flex-1">
136
+ <div class="card p-6 h-full flex flex-col">
137
+ <h2 class="text-2xl font-bold mb-4">Astronaut Model</h2>
138
+ <p class="mb-6 opacity-90">Explore this detailed astronaut model in augmented reality. Place it in your environment and interact with it.</p>
139
+
140
+ <div class="mb-6">
141
+ <h3 class="text-xl font-semibold mb-3">Features:</h3>
142
+ <ul class="space-y-3">
143
+ <li class="feature-card bg-blue-900/30 p-3 rounded-lg flex items-center">
144
+ <i class="fas fa-expand-arrows-alt text-blue-400 mr-3"></i>
145
+ Auto-scales to surfaces
146
+ </li>
147
+ <li class="feature-card bg-blue-900/30 p-3 rounded-lg flex items-center">
148
+ <i class="fas fa-mobile-alt text-blue-400 mr-3"></i>
149
+ Works on Android & iOS
150
+ </li>
151
+ <li class="feature-card bg-blue-900/30 p-3 rounded-lg flex items-center">
152
+ <i class="fas fa-sync-alt text-blue-400 mr-3"></i>
153
+ Auto-rotation
154
+ </li>
155
+ <li class="feature-card bg-blue-900/30 p-3 rounded-lg flex items-center">
156
+ <i class="fas fa-hand-pointer text-blue-400 mr-3"></i>
157
+ Interactive controls
158
+ </li>
159
+ </ul>
160
+ </div>
161
+
162
+ <div class="mt-auto">
163
+ <h3 class="text-xl font-semibold mb-3">How to use:</h3>
164
+ <ol class="list-decimal pl-5 space-y-2 opacity-90">
165
+ <li>Tap the "View in AR" button</li>
166
+ <li>Allow camera access when prompted</li>
167
+ <li>Point your camera at a flat surface</li>
168
+ <li>Tap to place the model</li>
169
+ </ol>
170
+ </div>
171
+ </div>
172
+ </div>
173
+ </main>
174
+
175
+ <!-- Device Compatibility -->
176
+ <div class="w-full max-w-4xl mb-12">
177
+ <div class="card p-6">
178
+ <h2 class="text-2xl font-bold mb-4 text-center">Device Compatibility</h2>
179
+ <div class="flex flex-col md:flex-row justify-around items-center gap-6">
180
+ <div class="text-center">
181
+ <div class="floating inline-block mb-3">
182
+ <i class="fab fa-android text-5xl text-green-400"></i>
183
+ </div>
184
+ <h3 class="text-xl font-semibold">Android</h3>
185
+ <p class="opacity-90">Requires ARCore support</p>
186
+ </div>
187
+ <div class="text-center">
188
+ <div class="floating inline-block mb-3">
189
+ <i class="fab fa-apple text-5xl text-gray-300"></i>
190
+ </div>
191
+ <h3 class="text-xl font-semibold">iOS</h3>
192
+ <p class="opacity-90">Requires ARKit support</p>
193
+ </div>
194
+ </div>
195
+ </div>
196
+ </div>
197
+
198
+ <!-- Footer -->
199
+ <footer class="w-full max-w-4xl text-center opacity-80 text-sm">
200
+ <p>Powered by Model Viewer & WebXR | Designed for ARCore and ARKit devices</p>
201
+ </footer>
202
+ </div>
203
+
204
+ <script>
205
+ // Check for WebXR support
206
+ function checkXRSupport() {
207
+ if (!navigator.xr) {
208
+ alert('WebXR not supported in your browser. Please try Chrome on Android or Safari on iOS.');
209
+ return false;
210
+ }
211
+ return true;
212
+ }
213
+
214
+ // Add event listener to AR button
215
+ document.addEventListener('DOMContentLoaded', () => {
216
+ const arButton = document.querySelector('button[slot="ar-button"]');
217
+ if (arButton) {
218
+ arButton.addEventListener('click', () => {
219
+ if (!checkXRSupport()) {
220
+ return;
221
+ }
222
+
223
+ // Show loading indicator
224
+ arButton.innerHTML = '<i class="fas fa-spinner animate-spin mr-2"></i> Launching AR...';
225
+
226
+ // Reset button after 3 seconds
227
+ setTimeout(() => {
228
+ arButton.innerHTML = '<i class="fas fa-cube mr-2"></i> View in AR';
229
+ }, 3000);
230
+ });
231
+ }
232
+
233
+ // Add animation to feature cards on hover
234
+ const featureCards = document.querySelectorAll('.feature-card');
235
+ featureCards.forEach(card => {
236
+ card.addEventListener('mouseenter', () => {
237
+ card.style.transform = 'translateY(-5px)';
238
+ });
239
+ card.addEventListener('mouseleave', () => {
240
+ card.style.transform = 'translateY(0)';
241
+ });
242
+ });
243
+ });
244
+ </script>
245
+ <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=Ffury/ar-project" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
246
+ </html>