SafwatWho commited on
Commit
6f9d837
·
verified ·
1 Parent(s): 219115e

how well can you code

Browse files
Files changed (2) hide show
  1. README.md +8 -5
  2. index.html +254 -18
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Codecraft Masterpiece
3
- emoji: 🐢
4
- colorFrom: purple
5
- colorTo: blue
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: CodeCraft Masterpiece 🎨
3
+ colorFrom: red
4
+ colorTo: yellow
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://deepsite.hf.co).
index.html CHANGED
@@ -1,19 +1,255 @@
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>CodeCraft Showcase</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <script src="https://unpkg.com/feather-icons"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <style>
11
+ /* Custom scrollbar */
12
+ ::-webkit-scrollbar {
13
+ width: 8px;
14
+ }
15
+ ::-webkit-scrollbar-track {
16
+ background: #f1f1f1;
17
+ }
18
+ ::-webkit-scrollbar-thumb {
19
+ background: #888;
20
+ border-radius: 4px;
21
+ }
22
+ ::-webkit-scrollbar-thumb:hover {
23
+ background: #555;
24
+ }
25
+
26
+ /* Animation classes */
27
+ .fade-in {
28
+ animation: fadeIn 0.5s ease-in-out;
29
+ }
30
+ @keyframes fadeIn {
31
+ from { opacity: 0; transform: translateY(10px); }
32
+ to { opacity: 1; transform: translateY(0); }
33
+ }
34
+
35
+ .code-block {
36
+ font-family: 'Courier New', monospace;
37
+ tab-size: 2;
38
+ }
39
+ </style>
40
+ </head>
41
+ <body class="bg-gray-50 min-h-screen">
42
+ <!-- Navigation -->
43
+ <nav class="bg-indigo-600 text-white shadow-lg">
44
+ <div class="container mx-auto px-4 py-3 flex justify-between items-center">
45
+ <div class="flex items-center space-x-2">
46
+ <i data-feather="code" class="w-6 h-6"></i>
47
+ <span class="font-bold text-xl">CodeCraft</span>
48
+ </div>
49
+ <div class="hidden md:flex space-x-6">
50
+ <a href="#" class="hover:text-indigo-200 transition">Home</a>
51
+ <a href="#" class="hover:text-indigo-200 transition">Algorithms</a>
52
+ <a href="#" class="hover:text-indigo-200 transition">Data Structures</a>
53
+ <a href="#" class="hover:text-indigo-200 transition">Optimizations</a>
54
+ </div>
55
+ <button class="md:hidden">
56
+ <i data-feather="menu" class="w-6 h-6"></i>
57
+ </button>
58
+ </div>
59
+ </nav>
60
+
61
+ <!-- Hero Section -->
62
+ <section class="bg-gradient-to-r from-indigo-500 to-purple-600 text-white py-20">
63
+ <div class="container mx-auto px-4 text-center">
64
+ <h1 class="text-4xl md:text-6xl font-bold mb-6 fade-in">Coding Excellence Showcase</h1>
65
+ <p class="text-xl md:text-2xl mb-8 max-w-3xl mx-auto fade-in">
66
+ Demonstrating clean, efficient, and scalable code with modern best practices
67
+ </p>
68
+ <div class="flex justify-center space-x-4 fade-in">
69
+ <button class="bg-white text-indigo-600 px-6 py-3 rounded-lg font-semibold hover:bg-gray-100 transition shadow-lg">
70
+ View Examples
71
+ </button>
72
+ <button class="border-2 border-white px-6 py-3 rounded-lg font-semibold hover:bg-white hover:bg-opacity-10 transition">
73
+ Learn More
74
+ </button>
75
+ </div>
76
+ </div>
77
+ </section>
78
+
79
+ <!-- Code Showcase Section -->
80
+ <section class="py-16 bg-white">
81
+ <div class="container mx-auto px-4">
82
+ <h2 class="text-3xl font-bold text-center mb-12 text-gray-800">Algorithm Showcase</h2>
83
+
84
+ <div class="grid md:grid-cols-2 gap-8">
85
+ <!-- Binary Search Example -->
86
+ <div class="bg-gray-50 rounded-xl p-6 shadow-md hover:shadow-lg transition">
87
+ <div class="flex items-center mb-4">
88
+ <div class="bg-indigo-100 p-2 rounded-full mr-3">
89
+ <i data-feather="search" class="text-indigo-600 w-5 h-5"></i>
90
+ </div>
91
+ <h3 class="text-xl font-semibold text-gray-800">Binary Search</h3>
92
+ </div>
93
+ <p class="text-gray-600 mb-4">
94
+ Efficient O(log n) search algorithm that works on sorted arrays by repeatedly dividing the search interval in half.
95
+ </p>
96
+ <div class="bg-gray-800 rounded-lg p-4 overflow-x-auto">
97
+ <pre class="text-green-400 code-block"><code>function binarySearch(arr, target) {
98
+ let left = 0;
99
+ let right = arr.length - 1;
100
+
101
+ while (left <= right) {
102
+ const mid = Math.floor((left + right) / 2);
103
+
104
+ if (arr[mid] === target) return mid;
105
+ if (arr[mid] < target) left = mid + 1;
106
+ else right = mid - 1;
107
+ }
108
+
109
+ return -1; // Not found
110
+ }</code></pre>
111
+ </div>
112
+ <div class="mt-4 flex justify-between items-center">
113
+ <span class="text-sm text-gray-500">Time Complexity: O(log n)</span>
114
+ <button class="text-indigo-600 hover:text-indigo-800 text-sm font-medium">
115
+ View Details <i data-feather="arrow-right" class="w-4 h-4 inline ml-1"></i>
116
+ </button>
117
+ </div>
118
+ </div>
119
+
120
+ <!-- Merge Sort Example -->
121
+ <div class="bg-gray-50 rounded-xl p-6 shadow-md hover:shadow-lg transition">
122
+ <div class="flex items-center mb-4">
123
+ <div class="bg-purple-100 p-2 rounded-full mr-3">
124
+ <i data-feather="layers" class="text-purple-600 w-5 h-5"></i>
125
+ </div>
126
+ <h3 class="text-xl font-semibold text-gray-800">Merge Sort</h3>
127
+ </div>
128
+ <p class="text-gray-600 mb-4">
129
+ Divide-and-conquer algorithm with O(n log n) time complexity that recursively splits, sorts, and merges subarrays.
130
+ </p>
131
+ <div class="bg-gray-800 rounded-lg p-4 overflow-x-auto">
132
+ <pre class="text-green-400 code-block"><code>function mergeSort(arr) {
133
+ if (arr.length <= 1) return arr;
134
+
135
+ const mid = Math.floor(arr.length / 2);
136
+ const left = mergeSort(arr.slice(0, mid));
137
+ const right = mergeSort(arr.slice(mid));
138
+
139
+ return merge(left, right);
140
+ }
141
+
142
+ function merge(left, right) {
143
+ let result = [];
144
+ let i = 0, j = 0;
145
+
146
+ while (i < left.length && j < right.length) {
147
+ if (left[i] < right[j]) result.push(left[i++]);
148
+ else result.push(right[j++]);
149
+ }
150
+
151
+ return result.concat(left.slice(i)).concat(right.slice(j));
152
+ }</code></pre>
153
+ </div>
154
+ <div class="mt-4 flex justify-between items-center">
155
+ <span class="text-sm text-gray-500">Time Complexity: O(n log n)</span>
156
+ <button class="text-purple-600 hover:text-purple-800 text-sm font-medium">
157
+ View Details <i data-feather="arrow-right" class="w-4 h-4 inline ml-1"></i>
158
+ </button>
159
+ </div>
160
+ </div>
161
+ </div>
162
+ </div>
163
+ </section>
164
+
165
+ <!-- Best Practices Section -->
166
+ <section class="py-16 bg-gray-50">
167
+ <div class="container mx-auto px-4">
168
+ <h2 class="text-3xl font-bold text-center mb-12 text-gray-800">Coding Best Practices</h2>
169
+
170
+ <div class="grid md:grid-cols-3 gap-6">
171
+ <div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition">
172
+ <div class="bg-blue-100 w-12 h-12 rounded-full flex items-center justify-center mb-4">
173
+ <i data-feather="file-text" class="text-blue-600 w-6 h-6"></i>
174
+ </div>
175
+ <h3 class="text-xl font-semibold mb-3 text-gray-800">Readable Code</h3>
176
+ <p class="text-gray-600">
177
+ Use meaningful variable names, consistent indentation, and comments where necessary. Break complex operations into smaller functions.
178
+ </p>
179
+ </div>
180
+
181
+ <div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition">
182
+ <div class="bg-green-100 w-12 h-12 rounded-full flex items-center justify-center mb-4">
183
+ <i data-feather="zap" class="text-green-600 w-6 h-6"></i>
184
+ </div>
185
+ <h3 class="text-xl font-semibold mb-3 text-gray-800">Efficiency</h3>
186
+ <p class="text-gray-600">
187
+ Choose appropriate data structures and algorithms. Consider time and space complexity. Avoid unnecessary computations.
188
+ </p>
189
+ </div>
190
+
191
+ <div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition">
192
+ <div class="bg-red-100 w-12 h-12 rounded-full flex items-center justify-center mb-4">
193
+ <i data-feather="repeat" class="text-red-600 w-6 h-6"></i>
194
+ </div>
195
+ <h3 class="text-xl font-semibold mb-3 text-gray-800">Scalability</h3>
196
+ <p class="text-gray-600">
197
+ Design systems that can grow. Use modular architecture, avoid tight coupling, and plan for future requirements.
198
+ </p>
199
+ </div>
200
+ </div>
201
+ </div>
202
+ </section>
203
+
204
+ <!-- Footer -->
205
+ <footer class="bg-gray-800 text-white py-8">
206
+ <div class="container mx-auto px-4">
207
+ <div class="flex flex-col md:flex-row justify-between items-center">
208
+ <div class="mb-4 md:mb-0">
209
+ <div class="flex items-center space-x-2">
210
+ <i data-feather="code" class="w-6 h-6 text-indigo-400"></i>
211
+ <span class="font-bold text-xl">CodeCraft</span>
212
+ </div>
213
+ <p class="text-gray-400 mt-2">Crafting excellence in every line of code</p>
214
+ </div>
215
+ <div class="flex space-x-6">
216
+ <a href="#" class="text-gray-400 hover:text-white transition">
217
+ <i data-feather="github" class="w-5 h-5"></i>
218
+ </a>
219
+ <a href="#" class="text-gray-400 hover:text-white transition">
220
+ <i data-feather="twitter" class="w-5 h-5"></i>
221
+ </a>
222
+ <a href="#" class="text-gray-400 hover:text-white transition">
223
+ <i data-feather="linkedin" class="w-5 h-5"></i>
224
+ </a>
225
+ </div>
226
+ </div>
227
+ <div class="border-t border-gray-700 mt-8 pt-6 text-center text-gray-400 text-sm">
228
+ &copy; 2023 CodeCraft Masterpiece. All rights reserved.
229
+ </div>
230
+ </div>
231
+ </footer>
232
+
233
+ <script>
234
+ // Initialize feather icons
235
+ feather.replace();
236
+
237
+ // Simple animation for code blocks on scroll
238
+ document.addEventListener('DOMContentLoaded', () => {
239
+ const codeBlocks = document.querySelectorAll('.code-block');
240
+
241
+ const observer = new IntersectionObserver((entries) => {
242
+ entries.forEach(entry => {
243
+ if (entry.isIntersecting) {
244
+ entry.target.classList.add('fade-in');
245
+ }
246
+ });
247
+ }, { threshold: 0.1 });
248
+
249
+ codeBlocks.forEach(block => {
250
+ observer.observe(block);
251
+ });
252
+ });
253
+ </script>
254
+ </body>
255
  </html>