Spaces:
Running
Running
Deploy from HuggingChat
Browse files- README.md +9 -5
- index.html +859 -18
README.md
CHANGED
|
@@ -1,10 +1,14 @@
|
|
| 1 |
---
|
| 2 |
-
title: Mobile Store Website
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: "Mobile Store Website"
|
| 3 |
+
emoji: π―
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: indigo
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- huggingchat
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Mobile Store Website
|
| 13 |
+
|
| 14 |
+
Built with [HuggingChat](https://huggingface.co/chat).
|
index.html
CHANGED
|
@@ -1,19 +1,860 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>PhoneVault - Premium Mobile Store</title>
|
| 7 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
| 8 |
+
<style>
|
| 9 |
+
:root {
|
| 10 |
+
--primary: #6366f1;
|
| 11 |
+
--primary-dark: #4f46e5;
|
| 12 |
+
--secondary: #0f172a;
|
| 13 |
+
--accent: #10b981;
|
| 14 |
+
--bg: #f8fafc;
|
| 15 |
+
--card: #ffffff;
|
| 16 |
+
--text: #1e293b;
|
| 17 |
+
--text-light: #64748b;
|
| 18 |
+
--border: #e2e8f0;
|
| 19 |
+
--shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
| 20 |
+
--shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
* {
|
| 24 |
+
margin: 0;
|
| 25 |
+
padding: 0;
|
| 26 |
+
box-sizing: border-box;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
body {
|
| 30 |
+
font-family: 'Inter', sans-serif;
|
| 31 |
+
background: var(--bg);
|
| 32 |
+
color: var(--text);
|
| 33 |
+
line-height: 1.6;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
/* Navigation */
|
| 37 |
+
nav {
|
| 38 |
+
background: var(--card);
|
| 39 |
+
border-bottom: 1px solid var(--border);
|
| 40 |
+
position: sticky;
|
| 41 |
+
top: 0;
|
| 42 |
+
z-index: 100;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
.nav-container {
|
| 46 |
+
max-width: 1200px;
|
| 47 |
+
margin: 0 auto;
|
| 48 |
+
padding: 1rem 2rem;
|
| 49 |
+
display: flex;
|
| 50 |
+
justify-content: space-between;
|
| 51 |
+
align-items: center;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
.logo {
|
| 55 |
+
font-size: 1.5rem;
|
| 56 |
+
font-weight: 700;
|
| 57 |
+
color: var(--primary);
|
| 58 |
+
text-decoration: none;
|
| 59 |
+
display: flex;
|
| 60 |
+
align-items: center;
|
| 61 |
+
gap: 0.5rem;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
.nav-links {
|
| 65 |
+
display: flex;
|
| 66 |
+
gap: 2rem;
|
| 67 |
+
list-style: none;
|
| 68 |
+
align-items: center;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
.nav-links a {
|
| 72 |
+
text-decoration: none;
|
| 73 |
+
color: var(--text);
|
| 74 |
+
font-weight: 500;
|
| 75 |
+
transition: color 0.2s;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
.nav-links a:hover {
|
| 79 |
+
color: var(--primary);
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
.cart-btn {
|
| 83 |
+
background: var(--primary);
|
| 84 |
+
color: white;
|
| 85 |
+
border: none;
|
| 86 |
+
padding: 0.5rem 1.25rem;
|
| 87 |
+
border-radius: 0.5rem;
|
| 88 |
+
cursor: pointer;
|
| 89 |
+
font-weight: 600;
|
| 90 |
+
display: flex;
|
| 91 |
+
align-items: center;
|
| 92 |
+
gap: 0.5rem;
|
| 93 |
+
transition: background 0.2s;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
.cart-btn:hover {
|
| 97 |
+
background: var(--primary-dark);
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
/* Hero Section */
|
| 101 |
+
.hero {
|
| 102 |
+
background: linear-gradient(135deg, var(--secondary) 0%, #1e293b 100%);
|
| 103 |
+
color: white;
|
| 104 |
+
padding: 5rem 2rem;
|
| 105 |
+
text-align: center;
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
.hero h1 {
|
| 109 |
+
font-size: 3rem;
|
| 110 |
+
font-weight: 700;
|
| 111 |
+
margin-bottom: 1rem;
|
| 112 |
+
letter-spacing: -0.025em;
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
.hero p {
|
| 116 |
+
font-size: 1.25rem;
|
| 117 |
+
color: #94a3b8;
|
| 118 |
+
max-width: 600px;
|
| 119 |
+
margin: 0 auto 2rem;
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
.hero-btns {
|
| 123 |
+
display: flex;
|
| 124 |
+
gap: 1rem;
|
| 125 |
+
justify-content: center;
|
| 126 |
+
flex-wrap: wrap;
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
.btn {
|
| 130 |
+
padding: 0.875rem 2rem;
|
| 131 |
+
border-radius: 0.5rem;
|
| 132 |
+
font-weight: 600;
|
| 133 |
+
text-decoration: none;
|
| 134 |
+
transition: all 0.2s;
|
| 135 |
+
cursor: pointer;
|
| 136 |
+
border: none;
|
| 137 |
+
font-size: 1rem;
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
.btn-primary {
|
| 141 |
+
background: var(--primary);
|
| 142 |
+
color: white;
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
.btn-primary:hover {
|
| 146 |
+
background: var(--primary-dark);
|
| 147 |
+
transform: translateY(-2px);
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
.btn-outline {
|
| 151 |
+
background: transparent;
|
| 152 |
+
color: white;
|
| 153 |
+
border: 2px solid rgba(255,255,255,0.3);
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
.btn-outline:hover {
|
| 157 |
+
background: rgba(255,255,255,0.1);
|
| 158 |
+
border-color: white;
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
/* Features */
|
| 162 |
+
.features {
|
| 163 |
+
display: grid;
|
| 164 |
+
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
| 165 |
+
gap: 2rem;
|
| 166 |
+
max-width: 1200px;
|
| 167 |
+
margin: -3rem auto 0;
|
| 168 |
+
padding: 0 2rem;
|
| 169 |
+
position: relative;
|
| 170 |
+
z-index: 2;
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
.feature-card {
|
| 174 |
+
background: var(--card);
|
| 175 |
+
padding: 2rem;
|
| 176 |
+
border-radius: 1rem;
|
| 177 |
+
box-shadow: var(--shadow-lg);
|
| 178 |
+
text-align: center;
|
| 179 |
+
transition: transform 0.2s;
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
.feature-card:hover {
|
| 183 |
+
transform: translateY(-5px);
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
.feature-icon {
|
| 187 |
+
width: 60px;
|
| 188 |
+
height: 60px;
|
| 189 |
+
background: var(--bg);
|
| 190 |
+
border-radius: 1rem;
|
| 191 |
+
display: flex;
|
| 192 |
+
align-items: center;
|
| 193 |
+
justify-content: center;
|
| 194 |
+
margin: 0 auto 1rem;
|
| 195 |
+
font-size: 1.5rem;
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
.feature-card h3 {
|
| 199 |
+
margin-bottom: 0.5rem;
|
| 200 |
+
font-size: 1.125rem;
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
.feature-card p {
|
| 204 |
+
color: var(--text-light);
|
| 205 |
+
font-size: 0.875rem;
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
/* Products */
|
| 209 |
+
.products-section {
|
| 210 |
+
max-width: 1200px;
|
| 211 |
+
margin: 4rem auto;
|
| 212 |
+
padding: 0 2rem;
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
.section-header {
|
| 216 |
+
display: flex;
|
| 217 |
+
justify-content: space-between;
|
| 218 |
+
align-items: center;
|
| 219 |
+
margin-bottom: 2rem;
|
| 220 |
+
flex-wrap: wrap;
|
| 221 |
+
gap: 1rem;
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
.section-header h2 {
|
| 225 |
+
font-size: 2rem;
|
| 226 |
+
font-weight: 700;
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
.filter-btns {
|
| 230 |
+
display: flex;
|
| 231 |
+
gap: 0.5rem;
|
| 232 |
+
flex-wrap: wrap;
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
.filter-btn {
|
| 236 |
+
padding: 0.5rem 1rem;
|
| 237 |
+
border: 1px solid var(--border);
|
| 238 |
+
background: var(--card);
|
| 239 |
+
border-radius: 0.5rem;
|
| 240 |
+
cursor: pointer;
|
| 241 |
+
font-weight: 500;
|
| 242 |
+
transition: all 0.2s;
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
.filter-btn.active, .filter-btn:hover {
|
| 246 |
+
background: var(--primary);
|
| 247 |
+
color: white;
|
| 248 |
+
border-color: var(--primary);
|
| 249 |
+
}
|
| 250 |
+
|
| 251 |
+
.products-grid {
|
| 252 |
+
display: grid;
|
| 253 |
+
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
| 254 |
+
gap: 2rem;
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
.product-card {
|
| 258 |
+
background: var(--card);
|
| 259 |
+
border-radius: 1rem;
|
| 260 |
+
overflow: hidden;
|
| 261 |
+
box-shadow: var(--shadow);
|
| 262 |
+
transition: transform 0.2s, box-shadow 0.2s;
|
| 263 |
+
border: 1px solid var(--border);
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
.product-card:hover {
|
| 267 |
+
transform: translateY(-5px);
|
| 268 |
+
box-shadow: var(--shadow-lg);
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
.product-img {
|
| 272 |
+
height: 220px;
|
| 273 |
+
background: var(--bg);
|
| 274 |
+
display: flex;
|
| 275 |
+
align-items: center;
|
| 276 |
+
justify-content: center;
|
| 277 |
+
font-size: 4rem;
|
| 278 |
+
position: relative;
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
.badge {
|
| 282 |
+
position: absolute;
|
| 283 |
+
top: 1rem;
|
| 284 |
+
left: 1rem;
|
| 285 |
+
background: var(--accent);
|
| 286 |
+
color: white;
|
| 287 |
+
padding: 0.25rem 0.75rem;
|
| 288 |
+
border-radius: 0.25rem;
|
| 289 |
+
font-size: 0.75rem;
|
| 290 |
+
font-weight: 600;
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
.badge-sale {
|
| 294 |
+
background: #ef4444;
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
.product-info {
|
| 298 |
+
padding: 1.5rem;
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
.product-brand {
|
| 302 |
+
color: var(--primary);
|
| 303 |
+
font-size: 0.875rem;
|
| 304 |
+
font-weight: 600;
|
| 305 |
+
text-transform: uppercase;
|
| 306 |
+
letter-spacing: 0.05em;
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
.product-name {
|
| 310 |
+
font-size: 1.125rem;
|
| 311 |
+
font-weight: 600;
|
| 312 |
+
margin: 0.25rem 0 0.5rem;
|
| 313 |
+
}
|
| 314 |
+
|
| 315 |
+
.product-specs {
|
| 316 |
+
display: flex;
|
| 317 |
+
gap: 1rem;
|
| 318 |
+
font-size: 0.875rem;
|
| 319 |
+
color: var(--text-light);
|
| 320 |
+
margin-bottom: 1rem;
|
| 321 |
+
}
|
| 322 |
+
|
| 323 |
+
.product-price {
|
| 324 |
+
display: flex;
|
| 325 |
+
align-items: center;
|
| 326 |
+
gap: 0.75rem;
|
| 327 |
+
margin-bottom: 1rem;
|
| 328 |
+
}
|
| 329 |
+
|
| 330 |
+
.price-current {
|
| 331 |
+
font-size: 1.5rem;
|
| 332 |
+
font-weight: 700;
|
| 333 |
+
color: var(--text);
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
.price-old {
|
| 337 |
+
font-size: 1rem;
|
| 338 |
+
color: var(--text-light);
|
| 339 |
+
text-decoration: line-through;
|
| 340 |
+
}
|
| 341 |
+
|
| 342 |
+
.add-to-cart {
|
| 343 |
+
width: 100%;
|
| 344 |
+
padding: 0.75rem;
|
| 345 |
+
background: var(--secondary);
|
| 346 |
+
color: white;
|
| 347 |
+
border: none;
|
| 348 |
+
border-radius: 0.5rem;
|
| 349 |
+
font-weight: 600;
|
| 350 |
+
cursor: pointer;
|
| 351 |
+
transition: background 0.2s;
|
| 352 |
+
display: flex;
|
| 353 |
+
align-items: center;
|
| 354 |
+
justify-content: center;
|
| 355 |
+
gap: 0.5rem;
|
| 356 |
+
}
|
| 357 |
+
|
| 358 |
+
.add-to-cart:hover {
|
| 359 |
+
background: var(--primary);
|
| 360 |
+
}
|
| 361 |
+
|
| 362 |
+
/* Cart Sidebar */
|
| 363 |
+
.cart-overlay {
|
| 364 |
+
position: fixed;
|
| 365 |
+
inset: 0;
|
| 366 |
+
background: rgba(0,0,0,0.5);
|
| 367 |
+
z-index: 200;
|
| 368 |
+
opacity: 0;
|
| 369 |
+
pointer-events: none;
|
| 370 |
+
transition: opacity 0.3s;
|
| 371 |
+
}
|
| 372 |
+
|
| 373 |
+
.cart-overlay.open {
|
| 374 |
+
opacity: 1;
|
| 375 |
+
pointer-events: all;
|
| 376 |
+
}
|
| 377 |
+
|
| 378 |
+
.cart-sidebar {
|
| 379 |
+
position: fixed;
|
| 380 |
+
top: 0;
|
| 381 |
+
right: 0;
|
| 382 |
+
width: 400px;
|
| 383 |
+
max-width: 90vw;
|
| 384 |
+
height: 100vh;
|
| 385 |
+
background: var(--card);
|
| 386 |
+
z-index: 201;
|
| 387 |
+
transform: translateX(100%);
|
| 388 |
+
transition: transform 0.3s;
|
| 389 |
+
display: flex;
|
| 390 |
+
flex-direction: column;
|
| 391 |
+
}
|
| 392 |
+
|
| 393 |
+
.cart-sidebar.open {
|
| 394 |
+
transform: translateX(0);
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
+
.cart-header {
|
| 398 |
+
padding: 1.5rem;
|
| 399 |
+
border-bottom: 1px solid var(--border);
|
| 400 |
+
display: flex;
|
| 401 |
+
justify-content: space-between;
|
| 402 |
+
align-items: center;
|
| 403 |
+
}
|
| 404 |
+
|
| 405 |
+
.cart-header h2 {
|
| 406 |
+
font-size: 1.25rem;
|
| 407 |
+
}
|
| 408 |
+
|
| 409 |
+
.close-cart {
|
| 410 |
+
background: none;
|
| 411 |
+
border: none;
|
| 412 |
+
font-size: 1.5rem;
|
| 413 |
+
cursor: pointer;
|
| 414 |
+
color: var(--text-light);
|
| 415 |
+
}
|
| 416 |
+
|
| 417 |
+
.cart-items {
|
| 418 |
+
flex: 1;
|
| 419 |
+
overflow-y: auto;
|
| 420 |
+
padding: 1rem;
|
| 421 |
+
}
|
| 422 |
+
|
| 423 |
+
.cart-item {
|
| 424 |
+
display: flex;
|
| 425 |
+
gap: 1rem;
|
| 426 |
+
padding: 1rem;
|
| 427 |
+
background: var(--bg);
|
| 428 |
+
border-radius: 0.5rem;
|
| 429 |
+
margin-bottom: 1rem;
|
| 430 |
+
align-items: center;
|
| 431 |
+
}
|
| 432 |
+
|
| 433 |
+
.cart-item-img {
|
| 434 |
+
width: 60px;
|
| 435 |
+
height: 60px;
|
| 436 |
+
background: white;
|
| 437 |
+
border-radius: 0.5rem;
|
| 438 |
+
display: flex;
|
| 439 |
+
align-items: center;
|
| 440 |
+
justify-content: center;
|
| 441 |
+
font-size: 1.5rem;
|
| 442 |
+
}
|
| 443 |
+
|
| 444 |
+
.cart-item-info {
|
| 445 |
+
flex: 1;
|
| 446 |
+
}
|
| 447 |
+
|
| 448 |
+
.cart-item-name {
|
| 449 |
+
font-weight: 600;
|
| 450 |
+
font-size: 0.875rem;
|
| 451 |
+
}
|
| 452 |
+
|
| 453 |
+
.cart-item-price {
|
| 454 |
+
color: var(--primary);
|
| 455 |
+
font-weight: 600;
|
| 456 |
+
font-size: 0.875rem;
|
| 457 |
+
}
|
| 458 |
+
|
| 459 |
+
.cart-item-qty {
|
| 460 |
+
display: flex;
|
| 461 |
+
align-items: center;
|
| 462 |
+
gap: 0.5rem;
|
| 463 |
+
}
|
| 464 |
+
|
| 465 |
+
.qty-btn {
|
| 466 |
+
width: 28px;
|
| 467 |
+
height: 28px;
|
| 468 |
+
border: 1px solid var(--border);
|
| 469 |
+
background: white;
|
| 470 |
+
border-radius: 0.25rem;
|
| 471 |
+
cursor: pointer;
|
| 472 |
+
display: flex;
|
| 473 |
+
align-items: center;
|
| 474 |
+
justify-content: center;
|
| 475 |
+
}
|
| 476 |
+
|
| 477 |
+
.cart-footer {
|
| 478 |
+
padding: 1.5rem;
|
| 479 |
+
border-top: 1px solid var(--border);
|
| 480 |
+
}
|
| 481 |
+
|
| 482 |
+
.cart-total {
|
| 483 |
+
display: flex;
|
| 484 |
+
justify-content: space-between;
|
| 485 |
+
font-size: 1.25rem;
|
| 486 |
+
font-weight: 700;
|
| 487 |
+
margin-bottom: 1rem;
|
| 488 |
+
}
|
| 489 |
+
|
| 490 |
+
.checkout-btn {
|
| 491 |
+
width: 100%;
|
| 492 |
+
padding: 1rem;
|
| 493 |
+
background: var(--accent);
|
| 494 |
+
color: white;
|
| 495 |
+
border: none;
|
| 496 |
+
border-radius: 0.5rem;
|
| 497 |
+
font-weight: 700;
|
| 498 |
+
font-size: 1rem;
|
| 499 |
+
cursor: pointer;
|
| 500 |
+
transition: opacity 0.2s;
|
| 501 |
+
}
|
| 502 |
+
|
| 503 |
+
.checkout-btn:hover {
|
| 504 |
+
opacity: 0.9;
|
| 505 |
+
}
|
| 506 |
+
|
| 507 |
+
.empty-cart {
|
| 508 |
+
text-align: center;
|
| 509 |
+
padding: 3rem 1rem;
|
| 510 |
+
color: var(--text-light);
|
| 511 |
+
}
|
| 512 |
+
|
| 513 |
+
.remove-item {
|
| 514 |
+
background: none;
|
| 515 |
+
border: none;
|
| 516 |
+
color: #ef4444;
|
| 517 |
+
cursor: pointer;
|
| 518 |
+
font-size: 1.25rem;
|
| 519 |
+
}
|
| 520 |
+
|
| 521 |
+
/* Toast */
|
| 522 |
+
.toast {
|
| 523 |
+
position: fixed;
|
| 524 |
+
bottom: 2rem;
|
| 525 |
+
right: 2rem;
|
| 526 |
+
background: var(--secondary);
|
| 527 |
+
color: white;
|
| 528 |
+
padding: 1rem 1.5rem;
|
| 529 |
+
border-radius: 0.5rem;
|
| 530 |
+
box-shadow: var(--shadow-lg);
|
| 531 |
+
transform: translateY(200%);
|
| 532 |
+
transition: transform 0.3s;
|
| 533 |
+
z-index: 300;
|
| 534 |
+
display: flex;
|
| 535 |
+
align-items: center;
|
| 536 |
+
gap: 0.75rem;
|
| 537 |
+
}
|
| 538 |
+
|
| 539 |
+
.toast.show {
|
| 540 |
+
transform: translateY(0);
|
| 541 |
+
}
|
| 542 |
+
|
| 543 |
+
/* Footer */
|
| 544 |
+
footer {
|
| 545 |
+
background: var(--secondary);
|
| 546 |
+
color: #94a3b8;
|
| 547 |
+
padding: 3rem 2rem;
|
| 548 |
+
text-align: center;
|
| 549 |
+
}
|
| 550 |
+
|
| 551 |
+
.footer-content {
|
| 552 |
+
max-width: 1200px;
|
| 553 |
+
margin: 0 auto;
|
| 554 |
+
}
|
| 555 |
+
|
| 556 |
+
.footer-links {
|
| 557 |
+
display: flex;
|
| 558 |
+
justify-content: center;
|
| 559 |
+
gap: 2rem;
|
| 560 |
+
margin-bottom: 2rem;
|
| 561 |
+
flex-wrap: wrap;
|
| 562 |
+
}
|
| 563 |
+
|
| 564 |
+
.footer-links a {
|
| 565 |
+
color: #94a3b8;
|
| 566 |
+
text-decoration: none;
|
| 567 |
+
transition: color 0.2s;
|
| 568 |
+
}
|
| 569 |
+
|
| 570 |
+
.footer-links a:hover {
|
| 571 |
+
color: white;
|
| 572 |
+
}
|
| 573 |
+
|
| 574 |
+
/* Responsive */
|
| 575 |
+
@media (max-width: 768px) {
|
| 576 |
+
.hero h1 {
|
| 577 |
+
font-size: 2rem;
|
| 578 |
+
}
|
| 579 |
+
|
| 580 |
+
.nav-links {
|
| 581 |
+
display: none;
|
| 582 |
+
}
|
| 583 |
+
|
| 584 |
+
.products-grid {
|
| 585 |
+
grid-template-columns: 1fr;
|
| 586 |
+
}
|
| 587 |
+
|
| 588 |
+
.features {
|
| 589 |
+
grid-template-columns: 1fr;
|
| 590 |
+
margin-top: 2rem;
|
| 591 |
+
}
|
| 592 |
+
}
|
| 593 |
+
</style>
|
| 594 |
+
</head>
|
| 595 |
+
<body>
|
| 596 |
+
|
| 597 |
+
<!-- Navigation -->
|
| 598 |
+
<nav>
|
| 599 |
+
<div class="nav-container">
|
| 600 |
+
<a href="#" class="logo">π± PhoneVault</a>
|
| 601 |
+
<ul class="nav-links">
|
| 602 |
+
<li><a href="#home">Home</a></li>
|
| 603 |
+
<li><a href="#products">Phones</a></li>
|
| 604 |
+
<li><a href="#accessories">Accessories</a></li>
|
| 605 |
+
<li><a href="#deals">Deals</a></li>
|
| 606 |
+
<li><button class="cart-btn" onclick="toggleCart()">
|
| 607 |
+
π Cart <span id="cart-count">0</span>
|
| 608 |
+
</button></li>
|
| 609 |
+
</ul>
|
| 610 |
+
</div>
|
| 611 |
+
</nav>
|
| 612 |
+
|
| 613 |
+
<!-- Hero -->
|
| 614 |
+
<section class="hero" id="home">
|
| 615 |
+
<h1>Next-Gen Smartphones</h1>
|
| 616 |
+
<p>Discover the latest flagship devices with cutting-edge technology, premium design, and unbeatable prices.</p>
|
| 617 |
+
<div class="hero-btns">
|
| 618 |
+
<a href="#products" class="btn btn-primary">Shop Now</a>
|
| 619 |
+
<a href="#deals" class="btn btn-outline">View Deals</a>
|
| 620 |
+
</div>
|
| 621 |
+
</section>
|
| 622 |
+
|
| 623 |
+
<!-- Features -->
|
| 624 |
+
<div class="features">
|
| 625 |
+
<div class="feature-card">
|
| 626 |
+
<div class="feature-icon">π</div>
|
| 627 |
+
<h3>Free Shipping</h3>
|
| 628 |
+
<p>Free express delivery on all orders over $500</p>
|
| 629 |
+
</div>
|
| 630 |
+
<div class="feature-card">
|
| 631 |
+
<div class="feature-icon">π‘οΈ</div>
|
| 632 |
+
<h3>2-Year Warranty</h3>
|
| 633 |
+
<p>Full coverage warranty on every device</p>
|
| 634 |
+
</div>
|
| 635 |
+
<div class="feature-card">
|
| 636 |
+
<div class="feature-icon">β©οΈ</div>
|
| 637 |
+
<h3>30-Day Returns</h3>
|
| 638 |
+
<p>Hassle-free returns if you're not satisfied</p>
|
| 639 |
+
</div>
|
| 640 |
+
<div class="feature-card">
|
| 641 |
+
<div class="feature-icon">π</div>
|
| 642 |
+
<h3>Secure Payment</h3>
|
| 643 |
+
<p>Encrypted transactions for your safety</p>
|
| 644 |
+
</div>
|
| 645 |
+
</div>
|
| 646 |
+
|
| 647 |
+
<!-- Products -->
|
| 648 |
+
<section class="products-section" id="products">
|
| 649 |
+
<div class="section-header">
|
| 650 |
+
<h2>Latest Phones</h2>
|
| 651 |
+
<div class="filter-btns">
|
| 652 |
+
<button class="filter-btn active" onclick="filterProducts('all')">All</button>
|
| 653 |
+
<button class="filter-btn" onclick="filterProducts('flagship')">Flagship</button>
|
| 654 |
+
<button class="filter-btn" onclick="filterProducts('midrange')">Mid-Range</button>
|
| 655 |
+
<button class="filter-btn" onclick="filterProducts('budget')">Budget</button>
|
| 656 |
+
</div>
|
| 657 |
+
</div>
|
| 658 |
+
|
| 659 |
+
<div class="products-grid" id="products-grid">
|
| 660 |
+
<!-- Products injected by JS -->
|
| 661 |
+
</div>
|
| 662 |
+
</section>
|
| 663 |
+
|
| 664 |
+
<!-- Cart -->
|
| 665 |
+
<div class="cart-overlay" id="cart-overlay" onclick="toggleCart()"></div>
|
| 666 |
+
<div class="cart-sidebar" id="cart-sidebar">
|
| 667 |
+
<div class="cart-header">
|
| 668 |
+
<h2>π Your Cart</h2>
|
| 669 |
+
<button class="close-cart" onclick="toggleCart()">β</button>
|
| 670 |
+
</div>
|
| 671 |
+
<div class="cart-items" id="cart-items">
|
| 672 |
+
<div class="empty-cart">Your cart is empty</div>
|
| 673 |
+
</div>
|
| 674 |
+
<div class="cart-footer">
|
| 675 |
+
<div class="cart-total">
|
| 676 |
+
<span>Total</span>
|
| 677 |
+
<span id="cart-total">$0</span>
|
| 678 |
+
</div>
|
| 679 |
+
<button class="checkout-btn" onclick="checkout()">Proceed to Checkout</button>
|
| 680 |
+
</div>
|
| 681 |
+
</div>
|
| 682 |
+
|
| 683 |
+
<!-- Toast -->
|
| 684 |
+
<div class="toast" id="toast">
|
| 685 |
+
<span>β
</span>
|
| 686 |
+
<span id="toast-message">Added to cart!</span>
|
| 687 |
+
</div>
|
| 688 |
+
|
| 689 |
+
<!-- Footer -->
|
| 690 |
+
<footer>
|
| 691 |
+
<div class="footer-content">
|
| 692 |
+
<div class="footer-links">
|
| 693 |
+
<a href="#">About Us</a>
|
| 694 |
+
<a href="#">Contact</a>
|
| 695 |
+
<a href="#">Privacy Policy</a>
|
| 696 |
+
<a href="#">Terms of Service</a>
|
| 697 |
+
<a href="#">Support</a>
|
| 698 |
+
</div>
|
| 699 |
+
<p>© 2026 PhoneVault. All rights reserved.</p>
|
| 700 |
+
</div>
|
| 701 |
+
</footer>
|
| 702 |
+
|
| 703 |
+
<script>
|
| 704 |
+
const products = [
|
| 705 |
+
{ id: 1, name: "Galaxy S25 Ultra", brand: "Samsung", category: "flagship", price: 1199, oldPrice: 1299, specs: "256GB β’ 12GB RAM", emoji: "π±", badge: "New" },
|
| 706 |
+
{ id: 2, name: "iPhone 16 Pro Max", brand: "Apple", category: "flagship", price: 1299, oldPrice: null, specs: "512GB β’ Titanium", emoji: "π", badge: "Hot" },
|
| 707 |
+
{ id: 3, name: "Pixel 9 Pro", brand: "Google", category: "flagship", price: 999, oldPrice: 1099, specs: "128GB β’ AI Camera", emoji: "π€", badge: "Sale" },
|
| 708 |
+
{ id: 4, name: "OnePlus 13", brand: "OnePlus", category: "flagship", price: 899, oldPrice: null, specs: "256GB β’ 120Hz", emoji: "β‘", badge: null },
|
| 709 |
+
{ id: 5, name: "Xiaomi 15", brand: "Xiaomi", category: "midrange", price: 649, oldPrice: 699, specs: "256GB β’ 108MP", emoji: "π·", badge: "Sale" },
|
| 710 |
+
{ id: 6, name: "Nothing Phone 3", brand: "Nothing", category: "midrange", price: 599, oldPrice: null, specs: "128GB β’ Glyph", emoji: "π‘", badge: null },
|
| 711 |
+
{ id: 7, name: "Moto G85", brand: "Motorola", category: "budget", price: 299, oldPrice: 349, specs: "128GB β’ 5G", emoji: "π²", badge: "Sale" },
|
| 712 |
+
{ id: 8, name: "Redmi Note 14", brand: "Xiaomi", category: "budget", price: 249, oldPrice: null, specs: "128GB β’ 6000mAh", emoji: "π", badge: null }
|
| 713 |
+
];
|
| 714 |
+
|
| 715 |
+
let cart = [];
|
| 716 |
+
let currentFilter = 'all';
|
| 717 |
+
|
| 718 |
+
function renderProducts() {
|
| 719 |
+
const grid = document.getElementById('products-grid');
|
| 720 |
+
const filtered = currentFilter === 'all' ? products : products.filter(p => p.category === currentFilter);
|
| 721 |
+
|
| 722 |
+
grid.innerHTML = filtered.map(product => `
|
| 723 |
+
<div class="product-card" data-category="${product.category}">
|
| 724 |
+
<div class="product-img">
|
| 725 |
+
${product.emoji}
|
| 726 |
+
${product.badge ? `<span class="badge ${product.badge === 'Sale' ? 'badge-sale' : ''}">${product.badge}</span>` : ''}
|
| 727 |
+
</div>
|
| 728 |
+
<div class="product-info">
|
| 729 |
+
<div class="product-brand">${product.brand}</div>
|
| 730 |
+
<div class="product-name">${product.name}</div>
|
| 731 |
+
<div class="product-specs">${product.specs}</div>
|
| 732 |
+
<div class="product-price">
|
| 733 |
+
<span class="price-current">$${product.price}</span>
|
| 734 |
+
${product.oldPrice ? `<span class="price-old">$${product.oldPrice}</span>` : ''}
|
| 735 |
+
</div>
|
| 736 |
+
<button class="add-to-cart" onclick="addToCart(${product.id})">
|
| 737 |
+
<span>π</span> Add to Cart
|
| 738 |
+
</button>
|
| 739 |
+
</div>
|
| 740 |
+
</div>
|
| 741 |
+
`).join('');
|
| 742 |
+
}
|
| 743 |
+
|
| 744 |
+
function filterProducts(category) {
|
| 745 |
+
currentFilter = category;
|
| 746 |
+
document.querySelectorAll('.filter-btn').forEach(btn => btn.classList.remove('active'));
|
| 747 |
+
event.target.classList.add('active');
|
| 748 |
+
renderProducts();
|
| 749 |
+
}
|
| 750 |
+
|
| 751 |
+
function addToCart(id) {
|
| 752 |
+
const product = products.find(p => p.id === id);
|
| 753 |
+
const existing = cart.find(item => item.id === id);
|
| 754 |
+
|
| 755 |
+
if (existing) {
|
| 756 |
+
existing.qty++;
|
| 757 |
+
} else {
|
| 758 |
+
cart.push({ ...product, qty: 1 });
|
| 759 |
+
}
|
| 760 |
+
|
| 761 |
+
updateCart();
|
| 762 |
+
showToast(`${product.name} added to cart!`);
|
| 763 |
+
}
|
| 764 |
+
|
| 765 |
+
function updateCart() {
|
| 766 |
+
const count = document.getElementById('cart-count');
|
| 767 |
+
const items = document.getElementById('cart-items');
|
| 768 |
+
const total = document.getElementById('cart-total');
|
| 769 |
+
|
| 770 |
+
const totalQty = cart.reduce((sum, item) => sum + item.qty, 0);
|
| 771 |
+
const totalPrice = cart.reduce((sum, item) => sum + (item.price * item.qty), 0);
|
| 772 |
+
|
| 773 |
+
count.textContent = totalQty;
|
| 774 |
+
|
| 775 |
+
if (cart.length === 0) {
|
| 776 |
+
items.innerHTML = '<div class="empty-cart">Your cart is empty</div>';
|
| 777 |
+
} else {
|
| 778 |
+
items.innerHTML = cart.map(item => `
|
| 779 |
+
<div class="cart-item">
|
| 780 |
+
<div class="cart-item-img">${item.emoji}</div>
|
| 781 |
+
<div class="cart-item-info">
|
| 782 |
+
<div class="cart-item-name">${item.name}</div>
|
| 783 |
+
<div class="cart-item-price">$${item.price}</div>
|
| 784 |
+
</div>
|
| 785 |
+
<div class="cart-item-qty">
|
| 786 |
+
<button class="qty-btn" onclick="changeQty(${item.id}, -1)">β</button>
|
| 787 |
+
<span>${item.qty}</span>
|
| 788 |
+
<button class="qty-btn" onclick="changeQty(${item.id}, 1)">+</button>
|
| 789 |
+
</div>
|
| 790 |
+
<button class="remove-item" onclick="removeItem(${item.id})">π</button>
|
| 791 |
+
</div>
|
| 792 |
+
`).join('');
|
| 793 |
+
}
|
| 794 |
+
|
| 795 |
+
total.textContent = `$${totalPrice}`;
|
| 796 |
+
}
|
| 797 |
+
|
| 798 |
+
function changeQty(id, delta) {
|
| 799 |
+
const item = cart.find(item => item.id === id);
|
| 800 |
+
if (item) {
|
| 801 |
+
item.qty += delta;
|
| 802 |
+
if (item.qty <= 0) removeItem(id);
|
| 803 |
+
else updateCart();
|
| 804 |
+
}
|
| 805 |
+
}
|
| 806 |
+
|
| 807 |
+
function removeItem(id) {
|
| 808 |
+
cart = cart.filter(item => item.id !== id);
|
| 809 |
+
updateCart();
|
| 810 |
+
}
|
| 811 |
+
|
| 812 |
+
function toggleCart() {
|
| 813 |
+
document.getElementById('cart-overlay').classList.toggle('open');
|
| 814 |
+
document.getElementById('cart-sidebar').classList.toggle('open');
|
| 815 |
+
}
|
| 816 |
+
|
| 817 |
+
function showToast(msg) {
|
| 818 |
+
const toast = document.getElementById('toast');
|
| 819 |
+
document.getElementById('toast-message').textContent = msg;
|
| 820 |
+
toast.classList.add('show');
|
| 821 |
+
setTimeout(() => toast.classList.remove('show'), 3000);
|
| 822 |
+
}
|
| 823 |
+
|
| 824 |
+
function checkout() {
|
| 825 |
+
if (cart.length === 0) return;
|
| 826 |
+
alert('Thank you for your order! This is a demo checkout.');
|
| 827 |
+
cart = [];
|
| 828 |
+
updateCart();
|
| 829 |
+
toggleCart();
|
| 830 |
+
}
|
| 831 |
+
|
| 832 |
+
renderProducts();
|
| 833 |
+
</script>
|
| 834 |
+
</body>
|
| 835 |
</html>
|
| 836 |
+
<script data-huggingchat-badge="script">
|
| 837 |
+
(function () {
|
| 838 |
+
try {
|
| 839 |
+
if (document.querySelector("[data-huggingchat-badge]:not(script)")) return;
|
| 840 |
+
var host = document.createElement("div");
|
| 841 |
+
host.setAttribute("data-huggingchat-badge", "");
|
| 842 |
+
var styles = [["all","initial"],["position","fixed"],["right","12px"],["bottom","12px"],["z-index","2147483647"],["display","block"],["visibility","visible"],["opacity","1"],["pointer-events","auto"],["width","auto"],["height","auto"],["margin","0"],["padding","0"],["max-width","none"],["max-height","none"],["transform","none"],["filter","none"],["clip-path","none"],["color-scheme","light"]];
|
| 843 |
+
for (var i = 0; i < styles.length; i++) {
|
| 844 |
+
host.style.setProperty(styles[i][0], styles[i][1], "important");
|
| 845 |
+
}
|
| 846 |
+
host.attachShadow({ mode: "closed" }).innerHTML = "<style>\n:host { all: initial; }\na {\n display: flex;\n align-items: center;\n gap: 5px;\n box-sizing: border-box;\n height: 26px;\n padding: 0 9px 0 7px;\n border-radius: 999px;\n border: 1px solid rgba(0, 0, 0, 0.07);\n background: rgba(255, 255, 255, 0.92);\n -webkit-backdrop-filter: saturate(180%) blur(8px);\n backdrop-filter: saturate(180%) blur(8px);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 6px 16px rgba(0, 0, 0, 0.06);\n color: #111827;\n font: 500 11px/1 ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif;\n letter-spacing: 0.01em;\n text-decoration: none;\n white-space: nowrap;\n opacity: 0.72;\n transition: opacity 0.15s ease, transform 0.15s ease;\n}\na:hover, a:focus-visible { opacity: 1; transform: translateY(-1px); }\nsvg { width: 14px; height: 14px; flex: none; }\n@media print { a { display: none; } }\n<\/style><a href=\"https://huggingface.co/chat\" target=\"_blank\" rel=\"noopener noreferrer nofollow\"><svg viewBox=\"0 0 32 32\" fill=\"none\" aria-hidden=\"true\"><path d=\"M16.0006 25.9992C13.8266 25.999 11.7118 25.2901 9.97686 23.9799C8.2419 22.6698 6.98127 20.8298 6.38599 18.7388C5.79071 16.6478 5.89323 14.4198 6.678 12.3923C7.46278 10.3648 8.88705 8.64837 10.735 7.50308C12.5829 6.35779 14.7538 5.84606 16.9187 6.04544C19.0837 6.24481 21.1246 7.14442 22.7323 8.60795C24.34 10.0715 25.4268 12.0192 25.8281 14.1559C26.2293 16.2926 25.9232 18.5019 24.9561 20.449C24.7703 20.8042 24.7223 21.2155 24.8211 21.604L25.4211 23.8316C25.4803 24.0518 25.4805 24.2837 25.4216 24.5039C25.3627 24.7242 25.2468 24.925 25.0856 25.0862C24.9244 25.2474 24.7235 25.3633 24.5033 25.4222C24.283 25.4811 24.0512 25.4809 23.831 25.4217L21.6034 24.8217C21.2172 24.7248 20.809 24.7729 20.4558 24.9567C19.0683 25.6467 17.5457 26.0068 16.0006 26.0068V25.9992Z\" fill=\"currentColor\"/><path d=\"M9.62598 16.0013C9.62598 15.3799 10.1294 14.8765 10.7508 14.8765C11.3721 14.8765 11.8756 15.3799 11.8756 16.0013C11.8756 17.0953 12.3102 18.1448 13.0838 18.9184C13.8574 19.692 14.9069 20.1266 16.001 20.1267C17.095 20.1267 18.1445 19.692 18.9181 18.9184C19.6918 18.1448 20.1264 17.0953 20.1264 16.0013C20.1264 15.3799 20.6299 14.8765 21.2512 14.8765C21.8725 14.8765 22.3759 15.3799 22.3759 16.0013C22.3759 17.6921 21.7046 19.3137 20.509 20.5093C19.3134 21.7049 17.6918 22.3762 16.001 22.3762C14.3102 22.3762 12.6885 21.7049 11.4929 20.5093C10.2974 19.3137 9.62598 17.6921 9.62598 16.0013Z\" fill=\"#fff\"/><\/svg><span>Made with HuggingChat<\/span><\/a>";
|
| 847 |
+
function attach() {
|
| 848 |
+
var parent = document.body || document.documentElement;
|
| 849 |
+
if (parent && host.parentNode !== parent) parent.appendChild(host);
|
| 850 |
+
}
|
| 851 |
+
attach();
|
| 852 |
+
// Artifacts that rewrite document.body wholesale would drop the badge.
|
| 853 |
+
if (document.body && typeof MutationObserver === "function") {
|
| 854 |
+
new MutationObserver(attach).observe(document.body, { childList: true });
|
| 855 |
+
} else {
|
| 856 |
+
document.addEventListener("DOMContentLoaded", attach);
|
| 857 |
+
}
|
| 858 |
+
} catch (e) {}
|
| 859 |
+
})();
|
| 860 |
+
</script>
|