jfgrilmaffre commited on
Commit
3c90fc7
·
verified ·
1 Parent(s): 43f3639

je veux un site web qui permet d'accéder aux datasheets de produits semiconducteur de la société microchip. la page principale présentera un systeme de selection ( famille, type ... ) .

Browse files
Files changed (6) hide show
  1. README.md +8 -5
  2. components/footer.js +146 -0
  3. components/navbar.js +102 -0
  4. index.html +108 -19
  5. script.js +55 -0
  6. style.css +46 -18
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Microchip Data Explorer
3
- emoji: 😻
4
- colorFrom: yellow
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: MicroChip Data Explorer 🚀
3
+ colorFrom: green
4
+ colorTo: purple
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,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomFooter extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ :host {
7
+ display: block;
8
+ background-color: #1e293b;
9
+ color: white;
10
+ padding: 2rem 1rem;
11
+ margin-top: 4rem;
12
+ }
13
+
14
+ .footer-container {
15
+ max-width: 1440px;
16
+ margin: 0 auto;
17
+ display: grid;
18
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
19
+ gap: 2rem;
20
+ }
21
+
22
+ .footer-section h3 {
23
+ font-size: 1.125rem;
24
+ font-weight: 600;
25
+ margin-bottom: 1rem;
26
+ color: #e2e8f0;
27
+ }
28
+
29
+ .footer-links {
30
+ display: flex;
31
+ flex-direction: column;
32
+ gap: 0.5rem;
33
+ }
34
+
35
+ .footer-link {
36
+ color: #94a3b8;
37
+ text-decoration: none;
38
+ transition: color 0.2s;
39
+ }
40
+
41
+ .footer-link:hover {
42
+ color: #e2e8f0;
43
+ }
44
+
45
+ .footer-bottom {
46
+ max-width: 1440px;
47
+ margin: 2rem auto 0;
48
+ padding-top: 1.5rem;
49
+ border-top: 1px solid #334155;
50
+ display: flex;
51
+ flex-direction: column;
52
+ gap: 1rem;
53
+ align-items: center;
54
+ text-align: center;
55
+ }
56
+
57
+ .social-links {
58
+ display: flex;
59
+ gap: 1rem;
60
+ }
61
+
62
+ .social-link {
63
+ color: #94a3b8;
64
+ transition: color 0.2s;
65
+ }
66
+
67
+ .social-link:hover {
68
+ color: #e2e8f0;
69
+ }
70
+
71
+ .copyright {
72
+ color: #94a3b8;
73
+ font-size: 0.875rem;
74
+ }
75
+
76
+ @media (min-width: 768px) {
77
+ .footer-bottom {
78
+ flex-direction: row;
79
+ justify-content: space-between;
80
+ align-items: center;
81
+ text-align: left;
82
+ }
83
+ }
84
+ </style>
85
+
86
+ <div class="footer-container">
87
+ <div class="footer-section">
88
+ <h3>Products</h3>
89
+ <div class="footer-links">
90
+ <a href="#" class="footer-link">Microcontrollers</a>
91
+ <a href="#" class="footer-link">Microprocessors</a>
92
+ <a href="#" class="footer-link">Analog</a>
93
+ <a href="#" class="footer-link">Memory</a>
94
+ <a href="#" class="footer-link">Wireless</a>
95
+ </div>
96
+ </div>
97
+
98
+ <div class="footer-section">
99
+ <h3>Resources</h3>
100
+ <div class="footer-links">
101
+ <a href="#" class="footer-link">Datasheets</a>
102
+ <a href="#" class="footer-link">Application Notes</a>
103
+ <a href="#" class="footer-link">Reference Designs</a>
104
+ <a href="#" class="footer-link">Development Tools</a>
105
+ <a href="#" class="footer-link">Software</a>
106
+ </div>
107
+ </div>
108
+
109
+ <div class="footer-section">
110
+ <h3>Support</h3>
111
+ <div class="footer-links">
112
+ <a href="#" class="footer-link">Technical Support</a>
113
+ <a href="#" class="footer-link">Community</a>
114
+ <a href="#" class="footer-link">Training</a>
115
+ <a href="#" class="footer-link">Contact Us</a>
116
+ </div>
117
+ </div>
118
+
119
+ <div class="footer-section">
120
+ <h3>Company</h3>
121
+ <div class="footer-links">
122
+ <a href="#" class="footer-link">About Microchip</a>
123
+ <a href="#" class="footer-link">Careers</a>
124
+ <a href="#" class="footer-link">Investors</a>
125
+ <a href="#" class="footer-link">News</a>
126
+ </div>
127
+ </div>
128
+ </div>
129
+
130
+ <div class="footer-bottom">
131
+ <div class="social-links">
132
+ <a href="#" class="social-link"><i data-feather="twitter"></i></a>
133
+ <a href="#" class="social-link"><i data-feather="facebook"></i></a>
134
+ <a href="#" class="social-link"><i data-feather="linkedin"></i></a>
135
+ <a href="#" class="social-link"><i data-feather="youtube"></i></a>
136
+ <a href="#" class="social-link"><i data-feather="github"></i></a>
137
+ </div>
138
+ <div class="copyright">
139
+ &copy; ${new Date().getFullYear()} MicroChip Data Explorer. Not affiliated with Microchip Technology Inc.
140
+ </div>
141
+ </div>
142
+ `;
143
+ }
144
+ }
145
+
146
+ customElements.define('custom-footer', CustomFooter);
components/navbar.js ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomNavbar extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ :host {
7
+ display: block;
8
+ width: 100%;
9
+ background-color: white;
10
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
11
+ position: sticky;
12
+ top: 0;
13
+ z-index: 50;
14
+ }
15
+
16
+ nav {
17
+ display: flex;
18
+ justify-content: space-between;
19
+ align-items: center;
20
+ padding: 1rem 2rem;
21
+ max-width: 1440px;
22
+ margin: 0 auto;
23
+ }
24
+
25
+ .logo {
26
+ display: flex;
27
+ align-items: center;
28
+ text-decoration: none;
29
+ font-weight: 700;
30
+ font-size: 1.25rem;
31
+ color: #1e40af;
32
+ }
33
+
34
+ .logo-icon {
35
+ margin-right: 0.5rem;
36
+ }
37
+
38
+ .nav-links {
39
+ display: flex;
40
+ gap: 1.5rem;
41
+ }
42
+
43
+ .nav-link {
44
+ text-decoration: none;
45
+ color: #4b5563;
46
+ font-weight: 500;
47
+ transition: color 0.2s;
48
+ padding: 0.5rem 0;
49
+ position: relative;
50
+ }
51
+
52
+ .nav-link:hover {
53
+ color: #1e40af;
54
+ }
55
+
56
+ .nav-link.active {
57
+ color: #1e40af;
58
+ font-weight: 600;
59
+ }
60
+
61
+ .mobile-menu-btn {
62
+ display: none;
63
+ background: none;
64
+ border: none;
65
+ cursor: pointer;
66
+ color: #4b5563;
67
+ }
68
+
69
+ @media (max-width: 768px) {
70
+ .nav-links {
71
+ display: none;
72
+ }
73
+
74
+ .mobile-menu-btn {
75
+ display: block;
76
+ }
77
+ }
78
+ </style>
79
+
80
+ <nav>
81
+ <a href="/" class="logo">
82
+ <i data-feather="cpu" class="logo-icon"></i>
83
+ MicroChip Explorer
84
+ </a>
85
+
86
+ <div class="nav-links">
87
+ <a href="/" class="nav-link active">Home</a>
88
+ <a href="#" class="nav-link">Products</a>
89
+ <a href="#" class="nav-link">Documentation</a>
90
+ <a href="#" class="nav-link">Support</a>
91
+ <a href="#" class="nav-link">About</a>
92
+ </div>
93
+
94
+ <button class="mobile-menu-btn">
95
+ <i data-feather="menu"></i>
96
+ </button>
97
+ </nav>
98
+ `;
99
+ }
100
+ }
101
+
102
+ customElements.define('custom-navbar', CustomNavbar);
index.html CHANGED
@@ -1,19 +1,108 @@
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>MicroChip Data Explorer</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <script src="https://unpkg.com/feather-icons"></script>
11
+ <script src="components/navbar.js"></script>
12
+ <script src="components/footer.js"></script>
13
+ </head>
14
+ <body class="bg-gray-50 min-h-screen flex flex-col">
15
+ <custom-navbar></custom-navbar>
16
+
17
+ <main class="flex-grow container mx-auto px-4 py-8">
18
+ <section class="text-center mb-12">
19
+ <h1 class="text-4xl font-bold text-gray-800 mb-4">MicroChip Product Explorer</h1>
20
+ <p class="text-xl text-gray-600 max-w-3xl mx-auto">Access detailed datasheets for Microchip's semiconductor products with our comprehensive search system</p>
21
+ </section>
22
+
23
+ <div class="bg-white rounded-xl shadow-lg p-6 max-w-4xl mx-auto">
24
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
25
+ <div>
26
+ <label for="family" class="block text-sm font-medium text-gray-700 mb-2">Product Family</label>
27
+ <select id="family" class="w-full px-4 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
28
+ <option value="">Select Family</option>
29
+ <option value="mcu">Microcontrollers (MCU)</option>
30
+ <option value="mpu">Microprocessors (MPU)</option>
31
+ <option value="analog">Analog</option>
32
+ <option value="memory">Memory</option>
33
+ <option value="wireless">Wireless</option>
34
+ </select>
35
+ </div>
36
+ <div>
37
+ <label for="type" class="block text-sm font-medium text-gray-700 mb-2">Product Type</label>
38
+ <select id="type" class="w-full px-4 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-blue-500 focus:border-blue-500" disabled>
39
+ <option value="">Select Type</option>
40
+ </select>
41
+ </div>
42
+ </div>
43
+
44
+ <div class="mb-8">
45
+ <label for="search" class="block text-sm font-medium text-gray-700 mb-2">Search by Part Number</label>
46
+ <div class="relative">
47
+ <input type="text" id="search" placeholder="Enter part number (e.g. ATmega328P)" class="w-full px-4 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-blue-500 focus:border-blue-500 pr-10">
48
+ <i data-feather="search" class="absolute right-3 top-2.5 text-gray-400"></i>
49
+ </div>
50
+ </div>
51
+
52
+ <button id="search-btn" class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2.5 px-4 rounded-lg transition duration-200 flex items-center justify-center">
53
+ <i data-feather="search" class="mr-2"></i> Search Datasheets
54
+ </button>
55
+ </div>
56
+
57
+ <section class="mt-16 max-w-4xl mx-auto">
58
+ <h2 class="text-2xl font-semibold text-gray-800 mb-6">Popular Products</h2>
59
+ <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
60
+ <div class="bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition duration-200">
61
+ <div class="p-5">
62
+ <div class="flex items-center mb-3">
63
+ <div class="bg-blue-100 p-2 rounded-full">
64
+ <i data-feather="cpu" class="text-blue-600"></i>
65
+ </div>
66
+ <h3 class="ml-3 font-semibold text-gray-800">ATmega328P</h3>
67
+ </div>
68
+ <p class="text-gray-600 text-sm">8-bit AVR Microcontroller</p>
69
+ <a href="#" class="mt-4 inline-block text-blue-600 text-sm font-medium hover:underline">View Datasheet →</a>
70
+ </div>
71
+ </div>
72
+ <div class="bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition duration-200">
73
+ <div class="p-5">
74
+ <div class="flex items-center mb-3">
75
+ <div class="bg-blue-100 p-2 rounded-full">
76
+ <i data-feather="cpu" class="text-blue-600"></i>
77
+ </div>
78
+ <h3 class="ml-3 font-semibold text-gray-800">PIC16F877A</h3>
79
+ </div>
80
+ <p class="text-gray-600 text-sm">8-bit PIC Microcontroller</p>
81
+ <a href="#" class="mt-4 inline-block text-blue-600 text-sm font-medium hover:underline">View Datasheet →</a>
82
+ </div>
83
+ </div>
84
+ <div class="bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition duration-200">
85
+ <div class="p-5">
86
+ <div class="flex items-center mb-3">
87
+ <div class="bg-blue-100 p-2 rounded-full">
88
+ <i data-feather="cpu" class="text-blue-600"></i>
89
+ </div>
90
+ <h3 class="ml-3 font-semibold text-gray-800">SAM D21</h3>
91
+ </div>
92
+ <p class="text-gray-600 text-sm">32-bit ARM Cortex-M0+ MCU</p>
93
+ <a href="#" class="mt-4 inline-block text-blue-600 text-sm font-medium hover:underline">View Datasheet →</a>
94
+ </div>
95
+ </div>
96
+ </div>
97
+ </section>
98
+ </main>
99
+
100
+ <custom-footer></custom-footer>
101
+
102
+ <script src="script.js"></script>
103
+ <script>
104
+ feather.replace();
105
+ </script>
106
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
107
+ </body>
108
+ </html>
script.js ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ document.addEventListener('DOMContentLoaded', function() {
2
+ // Family and Type dropdown dependencies
3
+ const familyDropdown = document.getElementById('family');
4
+ const typeDropdown = document.getElementById('type');
5
+
6
+ // Product type options based on family
7
+ const productTypes = {
8
+ mcu: ['8-bit AVR', '8-bit PIC', '16-bit PIC', '32-bit ARM Cortex-M', '32-bit ARM Cortex-A'],
9
+ mpu: ['ARM-based', 'MIPS-based', 'RISC-V'],
10
+ analog: ['Amplifiers', 'Comparators', 'Data Converters', 'Interface', 'Power Management'],
11
+ memory: ['EEPROM', 'Flash', 'SRAM', 'FRAM'],
12
+ wireless: ['Bluetooth', 'Wi-Fi', 'LoRa', 'Zigbee', 'NFC']
13
+ };
14
+
15
+ // Update type dropdown based on family selection
16
+ familyDropdown.addEventListener('change', function() {
17
+ const selectedFamily = this.value;
18
+
19
+ typeDropdown.innerHTML = '<option value="">Select Type</option>';
20
+ typeDropdown.disabled = !selectedFamily;
21
+
22
+ if (selectedFamily) {
23
+ productTypes[selectedFamily].forEach(type => {
24
+ const option = document.createElement('option');
25
+ option.value = type.toLowerCase().replace(/\s+/g, '-');
26
+ option.textContent = type;
27
+ typeDropdown.appendChild(option);
28
+ });
29
+ }
30
+ });
31
+
32
+ // Search button functionality
33
+ document.getElementById('search-btn').addEventListener('click', function() {
34
+ const family = familyDropdown.value;
35
+ const type = typeDropdown.value;
36
+ const searchTerm = document.getElementById('search').value.trim();
37
+
38
+ if (!family && !searchTerm) {
39
+ alert('Please select a product family or enter a part number');
40
+ return;
41
+ }
42
+
43
+ // In a real app, this would fetch data from Microchip's API
44
+ console.log('Searching for:', { family, type, searchTerm });
45
+ alert('This would search Microchip\'s database in a real application');
46
+ });
47
+
48
+ // Responsive adjustments
49
+ function handleResize() {
50
+ // Add any responsive behaviors here
51
+ }
52
+
53
+ window.addEventListener('resize', handleResize);
54
+ handleResize();
55
+ });
style.css CHANGED
@@ -1,28 +1,56 @@
 
 
 
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
+ /* Custom styles that can't be done with Tailwind */
2
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
3
+
4
  body {
5
+ font-family: 'Inter', sans-serif;
6
+ }
7
+
8
+ /* Smooth scroll behavior */
9
+ html {
10
+ scroll-behavior: smooth;
11
+ }
12
+
13
+ /* Custom scrollbar */
14
+ ::-webkit-scrollbar {
15
+ width: 8px;
16
+ height: 8px;
17
  }
18
 
19
+ ::-webkit-scrollbar-track {
20
+ background: #f1f1f1;
 
21
  }
22
 
23
+ ::-webkit-scrollbar-thumb {
24
+ background: #888;
25
+ border-radius: 4px;
 
 
26
  }
27
 
28
+ ::-webkit-scrollbar-thumb:hover {
29
+ background: #555;
 
 
 
 
30
  }
31
 
32
+ /* Animation for cards */
33
+ .card-hover {
34
+ transition: all 0.3s ease;
35
  }
36
+
37
+ .card-hover:hover {
38
+ transform: translateY(-5px);
39
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
40
+ }
41
+
42
+ /* Responsive iframe container */
43
+ .responsive-iframe {
44
+ position: relative;
45
+ overflow: hidden;
46
+ padding-top: 56.25%;
47
+ }
48
+
49
+ .responsive-iframe iframe {
50
+ position: absolute;
51
+ top: 0;
52
+ left: 0;
53
+ width: 100%;
54
+ height: 100%;
55
+ border: 0;
56
+ }