errah commited on
Commit
e6731bf
·
verified ·
1 Parent(s): 8727bd7

Build this project: https://bolt.new/~/sb1-jntqpl7c

Browse files
Files changed (5) hide show
  1. README.md +8 -5
  2. components/navbar.js +56 -0
  3. index.html +87 -19
  4. script.js +32 -0
  5. style.css +34 -19
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Code Canvas Creative Development Playground
3
- emoji: 📊
4
- colorFrom: yellow
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: Code Canvas - Creative Development Playground 🎨
3
+ colorFrom: gray
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/navbar.js ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
10
+ nav {
11
+ background-color: white;
12
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
13
+ }
14
+ .nav-container {
15
+ max-width: 1200px;
16
+ margin: 0 auto;
17
+ padding: 1rem;
18
+ }
19
+ .nav-logo {
20
+ font-weight: 700;
21
+ font-size: 1.25rem;
22
+ color: #1f2937;
23
+ }
24
+ .nav-link {
25
+ color: #4b5563;
26
+ transition: color 0.2s;
27
+ }
28
+ .nav-link:hover {
29
+ color: #3b82f6;
30
+ }
31
+ @media (max-width: 768px) {
32
+ .nav-links {
33
+ display: none;
34
+ }
35
+ .mobile-menu-button {
36
+ display: block;
37
+ }
38
+ }
39
+ </style>
40
+ <nav>
41
+ <div class="nav-container flex justify-between items-center px-4 py-3">
42
+ <a href="/" class="nav-logo flex items-center">
43
+ <i data-feather="code" class="w-5 h-5 mr-2"></i>
44
+ Code Canvas
45
+ </a>
46
+
47
+ <div class="nav-links space-x-6 hidden md:flex">
48
+ <a href="#" class="nav-link">Features</a>
49
+ <a href="#" class="nav-link">Templates</a>
50
+ <a href="#" class="nav-link">Docs</a>
51
+ <a href="#" class="nav-link">Pricing</a>
52
+ </div>
53
+
54
+ <div class="hidden md:flex space-x-4">
55
+ <a href="#" class="px-4 py-2 rounded-lg text-gray-600 hover:text-gray-800">Sign In</a>
56
+ <a href="#" class="px-4 py-
index.html CHANGED
@@ -1,19 +1,87 @@
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>Code Canvas | Creative Development Playground</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 md:py-12 lg:py-16">
18
+ <div class="max-w-4xl mx-auto">
19
+ <div class="text-center mb-12">
20
+ <h1 class="text-4xl md:text-5xl font-bold text-gray-800 mb-4">Code Canvas</h1>
21
+ <p class="text-xl text-gray-600 max-w-2xl mx-auto">Your creative development playground for building amazing web experiences</p>
22
+ </div>
23
+
24
+ <div class="bg-white rounded-xl shadow-lg overflow-hidden mb-12">
25
+ <div class="p-6">
26
+ <div class="flex items-center mb-4">
27
+ <div class="w-3 h-3 rounded-full bg-red-500 mr-2"></div>
28
+ <div class="w-3 h-3 rounded-full bg-yellow-500 mr-2"></div>
29
+ <div class="w-3 h-3 rounded-full bg-green-500"></div>
30
+ <div class="flex-grow"></div>
31
+ <button class="bg-gray-100 hover:bg-gray-200 text-gray-800 px-4 py-1 rounded-lg text-sm">
32
+ <i data-feather="copy" class="w-4 h-4 inline mr-1"></i> Copy
33
+ </button>
34
+ </div>
35
+ <div class="bg-gray-900 rounded-lg p-6">
36
+ <pre class="text-gray-100 font-mono text-sm overflow-x-auto">
37
+ <code>
38
+ // Welcome to Code Canvas
39
+ function createMagic() {
40
+ const ideas = [];
41
+ const creativity = Infinity;
42
+
43
+ return ideas.map(idea => {
44
+ return `<div class="awesome-project">
45
+ ${idea + creativity}
46
+ </div>`;
47
+ });
48
+ }
49
+ </code>
50
+ </pre>
51
+ </div>
52
+ </div>
53
+ </div>
54
+
55
+ <div class="grid md:grid-cols-2 gap-8 mb-12">
56
+ <div class="bg-white rounded-xl shadow-lg p-6 hover:shadow-xl transition-shadow">
57
+ <div class="flex items-center mb-4">
58
+ <i data-feather="zap" class="w-6 h-6 text-blue-500 mr-2"></i>
59
+ <h3 class="text-xl font-semibold text-gray-800">Quick Start</h3>
60
+ </div>
61
+ <p class="text-gray-600 mb-4">Jump right in with our beginner-friendly templates and starter kits.</p>
62
+ <a href="#" class="text-blue-500 hover:text-blue-600 inline-flex items-center">
63
+ Get Started <i data-feather="arrow-right" class="w-4 h-4 ml-1"></i>
64
+ </a>
65
+ </div>
66
+
67
+ <div class="bg-white rounded-xl shadow-lg p-6 hover:shadow-xl transition-shadow">
68
+ <div class="flex items-center mb-4">
69
+ <i data-feather="book" class="w-6 h-6 text-green-500 mr-2"></i>
70
+ <h3 class="text-xl font-semibold text-gray-800">Learn</h3>
71
+ </div>
72
+ <p class="text-gray-600 mb-4">Explore our library of tutorials and guides to level up your skills.</p>
73
+ <a href="#" class="text-green-500 hover:text-green-600 inline-flex items-center">
74
+ Learn More <i data-feather="arrow-right" class="w-4 h-4 ml-1"></i>
75
+ </a>
76
+ </div>
77
+ </div>
78
+ </div>
79
+ </main>
80
+
81
+ <custom-footer></custom-footer>
82
+
83
+ <script>feather.replace();</script>
84
+ <script src="script.js"></script>
85
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
86
+ </body>
87
+ </html>
script.js ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Main application script
2
+ document.addEventListener('DOMContentLoaded', function() {
3
+ // Initialize clipboard functionality
4
+ const copyButtons = document.querySelectorAll('.copy-button');
5
+
6
+ copyButtons.forEach(button => {
7
+ button.addEventListener('click', async () => {
8
+ const codeBlock = button.parentElement.nextElementSibling.querySelector('code');
9
+ try {
10
+ await navigator.clipboard.writeText(codeBlock.textContent);
11
+ button.innerHTML = '<i data-feather="check" class="w-4 h-4 inline mr-1"></i> Copied!';
12
+ feather.replace();
13
+ setTimeout(() => {
14
+ button.innerHTML = '<i data-feather="copy" class="w-4 h-4 inline mr-1"></i> Copy';
15
+ feather.replace();
16
+ }, 2000);
17
+ } catch (err) {
18
+ console.error('Failed to copy text: ', err);
19
+ }
20
+ });
21
+ });
22
+
23
+ // Smooth scrolling for anchor links
24
+ document.querySelectorAll('a[href^="#"]').forEach(anchor => {
25
+ anchor.addEventListener('click', function(e) {
26
+ e.preventDefault();
27
+ document.querySelector(this.getAttribute('href')).scrollIntoView({
28
+ behavior: 'smooth'
29
+ });
30
+ });
31
+ });
32
+ });
style.css CHANGED
@@ -1,28 +1,43 @@
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 complement Tailwind */
2
+ :root {
3
+ --primary: #3b82f6;
4
+ --secondary: #10b981;
5
  }
6
 
7
+ @keyframes float {
8
+ 0%, 100% {
9
+ transform: translateY(0);
10
+ }
11
+ 50% {
12
+ transform: translateY(-10px);
13
+ }
14
  }
15
 
16
+ .hover-float:hover {
17
+ animation: float 2s ease-in-out infinite;
 
 
 
18
  }
19
 
20
+ .code-block {
21
+ background-color: #1e293b;
22
+ border-radius: 0.5rem;
23
+ padding: 1.5rem;
24
+ color: #f8fafc;
25
+ font-family: 'Fira Code', 'Menlo', 'Monaco', monospace;
26
+ font-size: 0.875rem;
27
+ line-height: 1.5;
28
  }
29
 
30
+ .feature-card {
31
+ transition: all 0.3s ease;
32
  }
33
+
34
+ .feature-card:hover {
35
+ transform: translateY(-5px);
36
+ }
37
+
38
+ /* Responsive design adjustments */
39
+ @media (max-width: 640px) {
40
+ .hero-text {
41
+ font-size: 2.25rem;
42
+ }
43
+ }