fhb5730 commited on
Commit
bd6ef5e
·
verified ·
1 Parent(s): 4858987

сделай сайт подбора компьютеров

Browse files
Files changed (6) hide show
  1. README.md +8 -5
  2. components/footer.js +107 -0
  3. components/navbar.js +99 -0
  4. index.html +185 -19
  5. script.js +128 -0
  6. style.css +42 -18
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Bytebazaar Computer Configurator
3
- emoji: 📈
4
- colorFrom: red
5
- colorTo: pink
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: ByteBazaar Computer Configurator 🖥️
3
+ colorFrom: green
4
+ colorTo: gray
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/footer.js ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomFooter extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ footer {
7
+ background-color: #1a202c;
8
+ color: white;
9
+ padding: 2rem 1rem;
10
+ margin-top: auto;
11
+ }
12
+ .footer-content {
13
+ max-width: 1200px;
14
+ margin: 0 auto;
15
+ display: grid;
16
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
17
+ gap: 2rem;
18
+ }
19
+ .footer-column h3 {
20
+ color: #f59e0b;
21
+ font-size: 1.125rem;
22
+ font-weight: 600;
23
+ margin-bottom: 1rem;
24
+ }
25
+ .footer-column ul {
26
+ list-style: none;
27
+ padding: 0;
28
+ margin: 0;
29
+ }
30
+ .footer-column li {
31
+ margin-bottom: 0.5rem;
32
+ }
33
+ .footer-column a {
34
+ color: #e2e8f0;
35
+ text-decoration: none;
36
+ transition: color 0.2s;
37
+ }
38
+ .footer-column a:hover {
39
+ color: #f59e0b;
40
+ }
41
+ .copyright {
42
+ text-align: center;
43
+ margin-top: 2rem;
44
+ padding-top: 1rem;
45
+ border-top: 1px solid #2d3748;
46
+ color: #a0aec0;
47
+ }
48
+ .social-links {
49
+ display: flex;
50
+ gap: 1rem;
51
+ margin-top: 1rem;
52
+ }
53
+ .social-links a {
54
+ color: #cbd5e0;
55
+ transition: color 0.2s;
56
+ }
57
+ .social-links a:hover {
58
+ color: #f59e0b;
59
+ }
60
+ </style>
61
+ <footer>
62
+ <div class="footer-content">
63
+ <div class="footer-column">
64
+ <h3>ByteBazaar</h3>
65
+ <p class="text-gray-400">Build your perfect PC with our easy-to-use configurator and high-quality components.</p>
66
+ <div class="social-links">
67
+ <a href="#"><i data-feather="facebook"></i></a>
68
+ <a href="#"><i data-feather="twitter"></i></a>
69
+ <a href="#"><i data-feather="instagram"></i></a>
70
+ <a href="#"><i data-feather="youtube"></i></a>
71
+ </div>
72
+ </div>
73
+ <div class="footer-column">
74
+ <h3>Quick Links</h3>
75
+ <ul>
76
+ <li><a href="#">Home</a></li>
77
+ <li><a href="#builder">PC Builder</a></li>
78
+ <li><a href="#prebuilt">Prebuilt Systems</a></li>
79
+ <li><a href="#">Components</a></li>
80
+ </ul>
81
+ </div>
82
+ <div class="footer-column">
83
+ <h3>Support</h3>
84
+ <ul>
85
+ <li><a href="#">FAQ</a></li>
86
+ <li><a href="#">Contact Us</a></li>
87
+ <li><a href="#">Shipping Policy</a></li>
88
+ <li><a href="#">Returns</a></li>
89
+ </ul>
90
+ </div>
91
+ <div class="footer-column">
92
+ <h3>Contact</h3>
93
+ <ul>
94
+ <li><i data-feather="mail" class="inline mr-2"></i> support@bytebazaar.com</li>
95
+ <li><i data-feather="phone" class="inline mr-2"></i> (123) 456-7890</li>
96
+ <li><i data-feather="map-pin" class="inline mr-2"></i> 123 Tech Street, Silicon Valley</li>
97
+ </ul>
98
+ </div>
99
+ </div>
100
+ <div class="copyright">
101
+ &copy; ${new Date().getFullYear()} ByteBazaar. All rights reserved.
102
+ </div>
103
+ </footer>
104
+ `;
105
+ }
106
+ }
107
+ customElements.define('custom-footer', CustomFooter);
components/navbar.js ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomNavbar extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ nav {
7
+ background-color: #1a202c;
8
+ padding: 1rem 2rem;
9
+ display: flex;
10
+ justify-content: space-between;
11
+ align-items: center;
12
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
13
+ position: sticky;
14
+ top: 0;
15
+ z-index: 50;
16
+ }
17
+ .logo {
18
+ color: white;
19
+ font-weight: bold;
20
+ font-size: 1.5rem;
21
+ display: flex;
22
+ align-items: center;
23
+ gap: 0.5rem;
24
+ }
25
+ .logo-icon {
26
+ color: #f59e0b;
27
+ }
28
+ ul {
29
+ display: flex;
30
+ gap: 1.5rem;
31
+ list-style: none;
32
+ margin: 0;
33
+ padding: 0;
34
+ }
35
+ a {
36
+ color: white;
37
+ text-decoration: none;
38
+ font-weight: 500;
39
+ transition: color 0.2s;
40
+ display: flex;
41
+ align-items: center;
42
+ gap: 0.3rem;
43
+ }
44
+ a:hover {
45
+ color: #f59e0b;
46
+ }
47
+ .nav-actions {
48
+ display: flex;
49
+ gap: 1rem;
50
+ }
51
+ .cart-btn {
52
+ background-color: #f59e0b;
53
+ color: #1a202c;
54
+ padding: 0.5rem 1rem;
55
+ border-radius: 0.375rem;
56
+ font-weight: 600;
57
+ transition: background-color 0.2s;
58
+ display: flex;
59
+ align-items: center;
60
+ gap: 0.5rem;
61
+ }
62
+ .cart-btn:hover {
63
+ background-color: #fbbf24;
64
+ }
65
+ @media (max-width: 768px) {
66
+ nav {
67
+ flex-direction: column;
68
+ gap: 1rem;
69
+ padding: 1rem;
70
+ }
71
+ ul {
72
+ flex-direction: column;
73
+ gap: 0.5rem;
74
+ align-items: center;
75
+ }
76
+ }
77
+ </style>
78
+ <nav>
79
+ <div class="logo">
80
+ <i data-feather="cpu" class="logo-icon"></i>
81
+ <span>ByteBazaar</span>
82
+ </div>
83
+ <ul>
84
+ <li><a href="#"><i data-feather="home"></i> Home</a></li>
85
+ <li><a href="#builder"><i data-feather="settings"></i> Builder</a></li>
86
+ <li><a href="#prebuilt"><i data-feather="package"></i> Prebuilt</a></li>
87
+ <li><a href="#"><i data-feather="help-circle"></i> Support</a></li>
88
+ </ul>
89
+ <div class="nav-actions">
90
+ <a href="#" class="cart-btn">
91
+ <i data-feather="shopping-cart"></i>
92
+ <span>Cart (0)</span>
93
+ </a>
94
+ </div>
95
+ </nav>
96
+ `;
97
+ }
98
+ }
99
+ customElements.define('custom-navbar', CustomNavbar);
index.html CHANGED
@@ -1,19 +1,185 @@
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>ByteBazaar - Build Your Perfect PC</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://unpkg.com/feather-icons"></script>
10
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
11
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
12
+ <script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.net.min.js"></script>
13
+ </head>
14
+ <body class="bg-gray-100">
15
+ <custom-navbar></custom-navbar>
16
+
17
+ <main class="container mx-auto px-4 py-8">
18
+ <!-- Hero Section -->
19
+ <section id="hero" class="mb-16">
20
+ <div class="bg-yellow-500 rounded-xl p-8 md:p-12 shadow-lg">
21
+ <div class="flex flex-col md:flex-row items-center gap-8">
22
+ <div class="md:w-1/2">
23
+ <h1 class="text-4xl md:text-5xl font-bold text-gray-900 mb-4">Build Your Dream PC</h1>
24
+ <p class="text-xl text-gray-800 mb-6">Customize every component to create the perfect computer for your needs.</p>
25
+ <a href="#builder" class="bg-gray-900 hover:bg-gray-800 text-white px-6 py-3 rounded-lg font-medium transition-colors inline-block">Start Building</a>
26
+ </div>
27
+ <div class="md:w-1/2">
28
+ <img src="http://static.photos/technology/640x360/42" alt="Gaming PC" class="rounded-lg shadow-md w-full">
29
+ </div>
30
+ </div>
31
+ </div>
32
+ </section>
33
+
34
+ <!-- PC Builder Section -->
35
+ <section id="builder" class="mb-16">
36
+ <div class="bg-white rounded-xl shadow-lg overflow-hidden">
37
+ <div class="bg-gray-900 text-white px-6 py-4">
38
+ <h2 class="text-2xl font-bold">PC Configuration Tool</h2>
39
+ </div>
40
+ <div class="p-6">
41
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
42
+ <!-- Component Selection -->
43
+ <div class="md:col-span-2">
44
+ <div class="mb-8">
45
+ <h3 class="text-xl font-semibold mb-4 text-gray-800">1. Select Processor (CPU)</h3>
46
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
47
+ <!-- CPU Cards will be populated by JavaScript -->
48
+ </div>
49
+ </div>
50
+
51
+ <div class="mb-8">
52
+ <h3 class="text-xl font-semibold mb-4 text-gray-800">2. Select Graphics Card (GPU)</h3>
53
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
54
+ <!-- GPU Cards will be populated by JavaScript -->
55
+ </div>
56
+ </div>
57
+
58
+ <div class="mb-8">
59
+ <h3 class="text-xl font-semibold mb-4 text-gray-800">3. Select Memory (RAM)</h3>
60
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
61
+ <!-- RAM Cards will be populated by JavaScript -->
62
+ </div>
63
+ </div>
64
+
65
+ <div class="mb-8">
66
+ <h3 class="text-xl font-semibold mb-4 text-gray-800">4. Select Storage</h3>
67
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
68
+ <!-- Storage Cards will be populated by JavaScript -->
69
+ </div>
70
+ </div>
71
+ </div>
72
+
73
+ <!-- Configuration Summary -->
74
+ <div class="md:col-span-1">
75
+ <div class="bg-gray-50 rounded-lg p-6 border border-gray-200 sticky top-4">
76
+ <h3 class="text-xl font-bold mb-4 text-gray-800">Your Build</h3>
77
+ <div id="build-summary" class="mb-6">
78
+ <p class="text-gray-500">Select components to see your build</p>
79
+ </div>
80
+ <div class="mb-4">
81
+ <h4 class="font-semibold text-gray-700 mb-2">Total Price:</h4>
82
+ <p id="total-price" class="text-3xl font-bold text-yellow-600">$0</p>
83
+ </div>
84
+ <button id="save-build" class="w-full bg-yellow-500 hover:bg-yellow-600 text-gray-900 font-medium py-3 px-4 rounded-lg transition-colors disabled:opacity-50" disabled>
85
+ Save Build
86
+ </button>
87
+ </div>
88
+ </div>
89
+ </div>
90
+ </div>
91
+ </div>
92
+ </section>
93
+
94
+ <!-- Prebuilt Systems Section -->
95
+ <section id="prebuilt" class="mb-16">
96
+ <h2 class="text-3xl font-bold text-center mb-12 text-gray-800">Prebuilt Systems</h2>
97
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
98
+ <div class="bg-white rounded-xl shadow-lg overflow-hidden">
99
+ <img src="http://static.photos/technology/640x360/43" alt="Starter PC" class="w-full h-48 object-cover">
100
+ <div class="p-6">
101
+ <h3 class="text-xl font-bold mb-2 text-gray-800">Starter PC</h3>
102
+ <p class="text-gray-600 mb-4">Perfect for everyday tasks and light gaming</p>
103
+ <ul class="space-y-2 mb-4">
104
+ <li class="flex items-center"><i data-feather="check" class="text-yellow-500 mr-2"></i> AMD Ryzen 5 5600G</li>
105
+ <li class="flex items-center"><i data-feather="check" class="text-yellow-500 mr-2"></i> 16GB DDR4 RAM</li>
106
+ <li class="flex items-center"><i data-feather="check" class="text-yellow-500 mr-2"></i> 512GB SSD</li>
107
+ </ul>
108
+ <div class="flex justify-between items-center">
109
+ <span class="text-2xl font-bold text-yellow-600">$499</span>
110
+ <button class="bg-yellow-500 hover:bg-yellow-600 text-gray-900 font-medium py-2 px-4 rounded-lg transition-colors">
111
+ Customize
112
+ </button>
113
+ </div>
114
+ </div>
115
+ </div>
116
+
117
+ <div class="bg-white rounded-xl shadow-lg overflow-hidden">
118
+ <img src="http://static.photos/technology/640x360/44" alt="Gaming PC" class="w-full h-48 object-cover">
119
+ <div class="p-6">
120
+ <h3 class="text-xl font-bold mb-2 text-gray-800">Gaming PC</h3>
121
+ <p class="text-gray-600 mb-4">High performance for modern games</p>
122
+ <ul class="space-y-2 mb-4">
123
+ <li class="flex items-center"><i data-feather="check" class="text-yellow-500 mr-2"></i> Intel Core i7-12700K</li>
124
+ <li class="flex items-center"><i data-feather="check" class="text-yellow-500 mr-2"></i> NVIDIA RTX 3070</li>
125
+ <li class="flex items-center"><i data-feather="check" class="text-yellow-500 mr-2"></i> 32GB DDR4 RAM</li>
126
+ <li class="flex items-center"><i data-feather="check" class="text-yellow-500 mr-2"></i> 1TB NVMe SSD</li>
127
+ </ul>
128
+ <div class="flex justify-between items-center">
129
+ <span class="text-2xl font-bold text-yellow-600">$1299</span>
130
+ <button class="bg-yellow-500 hover:bg-yellow-600 text-gray-900 font-medium py-2 px-4 rounded-lg transition-colors">
131
+ Customize
132
+ </button>
133
+ </div>
134
+ </div>
135
+ </div>
136
+
137
+ <div class="bg-white rounded-xl shadow-lg overflow-hidden">
138
+ <img src="http://static.photos/technology/640x360/45" alt="Workstation" class="w-full h-48 object-cover">
139
+ <div class="p-6">
140
+ <h3 class="text-xl font-bold mb-2 text-gray-800">Workstation</h3>
141
+ <p class="text-gray-600 mb-4">For content creators and professionals</p>
142
+ <ul class="space-y-2 mb-4">
143
+ <li class="flex items-center"><i data-feather="check" class="text-yellow-500 mr-2"></i> AMD Ryzen 9 7950X</li>
144
+ <li class="flex items-center"><i data-feather="check" class="text-yellow-500 mr-2"></i> NVIDIA RTX 4090</li>
145
+ <li class="flex items-center"><i data-feather="check" class="text-yellow-500 mr-2"></i> 64GB DDR5 RAM</li>
146
+ <li class="flex items-center"><i data-feather="check" class="text-yellow-500 mr-2"></i> 2TB NVMe SSD</li>
147
+ </ul>
148
+ <div class="flex justify-between items-center">
149
+ <span class="text-2xl font-bold text-yellow-600">$2999</span>
150
+ <button class="bg-yellow-500 hover:bg-yellow-600 text-gray-900 font-medium py-2 px-4 rounded-lg transition-colors">
151
+ Customize
152
+ </button>
153
+ </div>
154
+ </div>
155
+ </div>
156
+ </div>
157
+ </section>
158
+ </main>
159
+
160
+ <custom-footer></custom-footer>
161
+
162
+ <script src="components/navbar.js"></script>
163
+ <script src="components/footer.js"></script>
164
+ <script src="script.js"></script>
165
+ <script>
166
+ feather.replace();
167
+ VANTA.NET({
168
+ el: "#hero",
169
+ mouseControls: true,
170
+ touchControls: true,
171
+ gyroControls: false,
172
+ minHeight: 200.00,
173
+ minWidth: 200.00,
174
+ scale: 1.00,
175
+ scaleMobile: 1.00,
176
+ color: 0xfbbf24,
177
+ backgroundColor: 0xf3f4f6,
178
+ points: 10.00,
179
+ maxDistance: 20.00,
180
+ spacing: 15.00
181
+ });
182
+ </script>
183
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
184
+ </body>
185
+ </html>
script.js ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Main application logic
2
+ document.addEventListener('DOMContentLoaded', () => {
3
+ // Component data
4
+ const components = {
5
+ cpu: [
6
+ { id: 1, name: 'AMD Ryzen 5 5600X', price: 199, cores: 6, threads: 12, speed: '3.7GHz', img: 'http://static.photos/technology/200x200/1' },
7
+ { id: 2, name: 'Intel Core i5-12600K', price: 249, cores: 10, threads: 16, speed: '3.7GHz', img: 'http://static.photos/technology/200x200/2' },
8
+ { id: 3, name: 'AMD Ryzen 7 5800X3D', price: 349, cores: 8, threads: 16, speed: '3.4GHz', img: 'http://static.photos/technology/200x200/3' },
9
+ { id: 4, name: 'Intel Core i9-13900K', price: 599, cores: 24, threads: 32, speed: '3.0GHz', img: 'http://static.photos/technology/200x200/4' }
10
+ ],
11
+ gpu: [
12
+ { id: 1, name: 'NVIDIA GeForce RTX 3060', price: 329, vram: '12GB', img: 'http://static.photos/technology/200x200/5' },
13
+ { id: 2, name: 'AMD Radeon RX 6700 XT', price: 379, vram: '12GB', img: 'http://static.photos/technology/200x200/6' },
14
+ { id: 3, name: 'NVIDIA GeForce RTX 4070', price: 599, vram: '12GB', img: 'http://static.photos/technology/200x200/7' },
15
+ { id: 4, name: 'AMD Radeon RX 7900 XTX', price: 999, vram: '24GB', img: 'http://static.photos/technology/200x200/8' }
16
+ ],
17
+ ram: [
18
+ { id: 1, name: '16GB DDR4 3200MHz', price: 59, type: 'DDR4', speed: '3200MHz', img: 'http://static.photos/technology/200x200/9' },
19
+ { id: 2, name: '32GB DDR4 3600MHz', price: 99, type: 'DDR4', speed: '3600MHz', img: 'http://static.photos/technology/200x200/10' },
20
+ { id: 3, name: '32GB DDR5 5600MHz', price: 149, type: 'DDR5', speed: '5600MHz', img: 'http://static.photos/technology/200x200/11' },
21
+ { id: 4, name: '64GB DDR5 6000MHz', price: 249, type: 'DDR5', speed: '6000MHz', img: 'http://static.photos/technology/200x200/12' }
22
+ ],
23
+ storage: [
24
+ { id: 1, name: '500GB NVMe SSD', price: 49, type: 'NVMe', capacity: '500GB', img: 'http://static.photos/technology/200x200/13' },
25
+ { id: 2, name: '1TB NVMe SSD', price: 79, type: 'NVMe', capacity: '1TB', img: 'http://static.photos/technology/200x200/14' },
26
+ { id: 3, name: '2TB NVMe SSD', price: 149, type: 'NVMe', capacity: '2TB', img: 'http://static.photos/technology/200x200/15' },
27
+ { id: 4, name: '4TB HDD + 1TB SSD', price: 199, type: 'Hybrid', capacity: '5TB', img: 'http://static.photos/technology/200x200/16' }
28
+ ]
29
+ };
30
+
31
+ // Current build
32
+ const currentBuild = {
33
+ cpu: null,
34
+ gpu: null,
35
+ ram: null,
36
+ storage: null
37
+ };
38
+
39
+ // Render component options
40
+ function renderComponentOptions(type, containerSelector) {
41
+ const container = document.querySelector(containerSelector);
42
+ container.innerHTML = '';
43
+
44
+ components[type].forEach(component => {
45
+ const card = document.createElement('div');
46
+ card.className = 'component-card bg-white p-4 rounded-lg cursor-pointer border border-gray-200';
47
+ card.innerHTML = `
48
+ <img src="${component.img}" alt="${component.name}" class="w-full h-32 object-contain mb-4">
49
+ <h4 class="font-semibold text-gray-800 mb-1">${component.name}</h4>
50
+ <p class="text-gray-600 text-sm mb-2">${component.cores ? `${component.cores}C/${component.threads}T` : ''} ${component.vram ? `VRAM: ${component.vram}` : ''} ${component.speed ? `Speed: ${component.speed}` : ''} ${component.capacity ? `Capacity: ${component.capacity}` : ''}</p>
51
+ <p class="text-yellow-600 font-bold">$${component.price}</p>
52
+ `;
53
+
54
+ card.addEventListener('click', () => {
55
+ // Remove selected class from all cards in this container
56
+ document.querySelectorAll(`${containerSelector} .component-card`).forEach(c => {
57
+ c.classList.remove('selected');
58
+ });
59
+
60
+ // Add selected class to clicked card
61
+ card.classList.add('selected');
62
+
63
+ // Update current build
64
+ currentBuild[type] = component;
65
+ updateBuildSummary();
66
+ });
67
+
68
+ container.appendChild(card);
69
+ });
70
+ }
71
+
72
+ // Update build summary
73
+ function updateBuildSummary() {
74
+ const summaryContainer = document.getElementById('build-summary');
75
+ const totalPriceElement = document.getElementById('total-price');
76
+ const saveButton = document.getElementById('save-build');
77
+
78
+ let totalPrice = 0;
79
+ let summaryHTML = '';
80
+
81
+ for (const [type, component] of Object.entries(currentBuild)) {
82
+ if (component) {
83
+ totalPrice += component.price;
84
+ summaryHTML += `
85
+ <div class="flex justify-between items-center py-2 border-b border-gray-200">
86
+ <span class="text-gray-700">${type.toUpperCase()}:</span>
87
+ <div class="flex items-center">
88
+ <span class="font-medium">${component.name}</span>
89
+ <span class="ml-2 text-yellow-600 font-bold">$${component.price}</span>
90
+ </div>
91
+ </div>
92
+ `;
93
+ }
94
+ }
95
+
96
+ if (totalPrice > 0) {
97
+ summaryContainer.innerHTML = summaryHTML;
98
+ totalPriceElement.textContent = `$${totalPrice}`;
99
+ totalPriceElement.classList.add('price-updated');
100
+ setTimeout(() => {
101
+ totalPriceElement.classList.remove('price-updated');
102
+ }, 500);
103
+ saveButton.disabled = false;
104
+ } else {
105
+ summaryContainer.innerHTML = '<p class="text-gray-500">Select components to see your build</p>';
106
+ totalPriceElement.textContent = '$0';
107
+ saveButton.disabled = true;
108
+ }
109
+ }
110
+
111
+ // Save build
112
+ document.getElementById('save-build').addEventListener('click', () => {
113
+ const buildName = prompt('Give your build a name:');
114
+ if (buildName) {
115
+ alert(`Build "${buildName}" saved successfully!`);
116
+ // In a real app, you would save to localStorage or send to a server
117
+ }
118
+ });
119
+
120
+ // Initialize component selectors
121
+ renderComponentOptions('cpu', '#builder > div > div > div:nth-child(1) > div');
122
+ renderComponentOptions('gpu', '#builder > div > div > div:nth-child(2) > div');
123
+ renderComponentOptions('ram', '#builder > div > div > div:nth-child(3) > div');
124
+ renderComponentOptions('storage', '#builder > div > div > div:nth-child(4) > div');
125
+
126
+ // Feather icons replacement
127
+ feather.replace();
128
+ });
style.css CHANGED
@@ -1,28 +1,52 @@
 
1
  body {
2
- padding: 2rem;
3
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
 
 
4
  }
5
 
6
- h1 {
7
- font-size: 16px;
8
- margin-top: 0;
9
  }
10
 
11
- p {
12
- color: rgb(107, 114, 128);
13
- font-size: 15px;
14
- margin-bottom: 10px;
15
- margin-top: 5px;
16
  }
17
 
18
- .card {
19
- max-width: 620px;
20
- margin: 0 auto;
21
- padding: 16px;
22
- border: 1px solid lightgray;
23
- border-radius: 16px;
24
  }
25
 
26
- .card p:last-child {
27
- margin-bottom: 0;
28
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Base styles */
2
  body {
3
+ font-family: 'Inter', system-ui, -apple-system, sans-serif;
4
+ min-height: 100vh;
5
+ display: flex;
6
+ flex-direction: column;
7
  }
8
 
9
+ /* Custom scrollbar */
10
+ ::-webkit-scrollbar {
11
+ width: 8px;
12
  }
13
 
14
+ ::-webkit-scrollbar-track {
15
+ background: #f1f1f1;
 
 
 
16
  }
17
 
18
+ ::-webkit-scrollbar-thumb {
19
+ background: #d1d5db;
20
+ border-radius: 4px;
 
 
 
21
  }
22
 
23
+ ::-webkit-scrollbar-thumb:hover {
24
+ background: #9ca3af;
25
  }
26
+
27
+ /* Component selection cards */
28
+ .component-card {
29
+ transition: all 0.2s ease;
30
+ border: 2px solid transparent;
31
+ }
32
+
33
+ .component-card:hover {
34
+ transform: translateY(-2px);
35
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
36
+ }
37
+
38
+ .component-card.selected {
39
+ border-color: #f59e0b;
40
+ background-color: #fef3c7;
41
+ }
42
+
43
+ /* Animation for total price */
44
+ @keyframes pulse {
45
+ 0% { transform: scale(1); }
46
+ 50% { transform: scale(1.05); }
47
+ 100% { transform: scale(1); }
48
+ }
49
+
50
+ .price-updated {
51
+ animation: pulse 0.5s ease-in-out;
52
+ }