File size: 13,193 Bytes
aa61ed8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336a868
aa61ed8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336a868
 
 
aa61ed8
 
336a868
 
 
aa61ed8
 
336a868
 
 
aa61ed8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336a868
 
aa61ed8
 
 
 
 
 
 
 
 
 
 
baa6825
aa61ed8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336a868
aa61ed8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336a868
aa61ed8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336a868
 
aa61ed8
 
 
 
 
336a868
aa61ed8
 
 
 
 
 
 
 
baa6825
aa61ed8
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Crafty Configurator Hub | Customize</title>
    <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <style>
        .customization-panel {
            transition: all 0.3s ease;
        }
        .option-selected {
            border-color: #667eea;
            background-color: #f0f4ff;
        }
        .preview-container {
            perspective: 1000px;
        }
        .product-preview {
            transition: transform 0.5s ease;
        }
    </style>
</head>
<body class="bg-gray-50">
    <nav class="bg-white shadow-sm">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between h-16">
                <div class="flex items-center">
                    <i data-feather="package" class="text-indigo-600"></i>
                    <span class="ml-2 text-xl font-semibold text-gray-900">Crafty Configurator</span>
                </div>
                <div class="flex items-center">
                    <button id="logoutBtn" class="text-gray-500 hover:text-gray-700 px-3 py-2 rounded-md text-sm font-medium flex items-center">
                        <i data-feather="log-out" class="mr-1"></i> Logout
                    </button>
                </div>
            </div>
        </div>
    </nav>

    <main class="max-w-7xl mx-auto py-8 px-4 sm:px-6 lg:px-8">
        <div class="flex flex-col lg:flex-row gap-8">
            <!-- Product Preview -->
            <div class="lg:w-1/2 preview-container">
                <div class="bg-white rounded-lg shadow-md p-6 sticky top-8 product-preview">
                    <h2 class="text-2xl font-bold text-gray-900 mb-4" id="productTitle">Premium Watch</h2>
                    <div class="flex justify-center mb-6">
                        <img src="http://static.photos/retail/640x360/1" alt="Product Preview" id="productPreview" class="max-h-80 object-contain">
                    </div>
                    <div class="border-t border-gray-200 pt-4">
                        <h3 class="text-lg font-medium text-gray-900 mb-2">Your Selections:</h3>
                        <ul id="selectedOptions" class="space-y-1 text-gray-600">
                            <!-- Options will be added here dynamically -->
                        </ul>
                    </div>
</div>
            </div>

            <!-- Customization Options -->
            <div class="lg:w-1/2 space-y-8">
                <div class="bg-white rounded-lg shadow-md overflow-hidden">
                    <div class="p-6">
                        <h2 class="text-2xl font-bold text-gray-900 mb-6">Customize Your Product</h2>
                        
                        <!-- Color Options -->
                        <div class="mb-8 customization-panel">
                            <h3 class="text-lg font-medium text-gray-900 mb-3">Color</h3>
                            <div class="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-3">
                                <div class="option-selector h-12 rounded-md border-2 border-transparent cursor-pointer flex items-center justify-center bg-red-500" 
                                    data-option="color" data-value="red" onclick="selectOption(this)"></div>
                                <div class="option-selector h-12 rounded-md border-2 border-transparent cursor-pointer flex items-center justify-center bg-blue-500" 
                                    data-option="color" data-value="blue" onclick="selectOption(this)"></div>
                                <div class="option-selector h-12 rounded-md border-2 border-transparent cursor-pointer flex items-center justify-center bg-green-500" 
                                    data-option="color" data-value="green" onclick="selectOption(this)"></div>
                                <div class="option-selector h-12 rounded-md border-2 border-transparent cursor-pointer flex items-center justify-center bg-yellow-500" 
                                    data-option="color" data-value="yellow" onclick="selectOption(this)"></div>
                                <div class="option-selector h-12 rounded-md border-2 border-transparent cursor-pointer flex items-center justify-center bg-black" 
                                    data-option="color" data-value="black" onclick="selectOption(this)"></div>
                            </div>
                        </div>

                        <!-- Material Options -->
                        <div class="mb-8 customization-panel">
                            <h3 class="text-lg font-medium text-gray-900 mb-3">Material</h3>
                            <div class="grid grid-cols-2 sm:grid-cols-3 gap-3">
                                <div class="option-selector p-3 rounded-md border-2 border-transparent cursor-pointer bg-gray-100"
                                    data-option="material" data-value="leather" onclick="selectOption(this)">
<div class="font-medium text-gray-900">Leather</div>
                                    <div class="text-sm text-gray-500">Classic and durable</div>
                                </div>
                                <div class="option-selector p-3 rounded-md border-2 border-transparent cursor-pointer bg-gray-100"
                                    data-option="material" data-value="metal" onclick="selectOption(this)">
<div class="font-medium text-gray-900">Metal</div>
                                    <div class="text-sm text-gray-500">Premium finish</div>
                                </div>
                                <div class="option-selector p-3 rounded-md border-2 border-transparent cursor-pointer bg-gray-100"
                                    data-option="material" data-value="silicone" onclick="selectOption(this)">
<div class="font-medium text-gray-900">Silicone</div>
                                    <div class="text-sm text-gray-500">Lightweight & flexible</div>
                                </div>
                            </div>
                        </div>

                        <!-- Engraving Options -->
                        <div class="mb-8 customization-panel">
                            <h3 class="text-lg font-medium text-gray-900 mb-3">Personal Engraving</h3>
                            <div class="space-y-3">
                                <div>
                                    <label for="engravingText" class="block text-sm font-medium text-gray-700">Text (max 20 characters)</label>
                                    <input type="text" id="engravingText" maxlength="20" 
                                        class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
                                </div>
                                <div>
                                    <label for="engravingFont" class="block text-sm font-medium text-gray-700">Font Style</label>
                                    <select id="engravingFont" 
                                        class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
                                        <option value="standard">Standard</option>
                                        <option value="script">Script</option>
                                        <option value="block">Block</option>
                                        <option value="elegant">Elegant</option>
                                    </select>
                                </div>
                                <div>
                                    <label class="inline-flex items-center">
                                        <input type="checkbox" id="engravingPremium" class="form-checkbox h-4 w-4 text-indigo-600 transition duration-150 ease-in-out">
                                        <span class="ml-2 text-sm text-gray-700">Add premium engraving</span>
</label>
                                </div>
                            </div>
                        </div>

                        <!-- Additional Notes -->
                        <div class="mb-8">
                            <h3 class="text-lg font-medium text-gray-900 mb-3">Additional Requirements</h3>
                            <textarea id="additionalNotes" rows="3" 
                                class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500" 
                                placeholder="Any special requests or notes for your order..."></textarea>
                        </div>
<!-- Submit Button -->
                        <div class="pt-4 border-t border-gray-200">
                            <button id="submitRequestBtn" 
                                class="w-full flex justify-center py-3 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition-all duration-200">
                                Submit Customization Request
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>

    <script>
        feather.replace();
        let selectedOptions = {};
        // Get product from URL
const urlParams = new URLSearchParams(window.location.search);
        const product = urlParams.get('product');
        
        // Set product title and image based on selection
        document.addEventListener('DOMContentLoaded', function() {
            let productTitle = "Custom Product";
            let productImage = "http://static.photos/retail/640x360/1";
            
            switch(product) {
                case 'premium-watch':
                    productTitle = "Premium Watch";
                    productImage = "http://static.photos/retail/640x360/1";
                    break;
                case 'designer-bag':
                    productTitle = "Designer Bag";
                    productImage = "http://static.photos/retail/640x360/2";
                    break;
                case 'custom-sneakers':
                    productTitle = "Custom Sneakers";
                    productImage = "http://static.photos/retail/640x360/3";
                    break;
}
            
            document.getElementById('productTitle').textContent = productTitle;
            document.getElementById('productPreview').src = productImage;
            updateTotalPrice();
        });

        function selectOption(element) {
            const option = element.getAttribute('data-option');
            const value = element.getAttribute('data-value');
            const price = parseFloat(element.getAttribute('data-price')) || 0;
            
            // Remove selected class from all options in this category
            document.querySelectorAll(`[data-option="${option}"]`).forEach(el => {
                el.classList.remove('option-selected');
            });
            
            // Add selected class to clicked option
            element.classList.add('option-selected');
            
            // Store selection
            selectedOptions[option] = { value, price };
            
            // Update UI
            updateSelectedOptions();
            updateTotalPrice();
        }

        function updateSelectedOptions() {
            const container = document.getElementById('selectedOptions');
            container.innerHTML = '';
            
            for (const [option, data] of Object.entries(selectedOptions)) {
                const li = document.createElement('li');
                li.className = 'flex justify-between';
                li.innerHTML = `
                    <span class="capitalize">${option}:</span>
                    <span>${data.value}</span>
`;
                container.appendChild(li);
            }
        }

        function updateTotalPrice() {
}

        document.getElementById('engravingPremium').addEventListener('change', updateTotalPrice);
        
        document.getElementById('logoutBtn').addEventListener('click', function() {
            window.location.href = 'index.html';
        });

        document.getElementById('submitRequestBtn').addEventListener('click', function() {
// In a real app, you would send this data to the server
            alert('Customization request submitted successfully! Our team will review your request and contact you soon.');
            
            // Redirect to confirmation page or back to products
            // window.location.href = 'confirmation.html';
        });
    </script>
</body>
</html>