Aviation169 commited on
Commit
cb48938
·
verified ·
1 Parent(s): 8103edb

Add more components and feature

Browse files
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Component Crafters Workshop
3
- emoji: 📈
4
- colorFrom: pink
5
- colorTo: purple
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: Component Crafters Workshop 🛠️
3
+ colorFrom: gray
4
+ colorTo: green
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/accordion.js ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomAccordion extends HTMLElement {
2
+ constructor() {
3
+ super();
4
+ this.attachShadow({ mode: 'open' });
5
+ this.shadowRoot.innerHTML = `
6
+ <style>
7
+ :host {
8
+ display: block;
9
+ max-width: 800px;
10
+ margin: 0 auto;
11
+ }
12
+ .accordion-item {
13
+ margin-bottom: 1rem;
14
+ border-radius: 0.5rem;
15
+ overflow: hidden;
16
+ box-shadow: 0 1px 3px rgba(0,0,0,0.1);
17
+ background-color: white;
18
+ }
19
+ .accordion-header {
20
+ display: flex;
21
+ justify-content: space-between;
22
+ align-items: center;
23
+ padding: 1rem 1.5rem;
24
+ cursor: pointer;
25
+ font-weight: 600;
26
+ color: #111827;
27
+ transition: background-color 0.3s;
28
+ }
29
+ .accordion-header:hover {
30
+ background-color: #f9fafb;
31
+ }
32
+ .accordion-header i {
33
+ transition: transform 0.3s;
34
+ }
35
+ .accordion-content {
36
+ padding: 0 1.5rem;
37
+ max-height: 0;
38
+ overflow: hidden;
39
+ transition: max-height 0.3s ease, padding 0.3s ease;
40
+ color: #6b7280;
41
+ }
42
+ .accordion-item.active .accordion-content {
43
+ max-height: 300px;
44
+ padding: 0 1.5rem 1.5rem;
45
+ }
46
+ .accordion-item.active .accordion-header i {
47
+ transform: rotate(180deg);
48
+ }
49
+ </style>
50
+ <div class="accordion">
51
+ <div class="accordion-item">
52
+ <div class="accordion-header">
53
+ <span>What components are available?</span>
54
+ <i data-feather="chevron-down"></i>
55
+ </div>
56
+ <div class="accordion-content">
57
+ <p>We offer a wide range of components including cards, navigation bars, forms, accordions, testimonials, and more. Each component is fully responsive and customizable.</p>
58
+ </div>
59
+ </div>
60
+ <div class="accordion-item">
61
+ <div class="accordion-header">
62
+ <span>How do I use these components?</span>
63
+ <i data-feather="chevron-down"></i>
64
+ </div>
65
+ <div class="accordion-content">
66
+ <p>Simply include the component script in your HTML file and use the custom element tag. All components are documented with usage examples.</p>
67
+ </div>
68
+ </div>
69
+ <div class="accordion-item">
70
+ <div class="accordion-header">
71
+ <span>Are these components free to use?</span>
72
+ <i data-feather="chevron-down"></i>
73
+ </div>
74
+ <div class="accordion-content">
75
+ <p>Yes! All components are MIT licensed and free to use in both personal and commercial projects. Attribution is appreciated but not required.</p>
76
+ </div>
77
+ </div>
78
+ </div>
79
+ `;
80
+
81
+ this.shadowRoot.querySelectorAll('.accordion-header').forEach(header => {
82
+ header.addEventListener('click', () => {
83
+ const item = header.parentElement;
84
+ item.classList.toggle('active');
85
+ });
86
+ });
87
+ }
88
+ }
89
+ customElements.define('custom-accordion', CustomAccordion);
components/card.js ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomCard extends HTMLElement {
2
+ static get observedAttributes() {
3
+ return ['title', 'description', 'icon'];
4
+ }
5
+
6
+ constructor() {
7
+ super();
8
+ this.attachShadow({ mode: 'open' });
9
+ }
10
+
11
+ connectedCallback() {
12
+ this.render();
13
+ }
14
+
15
+ attributeChangedCallback() {
16
+ this.render();
17
+ }
18
+
19
+ render() {
20
+ const title = this.getAttribute('title') || 'Card Title';
21
+ const description = this.getAttribute('description') || 'Default card description';
22
+ const icon = this.getAttribute('icon') || 'box';
23
+
24
+ this.shadowRoot.innerHTML = `
25
+ <style>
26
+ :host {
27
+ display: block;
28
+ }
29
+ .card {
30
+ background-color: white;
31
+ border-radius: 0.5rem;
32
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
33
+ padding: 1.5rem;
34
+ transition: all 0.3s ease;
35
+ height: 100%;
36
+ }
37
+ .card:hover {
38
+ transform: translateY(-4px);
39
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
40
+ }
41
+ .card-icon {
42
+ width: 3rem;
43
+ height: 3rem;
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: center;
47
+ background-color: #e0e7ff;
48
+ border-radius: 0.5rem;
49
+ margin-bottom: 1rem;
50
+ color: #4f46e5;
51
+ }
52
+ .card-title {
53
+ font-size: 1.25rem;
54
+ font-weight: 600;
55
+ margin-bottom: 0.5rem;
56
+ color: #111827;
57
+ }
58
+ .card-description {
59
+ color: #6b7280;
60
+ line-height: 1.5;
61
+ }
62
+ </style>
63
+ <div class="card">
64
+ <div class="card-icon">
65
+ <i data-feather="${icon}"></i>
66
+ </div>
67
+ <h3 class="card-title">${title}</h3>
68
+ <p class="card-description">${description}</p>
69
+ </div>
70
+ `;
71
+ }
72
+ }
73
+ customElements.define('custom-card', CustomCard);
components/navbar.js ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 4px rgba(0,0,0,0.1);
11
+ position: sticky;
12
+ top: 0;
13
+ z-index: 50;
14
+ }
15
+ nav {
16
+ display: flex;
17
+ justify-content: space-between;
18
+ align-items: center;
19
+ padding: 1rem 2rem;
20
+ max-width: 1200px;
21
+ margin: 0 auto;
22
+ }
23
+ .logo {
24
+ font-size: 1.5rem;
25
+ font-weight: bold;
26
+ color: #4f46e5;
27
+ display: flex;
28
+ align-items: center;
29
+ gap: 0.5rem;
30
+ }
31
+ .nav-links {
32
+ display: flex;
33
+ gap: 2rem;
34
+ }
35
+ .nav-links a {
36
+ color: #4b5563;
37
+ text-decoration: none;
38
+ font-weight: 500;
39
+ transition: color 0.3s;
40
+ }
41
+ .nav-links a:hover {
42
+ color: #4f46e5;
43
+ }
44
+ .mobile-menu-btn {
45
+ display: none;
46
+ background: none;
47
+ border: none;
48
+ cursor: pointer;
49
+ }
50
+ @media (max-width: 768px) {
51
+ .nav-links {
52
+ display: none;
53
+ }
54
+ .mobile-menu-btn {
55
+ display: block;
56
+ }
57
+ }
58
+ </style>
59
+ <nav>
60
+ <a href="/" class="logo">
61
+ <i data-feather="package"></i>
62
+ ComponentCraft
63
+ </a>
64
+ <div class="nav-links">
65
+ <a href="#components">Components</a>
66
+ <a href="#features">Features</a>
67
+ <a href="#testimonials">Testimonials</a>
68
+ <a href="#contact">Contact</a>
69
+ </div>
70
+ <button class="mobile-menu-btn">
71
+ <i data-feather="menu"></i>
72
+ </button>
73
+ </nav>
74
+ `;
75
+ }
76
+ }
77
+ customElements.define('custom-navbar', CustomNavbar);
components/newsletter.js ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomNewsletter extends HTMLElement {
2
+ constructor() {
3
+ super();
4
+ this.attachShadow({ mode: 'open' });
5
+ this.shadowRoot.innerHTML = `
6
+ <style>
7
+ :host {
8
+ display: block;
9
+ max-width: 600px;
10
+ margin: 0 auto;
11
+ background-color: white;
12
+ border-radius: 0.5rem;
13
+ padding: 2rem;
14
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
15
+ }
16
+ .newsletter-title {
17
+ font-size: 1.5rem;
18
+ font-weight: 600;
19
+ margin-bottom: 1rem;
20
+ color: #111827;
21
+ text-align: center;
22
+ }
23
+ .newsletter-description {
24
+ color: #6b7280;
25
+ text-align: center;
26
+ margin-bottom: 2rem;
27
+ }
28
+ .newsletter-form {
29
+ display: flex;
30
+ flex-direction: column;
31
+ gap: 1rem;
32
+ }
33
+ .form-group {
34
+ display: flex;
35
+ flex-direction: column;
36
+ gap: 0.5rem;
37
+ }
38
+ .form-label {
39
+ font-weight: 500;
40
+ color: #374151;
41
+ }
42
+ .form-input {
43
+ padding: 0.75rem 1rem;
44
+ border: 1px solid #d1d5db;
45
+ border-radius: 0.375rem;
46
+ font-size: 1rem;
47
+ transition: border-color 0.3s;
48
+ }
49
+ .form-input:focus {
50
+ outline: none;
51
+ border-color: #4f46e5;
52
+ }
53
+ .submit-btn {
54
+ background-color: #4f46e5;
55
+ color: white;
56
+ padding: 0.75rem 1rem;
57
+ border: none;
58
+ border-radius: 0.375rem;
59
+ font-size: 1rem;
60
+ font-weight: 500;
61
+ cursor: pointer;
62
+ transition: background-color 0.3s;
63
+ }
components/testimonials.js ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomTestimonials extends HTMLElement {
2
+ constructor() {
3
+ super();
4
+ this.attachShadow({ mode: 'open' });
5
+ this.testimonials = [
6
+ {
7
+ name: "Sarah Johnson",
8
+ role: "Frontend Developer",
9
+ content: "These components saved me countless hours of development time. The quality is exceptional and they integrate seamlessly with my projects.",
10
+ avatar: "http://static.photos/people/200x200/1"
11
+ },
12
+ {
13
+ name: "Michael Chen",
14
+ role: "UI Designer",
15
+ content: "As a designer, I appreciate the attention to detail in these components. They're beautiful out of the box but also easy to customize.",
16
+ avatar: "http://static.photos/people/200x200/2"
17
+ },
18
+ {
19
+ name: "Emma Rodriguez",
20
+ role: "Product Manager",
21
+ content: "Our team's productivity has increased dramatically since we started using these components. Highly recommended!",
22
+ avatar: "http://static.photos/people/200x200/3"
23
+ }
24
+ ];
25
+
26
+ this.render();
27
+ }
28
+
29
+ render() {
30
+ this.shadowRoot.innerHTML = `
31
+ <style>
32
+ :host {
33
+ display: block;
34
+ }
35
+ .testimonials-container {
36
+ max-width: 1200px;
37
+ margin: 0 auto;
38
+ }
39
+ .section-title {
40
+ text-align: center;
41
+ font-size: 2rem;
42
+ font-weight: 700;
43
+ margin-bottom: 3rem;
44
+ color: #111827;
45
+ }
46
+ .testimonials-grid {
47
+ display: grid;
48
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
49
+ gap: 2rem;
50
+ }
51
+ .testimonial-card {
52
+ background-color: white;
53
+ border-radius: 0.5rem;
54
+ padding: 2rem;
55
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
56
+ transition: all 0.3s ease;
57
+ }
58
+ .testimonial-card:hover {
59
+ transform: translateY(-5px);
60
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
61
+ }
62
+ .testimonial-content {
63
+ font-style: italic;
64
+ color: #4b5563;
65
+ margin-bottom: 1.5rem;
66
+ line-height: 1.6;
67
+ }
68
+ .testimonial-author {
69
+ display: flex;
70
+ align-items: center;
71
+ gap: 1rem;
72
+ }
73
+ .author-avatar {
74
+ width: 50px;
75
+ height: 50px;
76
+ border-radius: 50%;
77
+ object-fit: cover;
78
+ }
79
+ .author-info {
80
+ display: flex;
81
+ flex-direction: column;
82
+ }
83
+ .author-name {
84
+ font-weight: 600;
85
+ color: #111827;
86
+ }
87
+ .author-role {
88
+ color: #6b7280;
89
+ font-size: 0.875rem;
90
+ }
91
+ </style>
92
+ <div class="testimonials-container">
93
+ <h2 class="section-title">What People Are Saying</h2>
94
+ <div class="testimonials-grid">
95
+ ${this.testimonials.map(testimonial => `
96
+ <div class="testimonial-card">
97
+ <p class="testimonial-content">"${testimonial.content}"</p>
98
+ <div class="testimonial-author">
99
+ <img src="${testimonial.avatar}" alt="${testimonial.name}" class="author-avatar">
100
+ <div class="author-info">
101
+ <span class="author-name">${testimonial.name}</span>
102
+ <span class="author-role">${testimonial.role}</span>
103
+ </div>
104
+ </div>
105
+ </div>
106
+ `).join('')}
107
+ </div>
108
+ </div>
109
+ `;
110
+ }
111
+ }
112
+ customElements.define('custom-testimonials', CustomTestimonials);
index.html CHANGED
@@ -1,19 +1,67 @@
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>Component Crafters Workshop</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
+ </head>
12
+ <body class="bg-gray-100 min-h-screen">
13
+ <custom-navbar></custom-navbar>
14
+ <main class="container mx-auto px-4 py-8">
15
+ <section class="mb-12">
16
+ <h1 class="text-4xl font-bold text-center mb-8">Component Crafters Workshop</h1>
17
+ <p class="text-xl text-center text-gray-600 max-w-2xl mx-auto">
18
+ Explore our collection of beautifully crafted UI components ready to enhance your projects.
19
+ </p>
20
+ </section>
21
+
22
+ <section class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 mb-12">
23
+ <custom-card
24
+ title="Interactive Cards"
25
+ description="Beautiful animated cards with hover effects"
26
+ icon="credit-card"
27
+ ></custom-card>
28
+
29
+ <custom-card
30
+ title="Navigation Bars"
31
+ description="Responsive navigation components"
32
+ icon="navigation"
33
+ ></custom-card>
34
+
35
+ <custom-card
36
+ title="Form Elements"
37
+ description="Modern form inputs and controls"
38
+ icon="edit"
39
+ ></custom-card>
40
+ </section>
41
+
42
+ <section class="mb-12">
43
+ <custom-accordion></custom-accordion>
44
+ </section>
45
+
46
+ <section class="mb-12">
47
+ <custom-testimonials></custom-testimonials>
48
+ </section>
49
+
50
+ <section class="mb-12">
51
+ <custom-newsletter></custom-newsletter>
52
+ </section>
53
+ </main>
54
+
55
+ <custom-footer></custom-footer>
56
+
57
+ <script src="components/navbar.js"></script>
58
+ <script src="components/card.js"></script>
59
+ <script src="components/accordion.js"></script>
60
+ <script src="components/testimonials.js"></script>
61
+ <script src="components/newsletter.js"></script>
62
+ <script src="components/footer.js"></script>
63
+ <script src="script.js"></script>
64
+ <script>feather.replace();</script>
65
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
66
+ </body>
67
+ </html>
script.js ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Initialize components and add interactivity
2
+ document.addEventListener('DOMContentLoaded', () => {
3
+ // Smooth scroll for anchor links
4
+ document.querySelectorAll('a[href^="#"]').forEach(anchor => {
5
+ anchor.addEventListener('click', function (e) {
6
+ e.preventDefault();
7
+ document.querySelector(this.getAttribute('href')).scrollIntoView({
8
+ behavior: 'smooth'
9
+ });
10
+ });
11
+ });
12
+
13
+ // Add fade-in animation to all custom components
14
+ const components = document.querySelectorAll('custom-navbar, custom-card, custom-accordion, custom-testimonials, custom-newsletter, custom-footer');
15
+ components.forEach(component => {
16
+ component.classList.add('fade-in');
17
+ });
18
+ });
style.css CHANGED
@@ -1,28 +1,32 @@
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 animations */
2
+ @keyframes fadeIn {
3
+ from { opacity: 0; }
4
+ to { opacity: 1; }
5
  }
6
 
7
+ .fade-in {
8
+ animation: fadeIn 0.5s ease-in-out;
 
9
  }
10
 
11
+ /* Smooth transitions */
12
+ .transition-all {
13
+ transition: all 0.3s ease;
 
 
14
  }
15
 
16
+ /* Custom scrollbar */
17
+ ::-webkit-scrollbar {
18
+ width: 8px;
 
 
 
19
  }
20
 
21
+ ::-webkit-scrollbar-track {
22
+ background: #f1f1f1;
23
  }
24
+
25
+ ::-webkit-scrollbar-thumb {
26
+ background: #888;
27
+ border-radius: 4px;
28
+ }
29
+
30
+ ::-webkit-scrollbar-thumb:hover {
31
+ background: #555;
32
+ }