hamidazer commited on
Commit
5b33a4f
·
verified ·
1 Parent(s): 20b25fd

من میخوام یک وبسایت فروشگاهی راه اندازی کنم و میخوام صفحه ی اصلی این وبسایت و مواردی که نیاز داره رو به صورت استاتیک طراحی کنی. دقت کن تمام مواردی که یک وبسایت حرفه ای نیاز داره رو در این صفحه پیاده سازی کن

Browse files
Files changed (3) hide show
  1. README.md +8 -5
  2. components/navbar.js +230 -0
  3. index.html +89 -19
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Vip
3
- emoji: 📉
4
- colorFrom: red
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: شاپ‌ویستا - بوتیک دیجیتال VIP 🛍️
3
+ colorFrom: yellow
4
+ colorTo: pink
5
+ emoji: 🐳
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite-v3
10
  ---
11
 
12
+ # Welcome to your new DeepSite project!
13
+ This project was created with [DeepSite](https://huggingface.co/deepsite).
components/navbar.js ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```javascript
2
+ class ShopNavbar extends HTMLElement {
3
+ constructor() {
4
+ super();
5
+ this.attachShadow({ mode: 'open' });
6
+ this.cartCount = 0;
7
+ }
8
+
9
+ connectedCallback() {
10
+ this.shadowRoot.innerHTML = `
11
+ <style>
12
+ * {
13
+ margin: 0;
14
+ padding: 0;
15
+ box-sizing: border-box;
16
+ }
17
+
18
+ nav {
19
+ background: rgba(255, 255, 255, 0.95);
20
+ backdrop-filter: blur(10px);
21
+ box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
22
+ position: fixed;
23
+ top: 0;
24
+ left: 0;
25
+ right: 0;
26
+ z-index: 1000;
27
+ transition: all 0.3s ease;
28
+ }
29
+
30
+ .nav-container {
31
+ max-width: 1400px;
32
+ margin: 0 auto;
33
+ padding: 0 2rem;
34
+ display: flex;
35
+ align-items: center;
36
+ justify-content: space-between;
37
+ height: 80px;
38
+ }
39
+
40
+ .logo {
41
+ font-family: 'Inter', sans-serif;
42
+ font-size: 1.8rem;
43
+ font-weight: 800;
44
+ background: linear-gradient(135deg, #6366f1, #9333ea);
45
+ -webkit-background-clip: text;
46
+ -webkit-text-fill-color: transparent;
47
+ text-decoration: none;
48
+ }
49
+
50
+ .nav-menu {
51
+ display: flex;
52
+ list-style: none;
53
+ gap: 2rem;
54
+ align-items: center;
55
+ }
56
+
57
+ .nav-link {
58
+ color: #374151;
59
+ text-decoration: none;
60
+ font-weight: 500;
61
+ font-size: 0.95rem;
62
+ transition: color 0.3s ease;
63
+ position: relative;
64
+ }
65
+
66
+ .nav-link:hover {
67
+ color: #6366f1;
68
+ }
69
+
70
+ .nav-link::after {
71
+ content: '';
72
+ position: absolute;
73
+ bottom: -5px;
74
+ left: 0;
75
+ width: 0;
76
+ height: 2px;
77
+ background: #6366f1;
78
+ transition: width 0.3s ease;
79
+ }
80
+
81
+ .nav-link:hover::after {
82
+ width: 100%;
83
+ }
84
+
85
+ .nav-actions {
86
+ display: flex;
87
+ align-items: center;
88
+ gap: 1rem;
89
+ }
90
+
91
+ .cart-btn, .search-btn, .profile-btn, .theme-toggle {
92
+ background: none;
93
+ border: none;
94
+ cursor: pointer;
95
+ padding: 0.5rem;
96
+ border-radius: 50%;
97
+ transition: all 0.3s ease;
98
+ position: relative;
99
+ }
100
+
101
+ .cart-btn:hover, .search-btn:hover, .profile-btn:hover, .theme-toggle:hover {
102
+ background: #f3f4f6;
103
+ transform: scale(1.1);
104
+ }
105
+
106
+ .cart-count {
107
+ position: absolute;
108
+ top: -5px;
109
+ right: -5px;
110
+ background: #ef4444;
111
+ color: white;
112
+ border-radius: 50%;
113
+ width: 20px;
114
+ height: 20px;
115
+ font-size: 0.75rem;
116
+ display: flex;
117
+ align-items: center;
118
+ justify-content: center;
119
+ }
120
+
121
+ .search-input {
122
+ position: absolute;
123
+ top: 100%;
124
+ right: 0;
125
+ background: white;
126
+ border: 1px solid #e5e7eb;
127
+ border-radius: 8px;
128
+ padding: 0.75rem;
129
+ width: 300px;
130
+ box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
131
+ display: none;
132
+ }
133
+
134
+ .search-input.active {
135
+ display: block;
136
+ }
137
+
138
+ .mobile-menu-btn {
139
+ display: none;
140
+ }
141
+
142
+ @media (max-width: 768px) {
143
+ .nav-menu {
144
+ display: none;
145
+ }
146
+
147
+ .mobile-menu-btn {
148
+ display: block;
149
+ }
150
+
151
+ .search-input {
152
+ width: 250px;
153
+ }
154
+ }
155
+ </style>
156
+
157
+ <nav>
158
+ <div class="nav-container">
159
+ <a href="/" class="logo">شاپ‌ویستا</a>
160
+
161
+ <ul class="nav-menu">
162
+ <li><a href="/" class="nav-link">صفحه اصلی</a></li>
163
+ <li><a href="/category.html" class="nav-link">دسته‌بندی‌ها</a></li>
164
+ <li><a href="/products.html" class="nav-link">محصولات</a></li>
165
+ <li><a href="/brands.html" class="nav-link">برندها</a></li>
166
+ <li><a href="/deals.html" class="nav-link">تخفیف‌ها</a></li>
167
+ <li><a href="/blog.html" class="nav-link">وبلاگ</a></li>
168
+ </ul>
169
+
170
+ <div class="nav-actions">
171
+ <button class="search-btn" id="searchBtn">
172
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
173
+ <circle cx="11" cy="11" r="8"></circle>
174
+ <path d="M21 21l-4.35-4.35"></path>
175
+ </svg>
176
+ </button>
177
+ <input type="text" class="search-input" id="searchInput" placeholder="جستجو در محصولات...">
178
+
179
+ <button class="profile-btn">
180
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
181
+ <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
182
+ <circle cx="12" cy="7" r="4"></circle>
183
+ </svg>
184
+ </button>
185
+
186
+ <button class="theme-toggle" id="themeToggle">
187
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" id="themeIcon">
188
+ <circle cx="12" cy="12" r="5"></circle>
189
+ <line x1="12" y1="1" x2="12" y2="3"></line>
190
+ <line x1="12" y1="21" x2="12" y2="23"></line>
191
+ <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
192
+ <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
193
+ <line x1="1" y1="12" x2="3" y2="12"></line>
194
+ <line x1="21" y1="12" x2="23" y2="12"></line>
195
+ <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
196
+ <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
197
+ </svg>
198
+ </button>
199
+
200
+ <button class="cart-btn" id="cartBtn">
201
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
202
+ <path d="M9 2L6 6H3L5 20H19L21 6H18L15 2H9Z"></path>
203
+ </svg>
204
+ <span class="cart-count" id="cartCount">${this.cartCount}</span>
205
+ </button>
206
+ </div>
207
+ </div>
208
+ </nav>
209
+ `;
210
+
211
+ this.setupEventListeners();
212
+ }
213
+
214
+ setupEventListeners() {
215
+ const searchBtn = this.shadowRoot.getElementById('searchBtn');
216
+ const searchInput = this.shadowRoot.getElementById('searchInput');
217
+ const themeToggle = this.shadowRoot.getElementById('themeToggle');
218
+ const cartBtn = this.shadowRoot.getElementById('cartBtn');
219
+
220
+ searchBtn.addEventListener('click', () => {
221
+ searchInput.classList.toggle('active');
222
+ searchInput.focus();
223
+ });
224
+
225
+ themeToggle.addEventListener('click', () => {
226
+ document.body.classList.toggle('dark');
227
+ const icon = this.shadowRoot.getElementById('themeIcon');
228
+ if (document.body.classList.contains('dark')) {
229
+ icon.innerHTML = '<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>';
230
+ } else {
index.html CHANGED
@@ -1,19 +1,89 @@
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="fa" dir="rtl">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>ShopVista - فروشگاه آنلاین حرفه‌ای</title>
7
+ <link rel="icon" type="image/x-icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🛒</text></svg>">
8
+ <link rel="stylesheet" href="style.css">
9
+ <script src="https://cdn.tailwindcss.com"></script>
10
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
11
+ <script src="https://unpkg.com/feather-icons"></script>
12
+ <script>
13
+ tailwind.config = {
14
+ theme: {
15
+ extend: {
16
+ colors: {
17
+ primary: {
18
+ 50: '#eef2ff',
19
+ 100: '#e0e7ff',
20
+ 200: '#c7d2fe',
21
+ 300: '#a5b4fc',
22
+ 400: '#818cf8',
23
+ 500: '#6366f1',
24
+ 600: '#4f46e5',
25
+ 700: '#4338ca',
26
+ 800: '#3730a3',
27
+ 900: '#312e81',
28
+ },
29
+ secondary: {
30
+ 50: '#faf5ff',
31
+ 100: '#f3e8ff',
32
+ 200: '#e9d5ff',
33
+ 300: '#d8b4fe',
34
+ 400: '#c084fc',
35
+ 500: '#a855f7',
36
+ 600: '#9333ea',
37
+ 700: '#7e22ce',
38
+ 800: '#6b21a8',
39
+ 900: '#581c87',
40
+ }
41
+ },
42
+ fontFamily: {
43
+ 'sans': ['Inter', 'system-ui', 'sans-serif'],
44
+ }
45
+ }
46
+ }
47
+ }
48
+ </script>
49
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
50
+ </head>
51
+ <body class="bg-gray-50 dark:bg-gray-900 transition-colors duration-300">
52
+
53
+ <!-- Custom Components -->
54
+ <script src="components/navbar.js"></script>
55
+ <script src="components/footer.js"></script>
56
+ <script src="components/product-card.js"></script>
57
+ <script src="components/cart-sidebar.js"></script>
58
+
59
+ <!-- Navbar -->
60
+ <shop-navbar></shop-navbar>
61
+
62
+ <!-- Main Content -->
63
+ <main class="pt-20">
64
+
65
+ <!-- Hero Slider -->
66
+ <section class="relative overflow-hidden bg-gradient-to-br from-primary-600 to-secondary-600">
67
+ <div class="container mx-auto px-4 py-16">
68
+ <div class="grid md:grid-cols-2 gap-8 items-center">
69
+ <div class="text-white space-y-6 animate-fade-in">
70
+ <h1 class="text-4xl md:text-6xl font-bold leading-tight">
71
+ تخفیفات ویژه <span class="text-yellow-300">تابستانی</span>
72
+ </h1>
73
+ <p class="text-xl opacity-90">تا 70% تخفیف محصولات منتخب - فرصت محدود!</p>
74
+ <div class="flex flex-wrap gap-4">
75
+ <a href="#deals" class="bg-yellow-400 text-gray-900 px-8 py-3 rounded-full font-semibold hover:bg-yellow-300 transform hover:scale-105 transition-all duration-300 shadow-lg">
76
+ مشاهده پیشنهادات
77
+ </a>
78
+ <a href="#products" class="border-2 border-white text-white px-8 py-3 rounded-full font-semibold hover:bg-white hover:text-primary-600 transition-all duration-300">
79
+ فروشگاه
80
+ </a>
81
+ </div>
82
+ </div>
83
+ <div class="relative animate-float">
84
+ <div class="absolute inset-0 bg-primary-400 rounded-full blur-3xl opacity-30"></div>
85
+ <img src="http://static.photos/technology/640x360/42" alt="محصولات فناوری" class="relative z
86
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
87
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
88
+ </body>
89
+ </html>