can u convert figma design to code? with front-end and backend?
Browse files- README.md +9 -5
- components/figma-importer.js +94 -0
- components/footer.js +146 -0
- components/navbar.js +142 -0
- courses.html +14 -0
- index.html +252 -19
- package.json +24 -0
- script.js +86 -0
- server/api/figma.js +64 -0
- server/server.js +26 -0
- style.css +81 -18
README.md
CHANGED
|
@@ -1,10 +1,14 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: CodeCanvas - Figma to Fullstack Wizardry ✨
|
| 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://huggingface.co/deepsite).
|
| 14 |
+
|
components/figma-importer.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class FigmaImporter extends HTMLElement {
|
| 2 |
+
constructor() {
|
| 3 |
+
super();
|
| 4 |
+
this.attachShadow({ mode: 'open' });
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
connectedCallback() {
|
| 8 |
+
this.shadowRoot.innerHTML = `
|
| 9 |
+
<style>
|
| 10 |
+
.importer-container {
|
| 11 |
+
padding: 2rem;
|
| 12 |
+
background: #f8fafc;
|
| 13 |
+
border-radius: 0.5rem;
|
| 14 |
+
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
| 15 |
+
}
|
| 16 |
+
.dropzone {
|
| 17 |
+
border: 2px dashed #cbd5e1;
|
| 18 |
+
border-radius: 0.5rem;
|
| 19 |
+
padding: 3rem;
|
| 20 |
+
text-align: center;
|
| 21 |
+
cursor: pointer;
|
| 22 |
+
transition: all 0.2s;
|
| 23 |
+
}
|
| 24 |
+
.dropzone:hover {
|
| 25 |
+
border-color: #6366f1;
|
| 26 |
+
}
|
| 27 |
+
.btn-primary {
|
| 28 |
+
background: #6366f1;
|
| 29 |
+
color: white;
|
| 30 |
+
padding: 0.75rem 1.5rem;
|
| 31 |
+
border-radius: 0.5rem;
|
| 32 |
+
border: none;
|
| 33 |
+
cursor: pointer;
|
| 34 |
+
font-weight: 500;
|
| 35 |
+
transition: all 0.2s;
|
| 36 |
+
}
|
| 37 |
+
.btn-primary:hover {
|
| 38 |
+
background: #4f46e5;
|
| 39 |
+
}
|
| 40 |
+
</style>
|
| 41 |
+
<div class="importer-container">
|
| 42 |
+
<div class="dropzone" id="dropzone">
|
| 43 |
+
<i data-feather="upload-cloud" class="w-12 h-12 mb-4 mx-auto text-gray-400"></i>
|
| 44 |
+
<h3 class="text-lg font-medium text-gray-900 mb-2">Drop Figma file here</h3>
|
| 45 |
+
<p class="text-gray-500 mb-4">or click to browse files</p>
|
| 46 |
+
<button class="btn-primary">Import Design</button>
|
| 47 |
+
</div>
|
| 48 |
+
</div>
|
| 49 |
+
`;
|
| 50 |
+
this.setupDropzone();
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
setupDropzone() {
|
| 54 |
+
const dropzone = this.shadowRoot.getElementById('dropzone');
|
| 55 |
+
|
| 56 |
+
dropzone.addEventListener('click', () => {
|
| 57 |
+
this.importFromFigma();
|
| 58 |
+
});
|
| 59 |
+
|
| 60 |
+
dropzone.addEventListener('dragover', (e) => {
|
| 61 |
+
e.preventDefault();
|
| 62 |
+
dropzone.style.borderColor = '#6366f1';
|
| 63 |
+
dropzone.style.backgroundColor = '#eef2ff';
|
| 64 |
+
});
|
| 65 |
+
|
| 66 |
+
dropzone.addEventListener('dragleave', () => {
|
| 67 |
+
dropzone.style.borderColor = '#cbd5e1';
|
| 68 |
+
dropzone.style.backgroundColor = 'transparent';
|
| 69 |
+
});
|
| 70 |
+
|
| 71 |
+
dropzone.addEventListener('drop', (e) => {
|
| 72 |
+
e.preventDefault();
|
| 73 |
+
dropzone.style.borderColor = '#cbd5e1';
|
| 74 |
+
dropzone.style.backgroundColor = 'transparent';
|
| 75 |
+
|
| 76 |
+
const file = e.dataTransfer.files[0];
|
| 77 |
+
if (file) {
|
| 78 |
+
this.processFigmaFile(file);
|
| 79 |
+
}
|
| 80 |
+
});
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
importFromFigma() {
|
| 84 |
+
// TODO: Implement Figma API integration
|
| 85 |
+
console.log('Connecting to Figma API...');
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
processFigmaFile(file) {
|
| 89 |
+
// TODO: Implement file processing
|
| 90 |
+
console.log('Processing Figma file:', file.name);
|
| 91 |
+
}
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
customElements.define('figma-importer', FigmaImporter);
|
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 |
+
footer {
|
| 7 |
+
background: #1f2937;
|
| 8 |
+
color: white;
|
| 9 |
+
padding: 4rem 2rem 2rem;
|
| 10 |
+
}
|
| 11 |
+
.footer-container {
|
| 12 |
+
max-width: 1200px;
|
| 13 |
+
margin: 0 auto;
|
| 14 |
+
display: grid;
|
| 15 |
+
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
| 16 |
+
gap: 2rem;
|
| 17 |
+
}
|
| 18 |
+
.footer-logo {
|
| 19 |
+
font-weight: 800;
|
| 20 |
+
font-size: 1.5rem;
|
| 21 |
+
background: linear-gradient(to right, #6366f1, #8b5cf6);
|
| 22 |
+
-webkit-background-clip: text;
|
| 23 |
+
background-clip: text;
|
| 24 |
+
color: transparent;
|
| 25 |
+
margin-bottom: 1rem;
|
| 26 |
+
display: inline-block;
|
| 27 |
+
}
|
| 28 |
+
.footer-about p {
|
| 29 |
+
color: #d1d5db;
|
| 30 |
+
margin-bottom: 1.5rem;
|
| 31 |
+
line-height: 1.6;
|
| 32 |
+
}
|
| 33 |
+
.social-links {
|
| 34 |
+
display: flex;
|
| 35 |
+
gap: 1rem;
|
| 36 |
+
}
|
| 37 |
+
.social-links a {
|
| 38 |
+
width: 36px;
|
| 39 |
+
height: 36px;
|
| 40 |
+
border-radius: 50%;
|
| 41 |
+
background: rgba(255, 255, 255, 0.1);
|
| 42 |
+
display: flex;
|
| 43 |
+
align-items: center;
|
| 44 |
+
justify-content: center;
|
| 45 |
+
transition: all 0.2s;
|
| 46 |
+
}
|
| 47 |
+
.social-links a:hover {
|
| 48 |
+
background: #6366f1;
|
| 49 |
+
}
|
| 50 |
+
.footer-links h3 {
|
| 51 |
+
font-size: 1.125rem;
|
| 52 |
+
font-weight: 600;
|
| 53 |
+
margin-bottom: 1.25rem;
|
| 54 |
+
color: white;
|
| 55 |
+
}
|
| 56 |
+
.footer-links ul {
|
| 57 |
+
list-style: none;
|
| 58 |
+
padding: 0;
|
| 59 |
+
margin: 0;
|
| 60 |
+
}
|
| 61 |
+
.footer-links li {
|
| 62 |
+
margin-bottom: 0.75rem;
|
| 63 |
+
}
|
| 64 |
+
.footer-links a {
|
| 65 |
+
color: #d1d5db;
|
| 66 |
+
text-decoration: none;
|
| 67 |
+
transition: color 0.2s;
|
| 68 |
+
}
|
| 69 |
+
.footer-links a:hover {
|
| 70 |
+
color: #6366f1;
|
| 71 |
+
}
|
| 72 |
+
.footer-bottom {
|
| 73 |
+
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
| 74 |
+
padding-top: 2rem;
|
| 75 |
+
margin-top: 3rem;
|
| 76 |
+
text-align: center;
|
| 77 |
+
color: #9ca3af;
|
| 78 |
+
font-size: 0.875rem;
|
| 79 |
+
}
|
| 80 |
+
@media (max-width: 768px) {
|
| 81 |
+
.footer-container {
|
| 82 |
+
grid-template-columns: 1fr;
|
| 83 |
+
}
|
| 84 |
+
}
|
| 85 |
+
</style>
|
| 86 |
+
<footer>
|
| 87 |
+
<div class="footer-container">
|
| 88 |
+
<div class="footer-about">
|
| 89 |
+
<a href="/" class="footer-logo">EduSphere</a>
|
| 90 |
+
<p>Modern education platform designed to help you achieve your learning goals with interactive courses and expert guidance.</p>
|
| 91 |
+
<div class="social-links">
|
| 92 |
+
<a href="#"><i data-feather="twitter"></i></a>
|
| 93 |
+
<a href="#"><i data-feather="facebook"></i></a>
|
| 94 |
+
<a href="#"><i data-feather="linkedin"></i></a>
|
| 95 |
+
<a href="#"><i data-feather="instagram"></i></a>
|
| 96 |
+
<a href="#"><i data-feather="youtube"></i></a>
|
| 97 |
+
</div>
|
| 98 |
+
</div>
|
| 99 |
+
|
| 100 |
+
<div class="footer-links">
|
| 101 |
+
<h3>Company</h3>
|
| 102 |
+
<ul>
|
| 103 |
+
<li><a href="/about.html">About Us</a></li>
|
| 104 |
+
<li><a href="/careers.html">Careers</a></li>
|
| 105 |
+
<li><a href="/blog.html">Blog</a></li>
|
| 106 |
+
<li><a href="/press.html">Press</a></li>
|
| 107 |
+
</ul>
|
| 108 |
+
</div>
|
| 109 |
+
|
| 110 |
+
<div class="footer-links">
|
| 111 |
+
<h3>Resources</h3>
|
| 112 |
+
<ul>
|
| 113 |
+
<li><a href="/help.html">Help Center</a></li>
|
| 114 |
+
<li><a href="/tutorials.html">Tutorials</a></li>
|
| 115 |
+
<li><a href="/webinars.html">Webinars</a></li>
|
| 116 |
+
<li><a href="/guides.html">Guides</a></li>
|
| 117 |
+
</ul>
|
| 118 |
+
</div>
|
| 119 |
+
|
| 120 |
+
<div class="footer-links">
|
| 121 |
+
<h3>Legal</h3>
|
| 122 |
+
<ul>
|
| 123 |
+
<li><a href="/privacy.html">Privacy Policy</a></li>
|
| 124 |
+
<li><a href="/terms.html">Terms of Service</a></li>
|
| 125 |
+
<li><a href="/cookies.html">Cookie Policy</a></li>
|
| 126 |
+
<li><a href="/gdpr.html">GDPR</a></li>
|
| 127 |
+
</ul>
|
| 128 |
+
</div>
|
| 129 |
+
</div>
|
| 130 |
+
|
| 131 |
+
<div class="footer-bottom">
|
| 132 |
+
<p>© ${new Date().getFullYear()} EduSphere. All rights reserved.</p>
|
| 133 |
+
</div>
|
| 134 |
+
</footer>
|
| 135 |
+
`;
|
| 136 |
+
|
| 137 |
+
// Replace feather icons after shadow DOM is rendered
|
| 138 |
+
setTimeout(() => {
|
| 139 |
+
if (this.shadowRoot.querySelector('[data-feather]')) {
|
| 140 |
+
feather.replace();
|
| 141 |
+
}
|
| 142 |
+
}, 100);
|
| 143 |
+
}
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
customElements.define('custom-footer', CustomFooter);
|
components/navbar.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomNavbar extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
nav {
|
| 7 |
+
background: white;
|
| 8 |
+
padding: 1rem 2rem;
|
| 9 |
+
display: flex;
|
| 10 |
+
justify-content: space-between;
|
| 11 |
+
align-items: center;
|
| 12 |
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
|
| 13 |
+
position: fixed;
|
| 14 |
+
width: 100%;
|
| 15 |
+
top: 0;
|
| 16 |
+
z-index: 1000;
|
| 17 |
+
}
|
| 18 |
+
.logo {
|
| 19 |
+
font-weight: 800;
|
| 20 |
+
font-size: 1.5rem;
|
| 21 |
+
background: linear-gradient(to right, #6366f1, #8b5cf6);
|
| 22 |
+
-webkit-background-clip: text;
|
| 23 |
+
background-clip: text;
|
| 24 |
+
color: transparent;
|
| 25 |
+
}
|
| 26 |
+
.nav-links {
|
| 27 |
+
display: flex;
|
| 28 |
+
gap: 2rem;
|
| 29 |
+
list-style: none;
|
| 30 |
+
margin: 0;
|
| 31 |
+
padding: 0;
|
| 32 |
+
}
|
| 33 |
+
.nav-links a {
|
| 34 |
+
color: #4b5563;
|
| 35 |
+
text-decoration: none;
|
| 36 |
+
font-weight: 500;
|
| 37 |
+
transition: color 0.2s;
|
| 38 |
+
}
|
| 39 |
+
.nav-links a:hover {
|
| 40 |
+
color: #6366f1;
|
| 41 |
+
}
|
| 42 |
+
.nav-actions {
|
| 43 |
+
display: flex;
|
| 44 |
+
gap: 1rem;
|
| 45 |
+
align-items: center;
|
| 46 |
+
}
|
| 47 |
+
.btn-outline {
|
| 48 |
+
border: 1px solid #6366f1;
|
| 49 |
+
color: #6366f1;
|
| 50 |
+
padding: 0.5rem 1.25rem;
|
| 51 |
+
border-radius: 0.5rem;
|
| 52 |
+
transition: all 0.2s;
|
| 53 |
+
}
|
| 54 |
+
.btn-outline:hover {
|
| 55 |
+
background: #6366f1;
|
| 56 |
+
color: white;
|
| 57 |
+
}
|
| 58 |
+
.btn-solid {
|
| 59 |
+
background: linear-gradient(to right, #6366f1, #8b5cf6);
|
| 60 |
+
color: white;
|
| 61 |
+
padding: 0.5rem 1.25rem;
|
| 62 |
+
border-radius: 0.5rem;
|
| 63 |
+
transition: all 0.2s;
|
| 64 |
+
}
|
| 65 |
+
.btn-solid:hover {
|
| 66 |
+
opacity: 0.9;
|
| 67 |
+
}
|
| 68 |
+
.mobile-menu-btn {
|
| 69 |
+
display: none;
|
| 70 |
+
background: none;
|
| 71 |
+
border: none;
|
| 72 |
+
color: #4b5563;
|
| 73 |
+
cursor: pointer;
|
| 74 |
+
}
|
| 75 |
+
#mobile-menu {
|
| 76 |
+
display: none;
|
| 77 |
+
position: absolute;
|
| 78 |
+
top: 100%;
|
| 79 |
+
left: 0;
|
| 80 |
+
right: 0;
|
| 81 |
+
background: white;
|
| 82 |
+
padding: 1rem;
|
| 83 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
| 84 |
+
}
|
| 85 |
+
#mobile-menu.open {
|
| 86 |
+
display: block;
|
| 87 |
+
}
|
| 88 |
+
@media (max-width: 768px) {
|
| 89 |
+
.nav-links, .nav-actions {
|
| 90 |
+
display: none;
|
| 91 |
+
}
|
| 92 |
+
.mobile-menu-btn {
|
| 93 |
+
display: block;
|
| 94 |
+
}
|
| 95 |
+
}
|
| 96 |
+
</style>
|
| 97 |
+
<nav>
|
| 98 |
+
<div>
|
| 99 |
+
<a href="/" class="logo">EduSphere</a>
|
| 100 |
+
</div>
|
| 101 |
+
|
| 102 |
+
<ul class="nav-links">
|
| 103 |
+
<li><a href="/">Home</a></li>
|
| 104 |
+
<li><a href="/courses.html">Courses</a></li>
|
| 105 |
+
<li><a href="/about.html">About</a></li>
|
| 106 |
+
<li><a href="/contact.html">Contact</a></li>
|
| 107 |
+
</ul>
|
| 108 |
+
|
| 109 |
+
<div class="nav-actions">
|
| 110 |
+
<a href="/login.html" class="btn-outline">Log In</a>
|
| 111 |
+
<a href="/signup.html" class="btn-solid">Sign Up</a>
|
| 112 |
+
</div>
|
| 113 |
+
|
| 114 |
+
<button class="mobile-menu-btn" onclick="toggleMobileMenu()">
|
| 115 |
+
<i data-feather="menu"></i>
|
| 116 |
+
</button>
|
| 117 |
+
</nav>
|
| 118 |
+
|
| 119 |
+
<div id="mobile-menu" class="hidden">
|
| 120 |
+
<div class="flex flex-col space-y-4 p-4">
|
| 121 |
+
<a href="/" class="text-gray-700 hover:text-primary">Home</a>
|
| 122 |
+
<a href="/courses.html" class="text-gray-700 hover:text-primary">Courses</a>
|
| 123 |
+
<a href="/about.html" class="text-gray-700 hover:text-primary">About</a>
|
| 124 |
+
<a href="/contact.html" class="text-gray-700 hover:text-primary">Contact</a>
|
| 125 |
+
<div class="pt-4 border-t border-gray-200">
|
| 126 |
+
<a href="/login.html" class="block text-center text-gray-700 hover:text-primary mb-3">Log In</a>
|
| 127 |
+
<a href="/signup.html" class="block text-center bg-primary text-white py-2 rounded-lg hover:bg-opacity-90">Sign Up</a>
|
| 128 |
+
</div>
|
| 129 |
+
</div>
|
| 130 |
+
</div>
|
| 131 |
+
`;
|
| 132 |
+
|
| 133 |
+
// Replace feather icons after shadow DOM is rendered
|
| 134 |
+
setTimeout(() => {
|
| 135 |
+
if (this.shadowRoot.querySelector('[data-feather]')) {
|
| 136 |
+
feather.replace();
|
| 137 |
+
}
|
| 138 |
+
}, 100);
|
| 139 |
+
}
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
customElements.define('custom-navbar', CustomNavbar);
|
courses.html
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>Courses | EduSphere</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{"ok":false,"message":"Request timeout: The AI model took too long to respond. Please try again with a simpler prompt or try a different model."}
|
| 13 |
+
</body>
|
| 14 |
+
</html>
|
index.html
CHANGED
|
@@ -1,19 +1,252 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>EduSphere | Modern Learning Platform</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="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.globe.min.js"></script>
|
| 12 |
+
<script>
|
| 13 |
+
tailwind.config = {
|
| 14 |
+
theme: {
|
| 15 |
+
extend: {
|
| 16 |
+
colors: {
|
| 17 |
+
primary: '#6366f1',
|
| 18 |
+
secondary: '#8b5cf6',
|
| 19 |
+
}
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
+
</script>
|
| 24 |
+
</head>
|
| 25 |
+
<body class="bg-gray-50">
|
| 26 |
+
<custom-navbar></custom-navbar>
|
| 27 |
+
<div class="container mx-auto px-6 py-12">
|
| 28 |
+
<h1 class="text-3xl font-bold mb-8">Figma to Code Converter</h1>
|
| 29 |
+
<figma-importer></figma-importer>
|
| 30 |
+
</div>
|
| 31 |
+
<main>
|
| 32 |
+
<!-- Hero Section -->
|
| 33 |
+
<section id="hero" class="relative overflow-hidden">
|
| 34 |
+
<div class="absolute inset-0 z-0" id="vanta-bg"></div>
|
| 35 |
+
<div class="relative z-10 container mx-auto px-6 py-24 md:py-32">
|
| 36 |
+
<div class="max-w-3xl mx-auto text-center">
|
| 37 |
+
<h1 class="text-4xl md:text-6xl font-bold text-white mb-6">Unlock Your Learning Potential</h1>
|
| 38 |
+
<p class="text-xl text-white opacity-90 mb-8">Interactive courses, expert instructors, and a community of learners to help you achieve your goals.</p>
|
| 39 |
+
<div class="flex flex-col sm:flex-row gap-4 justify-center">
|
| 40 |
+
<a href="/courses.html" class="bg-white text-primary px-8 py-3 rounded-lg font-semibold hover:bg-opacity-90 transition">Browse Courses</a>
|
| 41 |
+
<a href="/signup.html" class="bg-transparent border-2 border-white text-white px-8 py-3 rounded-lg font-semibold hover:bg-white hover:bg-opacity-10 transition">Join Free</a>
|
| 42 |
+
</div>
|
| 43 |
+
</div>
|
| 44 |
+
</div>
|
| 45 |
+
</section>
|
| 46 |
+
|
| 47 |
+
<!-- Features Section -->
|
| 48 |
+
<section class="py-20 bg-white">
|
| 49 |
+
<div class="container mx-auto px-6">
|
| 50 |
+
<div class="text-center mb-16">
|
| 51 |
+
<h2 class="text-3xl md:text-4xl font-bold text-gray-900 mb-4">Why Choose EduSphere?</h2>
|
| 52 |
+
<p class="text-lg text-gray-600 max-w-2xl mx-auto">Our platform combines cutting-edge technology with proven educational methods.</p>
|
| 53 |
+
</div>
|
| 54 |
+
|
| 55 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
|
| 56 |
+
<div class="bg-gray-50 p-8 rounded-xl hover:shadow-lg transition">
|
| 57 |
+
<div class="w-14 h-14 bg-primary bg-opacity-10 rounded-full flex items-center justify-center mb-6">
|
| 58 |
+
<i data-feather="monitor" class="text-primary w-6 h-6"></i>
|
| 59 |
+
</div>
|
| 60 |
+
<h3 class="text-xl font-semibold mb-3">Interactive Lessons</h3>
|
| 61 |
+
<p class="text-gray-600">Engaging multimedia content with quizzes and practical exercises.</p>
|
| 62 |
+
</div>
|
| 63 |
+
|
| 64 |
+
<div class="bg-gray-50 p-8 rounded-xl hover:shadow-lg transition">
|
| 65 |
+
<div class="w-14 h-14 bg-primary bg-opacity-10 rounded-full flex items-center justify-center mb-6">
|
| 66 |
+
<i data-feather="users" class="text-primary w-6 h-6"></i>
|
| 67 |
+
</div>
|
| 68 |
+
<h3 class="text-xl font-semibold mb-3">Expert Community</h3>
|
| 69 |
+
<p class="text-gray-600">Connect with instructors and peers through discussion forums.</p>
|
| 70 |
+
</div>
|
| 71 |
+
|
| 72 |
+
<div class="bg-gray-50 p-8 rounded-xl hover:shadow-lg transition">
|
| 73 |
+
<div class="w-14 h-14 bg-primary bg-opacity-10 rounded-full flex items-center justify-center mb-6">
|
| 74 |
+
<i data-feather="award" class="text-primary w-6 h-6"></i>
|
| 75 |
+
</div>
|
| 76 |
+
<h3 class="text-xl font-semibold mb-3">Certification</h3>
|
| 77 |
+
<p class="text-gray-600">Earn recognized certificates upon course completion.</p>
|
| 78 |
+
</div>
|
| 79 |
+
</div>
|
| 80 |
+
</div>
|
| 81 |
+
</section>
|
| 82 |
+
|
| 83 |
+
<!-- Popular Courses -->
|
| 84 |
+
<section class="py-20 bg-gray-50">
|
| 85 |
+
<div class="container mx-auto px-6">
|
| 86 |
+
<div class="flex flex-col md:flex-row justify-between items-center mb-12">
|
| 87 |
+
<div>
|
| 88 |
+
<h2 class="text-3xl md:text-4xl font-bold text-gray-900 mb-2">Popular Courses</h2>
|
| 89 |
+
<p class="text-gray-600">Start learning today with our most popular courses</p>
|
| 90 |
+
</div>
|
| 91 |
+
<a href="/courses.html" class="mt-4 md:mt-0 text-primary font-semibold hover:underline flex items-center">
|
| 92 |
+
View all courses <i data-feather="arrow-right" class="ml-2 w-5 h-5"></i>
|
| 93 |
+
</a>
|
| 94 |
+
</div>
|
| 95 |
+
|
| 96 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
| 97 |
+
<!-- Course 1 -->
|
| 98 |
+
<div class="bg-white rounded-xl overflow-hidden shadow-md hover:shadow-lg transition">
|
| 99 |
+
<div class="h-48 bg-gradient-to-r from-primary to-secondary flex items-center justify-center text-white">
|
| 100 |
+
<i data-feather="code" class="w-16 h-16"></i>
|
| 101 |
+
</div>
|
| 102 |
+
<div class="p-6">
|
| 103 |
+
<div class="flex justify-between items-start mb-4">
|
| 104 |
+
<h3 class="text-xl font-semibold">Web Development Bootcamp</h3>
|
| 105 |
+
<span class="bg-primary bg-opacity-10 text-primary text-xs px-3 py-1 rounded-full">Beginner</span>
|
| 106 |
+
</div>
|
| 107 |
+
<p class="text-gray-600 mb-4">Learn HTML, CSS, JavaScript and modern frameworks.</p>
|
| 108 |
+
<div class="flex justify-between items-center">
|
| 109 |
+
<div class="flex items-center">
|
| 110 |
+
<i data-feather="clock" class="w-4 h-4 text-gray-500 mr-1"></i>
|
| 111 |
+
<span class="text-sm text-gray-500">30 hours</span>
|
| 112 |
+
</div>
|
| 113 |
+
<a href="#" class="text-primary font-medium hover:underline">Enroll Now</a>
|
| 114 |
+
</div>
|
| 115 |
+
</div>
|
| 116 |
+
</div>
|
| 117 |
+
|
| 118 |
+
<!-- Course 2 -->
|
| 119 |
+
<div class="bg-white rounded-xl overflow-hidden shadow-md hover:shadow-lg transition">
|
| 120 |
+
<div class="h-48 bg-gradient-to-r from-primary to-secondary flex items-center justify-center text-white">
|
| 121 |
+
<i data-feather="bar-chart-2" class="w-16 h-16"></i>
|
| 122 |
+
</div>
|
| 123 |
+
<div class="p-6">
|
| 124 |
+
<div class="flex justify-between items-start mb-4">
|
| 125 |
+
<h3 class="text-xl font-semibold">Data Science Fundamentals</h3>
|
| 126 |
+
<span class="bg-primary bg-opacity-10 text-primary text-xs px-3 py-1 rounded-full">Intermediate</span>
|
| 127 |
+
</div>
|
| 128 |
+
<p class="text-gray-600 mb-4">Master Python, Pandas, and data visualization.</p>
|
| 129 |
+
<div class="flex justify-between items-center">
|
| 130 |
+
<div class="flex items-center">
|
| 131 |
+
<i data-feather="clock" class="w-4 h-4 text-gray-500 mr-1"></i>
|
| 132 |
+
<span class="text-sm text-gray-500">45 hours</span>
|
| 133 |
+
</div>
|
| 134 |
+
<a href="#" class="text-primary font-medium hover:underline">Enroll Now</a>
|
| 135 |
+
</div>
|
| 136 |
+
</div>
|
| 137 |
+
</div>
|
| 138 |
+
|
| 139 |
+
<!-- Course 3 -->
|
| 140 |
+
<div class="bg-white rounded-xl overflow-hidden shadow-md hover:shadow-lg transition">
|
| 141 |
+
<div class="h-48 bg-gradient-to-r from-primary to-secondary flex items-center justify-center text-white">
|
| 142 |
+
<i data-feather="smartphone" class="w-16 h-16"></i>
|
| 143 |
+
</div>
|
| 144 |
+
<div class="p-6">
|
| 145 |
+
<div class="flex justify-between items-start mb-4">
|
| 146 |
+
<h3 class="text-xl font-semibold">Mobile App Development</h3>
|
| 147 |
+
<span class="bg-primary bg-opacity-10 text-primary text-xs px-3 py-1 rounded-full">Advanced</span>
|
| 148 |
+
</div>
|
| 149 |
+
<p class="text-gray-600 mb-4">Build cross-platform apps with React Native.</p>
|
| 150 |
+
<div class="flex justify-between items-center">
|
| 151 |
+
<div class="flex items-center">
|
| 152 |
+
<i data-feather="clock" class="w-4 h-4 text-gray-500 mr-1"></i>
|
| 153 |
+
<span class="text-sm text-gray-500">50 hours</span>
|
| 154 |
+
</div>
|
| 155 |
+
<a href="#" class="text-primary font-medium hover:underline">Enroll Now</a>
|
| 156 |
+
</div>
|
| 157 |
+
</div>
|
| 158 |
+
</div>
|
| 159 |
+
</div>
|
| 160 |
+
</div>
|
| 161 |
+
</section>
|
| 162 |
+
|
| 163 |
+
<!-- Testimonials -->
|
| 164 |
+
<section class="py-20 bg-white">
|
| 165 |
+
<div class="container mx-auto px-6">
|
| 166 |
+
<div class="text-center mb-16">
|
| 167 |
+
<h2 class="text-3xl md:text-4xl font-bold text-gray-900 mb-4">What Our Students Say</h2>
|
| 168 |
+
<p class="text-lg text-gray-600 max-w-2xl mx-auto">Join thousands of satisfied learners who transformed their careers.</p>
|
| 169 |
+
</div>
|
| 170 |
+
|
| 171 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
|
| 172 |
+
<div class="bg-gray-50 p-8 rounded-xl">
|
| 173 |
+
<div class="flex items-center mb-4">
|
| 174 |
+
<div class="w-12 h-12 rounded-full bg-gray-300 mr-4 overflow-hidden">
|
| 175 |
+
<img src="http://static.photos/people/200x200/1" alt="Student" class="w-full h-full object-cover">
|
| 176 |
+
</div>
|
| 177 |
+
<div>
|
| 178 |
+
<h4 class="font-semibold">Sarah Johnson</h4>
|
| 179 |
+
<p class="text-sm text-gray-500">Web Developer</p>
|
| 180 |
+
</div>
|
| 181 |
+
</div>
|
| 182 |
+
<p class="text-gray-600">"The Web Development Bootcamp gave me all the skills I needed to land my first developer job. The projects were practical and the instructors were always available to help."</p>
|
| 183 |
+
</div>
|
| 184 |
+
|
| 185 |
+
<div class="bg-gray-50 p-8 rounded-xl">
|
| 186 |
+
<div class="flex items-center mb-4">
|
| 187 |
+
<div class="w-12 h-12 rounded-full bg-gray-300 mr-4 overflow-hidden">
|
| 188 |
+
<img src="http://static.photos/people/200x200/2" alt="Student" class="w-full h-full object-cover">
|
| 189 |
+
</div>
|
| 190 |
+
<div>
|
| 191 |
+
<h4 class="font-semibold">Michael Chen</h4>
|
| 192 |
+
<p class="text-sm text-gray-500">Data Analyst</p>
|
| 193 |
+
</div>
|
| 194 |
+
</div>
|
| 195 |
+
<p class="text-gray-600">"I transitioned from marketing to data science thanks to EduSphere. The curriculum was comprehensive and the community support was invaluable."</p>
|
| 196 |
+
</div>
|
| 197 |
+
|
| 198 |
+
<div class="bg-gray-50 p-8 rounded-xl">
|
| 199 |
+
<div class="flex items-center mb-4">
|
| 200 |
+
<div class="w-12 h-12 rounded-full bg-gray-300 mr-4 overflow-hidden">
|
| 201 |
+
<img src="http://static.photos/people/200x200/3" alt="Student" class="w-full h-full object-cover">
|
| 202 |
+
</div>
|
| 203 |
+
<div>
|
| 204 |
+
<h4 class="font-semibold">Priya Patel</h4>
|
| 205 |
+
<p class="text-sm text-gray-500">Mobile Developer</p>
|
| 206 |
+
</div>
|
| 207 |
+
</div>
|
| 208 |
+
<p class="text-gray-600">"The hands-on approach to learning mobile development was exactly what I needed. I built my portfolio while learning and landed multiple job offers."</p>
|
| 209 |
+
</div>
|
| 210 |
+
</div>
|
| 211 |
+
</div>
|
| 212 |
+
</section>
|
| 213 |
+
|
| 214 |
+
<!-- CTA -->
|
| 215 |
+
<section class="py-20 bg-gradient-to-r from-primary to-secondary">
|
| 216 |
+
<div class="container mx-auto px-6 text-center">
|
| 217 |
+
<h2 class="text-3xl md:text-4xl font-bold text-white mb-6">Ready to Start Learning?</h2>
|
| 218 |
+
<p class="text-xl text-white opacity-90 mb-8 max-w-2xl mx-auto">Join over 100,000 students who have transformed their careers with EduSphere.</p>
|
| 219 |
+
<div class="flex flex-col sm:flex-row gap-4 justify-center">
|
| 220 |
+
<a href="/signup.html" class="bg-white text-primary px-8 py-3 rounded-lg font-semibold hover:bg-opacity-90 transition">Sign Up Free</a>
|
| 221 |
+
<a href="/courses.html" class="bg-transparent border-2 border-white text-white px-8 py-3 rounded-lg font-semibold hover:bg-white hover:bg-opacity-10 transition">Browse Courses</a>
|
| 222 |
+
</div>
|
| 223 |
+
</div>
|
| 224 |
+
</section>
|
| 225 |
+
</main>
|
| 226 |
+
|
| 227 |
+
<custom-footer></custom-footer>
|
| 228 |
+
<script src="components/navbar.js"></script>
|
| 229 |
+
<script src="components/footer.js"></script>
|
| 230 |
+
<script src="components/figma-importer.js"></script>
|
| 231 |
+
<script src="script.js"></script>
|
| 232 |
+
<script>
|
| 233 |
+
feather.replace();
|
| 234 |
+
|
| 235 |
+
// Initialize Vanta.js background
|
| 236 |
+
VANTA.GLOBE({
|
| 237 |
+
el: "#vanta-bg",
|
| 238 |
+
mouseControls: true,
|
| 239 |
+
touchControls: true,
|
| 240 |
+
gyroControls: false,
|
| 241 |
+
minHeight: 200.00,
|
| 242 |
+
minWidth: 200.00,
|
| 243 |
+
scale: 1.00,
|
| 244 |
+
scaleMobile: 1.00,
|
| 245 |
+
color: 0x6366f1,
|
| 246 |
+
backgroundColor: 0x0,
|
| 247 |
+
size: 0.8
|
| 248 |
+
});
|
| 249 |
+
</script>
|
| 250 |
+
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 251 |
+
</body>
|
| 252 |
+
</html>
|
package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
```json
|
| 2 |
+
{
|
| 3 |
+
"name": "codecanvas",
|
| 4 |
+
"version": "1.0.0",
|
| 5 |
+
"description": "Figma to Fullstack Converter",
|
| 6 |
+
"main": "server/server.js",
|
| 7 |
+
"scripts": {
|
| 8 |
+
"start": "node server/server.js",
|
| 9 |
+
"dev": "nodemon server/server.js",
|
| 10 |
+
"build": "cd client && npm run build"
|
| 11 |
+
},
|
| 12 |
+
"dependencies": {
|
| 13 |
+
"axios": "^0.27.2",
|
| 14 |
+
"cors": "^2.8.5",
|
| 15 |
+
"dotenv": "^16.0.1",
|
| 16 |
+
"express": "^4.18.1",
|
| 17 |
+
"figma-js": "^1.16.0",
|
| 18 |
+
"html-to-react": "^1.4.3"
|
| 19 |
+
},
|
| 20 |
+
"devDependencies": {
|
| 21 |
+
"nodemon": "^2.0.19"
|
| 22 |
+
}
|
| 23 |
+
}
|
| 24 |
+
```
|
script.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
// Shared JavaScript for CodeCanvas
|
| 3 |
+
// Initialize tooltips for Feather icons
|
| 4 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 5 |
+
// Smooth scroll for anchor links
|
| 6 |
+
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
| 7 |
+
anchor.addEventListener('click', function (e) {
|
| 8 |
+
e.preventDefault();
|
| 9 |
+
document.querySelector(this.getAttribute('href')).scrollIntoView({
|
| 10 |
+
behavior: 'smooth'
|
| 11 |
+
});
|
| 12 |
+
});
|
| 13 |
+
});
|
| 14 |
+
|
| 15 |
+
// Mobile menu toggle (will be used in navbar component)
|
| 16 |
+
window.toggleMobileMenu = function() {
|
| 17 |
+
const menu = document.getElementById('mobile-menu');
|
| 18 |
+
menu.classList.toggle('hidden');
|
| 19 |
+
};
|
| 20 |
+
|
| 21 |
+
// Course card hover effects
|
| 22 |
+
const courseCards = document.querySelectorAll('.course-card');
|
| 23 |
+
courseCards.forEach(card => {
|
| 24 |
+
card.addEventListener('mouseenter', () => {
|
| 25 |
+
card.classList.add('shadow-lg');
|
| 26 |
+
});
|
| 27 |
+
card.addEventListener('mouseleave', () => {
|
| 28 |
+
card.classList.remove('shadow-lg');
|
| 29 |
+
});
|
| 30 |
+
});
|
| 31 |
+
|
| 32 |
+
// Intersection Observer for animations
|
| 33 |
+
const observerOptions = {
|
| 34 |
+
threshold: 0.1
|
| 35 |
+
};
|
| 36 |
+
|
| 37 |
+
const observer = new IntersectionObserver((entries) => {
|
| 38 |
+
entries.forEach(entry => {
|
| 39 |
+
if (entry.isIntersecting) {
|
| 40 |
+
entry.target.classList.add('animate-fadeIn');
|
| 41 |
+
}
|
| 42 |
+
});
|
| 43 |
+
}, observerOptions);
|
| 44 |
+
|
| 45 |
+
document.querySelectorAll('.animate-on-scroll').forEach(element => {
|
| 46 |
+
observer.observe(element);
|
| 47 |
+
});
|
| 48 |
+
});
|
| 49 |
+
// Figma API integration
|
| 50 |
+
async function importFigmaDesign(fileId, nodeIds) {
|
| 51 |
+
try {
|
| 52 |
+
const response = await fetch('/api/figma/import', {
|
| 53 |
+
method: 'POST',
|
| 54 |
+
headers: {
|
| 55 |
+
'Content-Type': 'application/json'
|
| 56 |
+
},
|
| 57 |
+
body: JSON.stringify({ fileId, nodeIds })
|
| 58 |
+
});
|
| 59 |
+
|
| 60 |
+
const data = await response.json();
|
| 61 |
+
if (data.success) {
|
| 62 |
+
return data;
|
| 63 |
+
} else {
|
| 64 |
+
throw new Error(data.error || 'Failed to import design');
|
| 65 |
+
}
|
| 66 |
+
} catch (error) {
|
| 67 |
+
console.error('Figma import failed:', error);
|
| 68 |
+
return { success: false, error: error.message };
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
try {
|
| 72 |
+
const response = await fetch('https://api.example.com/courses/featured');
|
| 73 |
+
const data = await response.json();
|
| 74 |
+
// Process and display courses
|
| 75 |
+
} catch (error) {
|
| 76 |
+
console.error('Error fetching courses:', error);
|
| 77 |
+
}
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
// Initialize when page loads
|
| 81 |
+
window.onload = function() {
|
| 82 |
+
feather.replace();
|
| 83 |
+
if (window.location.pathname === '/') {
|
| 84 |
+
fetchFeaturedCourses();
|
| 85 |
+
}
|
| 86 |
+
};
|
server/api/figma.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const express = require('express');
|
| 2 |
+
const router = express.Router();
|
| 3 |
+
const axios = require('axios');
|
| 4 |
+
const fs = require('fs');
|
| 5 |
+
const path = require('path');
|
| 6 |
+
|
| 7 |
+
// Figma API configuration
|
| 8 |
+
const FIGMA_API_URL = 'https://api.figma.com/v1';
|
| 9 |
+
const FIGMA_TOKEN = process.env.FIGMA_TOKEN;
|
| 10 |
+
|
| 11 |
+
router.post('/import', async (req, res) => {
|
| 12 |
+
try {
|
| 13 |
+
const { fileId, nodeIds } = req.body;
|
| 14 |
+
|
| 15 |
+
// Get Figma file data
|
| 16 |
+
const response = await axios.get(`${FIGMA_API_URL}/files/${fileId}`, {
|
| 17 |
+
headers: { 'X-Figma-Token': FIGMA_TOKEN },
|
| 18 |
+
params: { ids: nodeIds.join(',') }
|
| 19 |
+
});
|
| 20 |
+
|
| 21 |
+
// Process design data
|
| 22 |
+
const designData = processFigmaData(response.data);
|
| 23 |
+
|
| 24 |
+
// Generate code
|
| 25 |
+
const codeOutput = generateCode(designData);
|
| 26 |
+
|
| 27 |
+
res.json({
|
| 28 |
+
success: true,
|
| 29 |
+
html: codeOutput.html,
|
| 30 |
+
css: codeOutput.css,
|
| 31 |
+
components: codeOutput.components
|
| 32 |
+
});
|
| 33 |
+
} catch (error) {
|
| 34 |
+
console.error('Figma import error:', error);
|
| 35 |
+
res.status(500).json({
|
| 36 |
+
success: false,
|
| 37 |
+
error: error.message
|
| 38 |
+
});
|
| 39 |
+
}
|
| 40 |
+
});
|
| 41 |
+
|
| 42 |
+
function processFigmaData(data) {
|
| 43 |
+
// Extract design tokens, components, layouts
|
| 44 |
+
// This would be expanded based on Figma API response structure
|
| 45 |
+
return {
|
| 46 |
+
colors: extractColors(data),
|
| 47 |
+
typography: extractTypography(data),
|
| 48 |
+
components: extractComponents(data),
|
| 49 |
+
layouts: extractLayouts(data)
|
| 50 |
+
};
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
function generateCode(designData) {
|
| 54 |
+
// Generate HTML, CSS, and components from design data
|
| 55 |
+
return {
|
| 56 |
+
html: generateHtml(designData.layouts),
|
| 57 |
+
css: generateCss(designData),
|
| 58 |
+
components: generateComponents(designData.components)
|
| 59 |
+
};
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
// Helper functions would be implemented here...
|
| 63 |
+
|
| 64 |
+
module.exports = router;
|
server/server.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
require('dotenv').config();
|
| 2 |
+
const express = require('express');
|
| 3 |
+
const cors = require('cors');
|
| 4 |
+
const path = require('path');
|
| 5 |
+
const figmaRoutes = require('./api/figma');
|
| 6 |
+
|
| 7 |
+
const app = express();
|
| 8 |
+
const PORT = process.env.PORT || 5000;
|
| 9 |
+
|
| 10 |
+
// Middleware
|
| 11 |
+
app.use(cors());
|
| 12 |
+
app.use(express.json());
|
| 13 |
+
app.use(express.static(path.join(__dirname, '../public')));
|
| 14 |
+
|
| 15 |
+
// API Routes
|
| 16 |
+
app.use('/api/figma', figmaRoutes);
|
| 17 |
+
|
| 18 |
+
// Serve frontend
|
| 19 |
+
app.get('*', (req, res) => {
|
| 20 |
+
res.sendFile(path.join(__dirname, '../public/index.html'));
|
| 21 |
+
});
|
| 22 |
+
|
| 23 |
+
// Start server
|
| 24 |
+
app.listen(PORT, () => {
|
| 25 |
+
console.log(`Server running on port ${PORT}`);
|
| 26 |
+
});
|
style.css
CHANGED
|
@@ -1,28 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
body {
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
}
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
| 9 |
}
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
margin-top: 5px;
|
| 16 |
}
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
padding: 16px;
|
| 22 |
-
border: 1px solid lightgray;
|
| 23 |
-
border-radius: 16px;
|
| 24 |
}
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
| 28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
/* Custom styles for CodeCanvas */
|
| 3 |
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
| 4 |
+
|
| 5 |
body {
|
| 6 |
+
font-family: 'Inter', sans-serif;
|
| 7 |
+
line-height: 1.6;
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
/* Custom scrollbar */
|
| 11 |
+
::-webkit-scrollbar {
|
| 12 |
+
width: 8px;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
::-webkit-scrollbar-track {
|
| 16 |
+
background: #f1f1f1;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
::-webkit-scrollbar-thumb {
|
| 20 |
+
background: linear-gradient(to bottom, #6366f1, #8b5cf6);
|
| 21 |
+
border-radius: 10px;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
::-webkit-scrollbar-thumb:hover {
|
| 25 |
+
background: #6366f1;
|
| 26 |
+
}
|
| 27 |
+
/* Figma importer styles */
|
| 28 |
+
.figma-preview {
|
| 29 |
+
margin: 2rem 0;
|
| 30 |
+
border: 1px solid #e2e8f0;
|
| 31 |
+
border-radius: 0.5rem;
|
| 32 |
+
overflow: hidden;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
.code-preview {
|
| 36 |
+
background: #1e293b;
|
| 37 |
+
color: #f8fafc;
|
| 38 |
+
padding: 1rem;
|
| 39 |
+
border-radius: 0.5rem;
|
| 40 |
+
font-family: 'Courier New', monospace;
|
| 41 |
+
margin: 1rem 0;
|
| 42 |
+
overflow-x: auto;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
.code-tabs {
|
| 46 |
+
display: flex;
|
| 47 |
+
border-bottom: 1px solid #e2e8f0;
|
| 48 |
+
margin-bottom: 1rem;
|
| 49 |
}
|
| 50 |
|
| 51 |
+
.code-tab {
|
| 52 |
+
padding: 0.5rem 1rem;
|
| 53 |
+
cursor: pointer;
|
| 54 |
+
border-bottom: 2px solid transparent;
|
| 55 |
}
|
| 56 |
|
| 57 |
+
.code-tab.active {
|
| 58 |
+
border-bottom-color: #6366f1;
|
| 59 |
+
color: #6366f1;
|
| 60 |
+
font-weight: 500;
|
|
|
|
| 61 |
}
|
| 62 |
|
| 63 |
+
/* Animation classes */
|
| 64 |
+
.animate-float {
|
| 65 |
+
animation: float 6s ease-in-out infinite;
|
|
|
|
|
|
|
|
|
|
| 66 |
}
|
| 67 |
|
| 68 |
+
@keyframes float {
|
| 69 |
+
0% { transform: translateY(0px); }
|
| 70 |
+
50% { transform: translateY(-20px); }
|
| 71 |
+
100% { transform: translateY(0px); }
|
| 72 |
}
|
| 73 |
+
|
| 74 |
+
/* Course card hover effect */
|
| 75 |
+
.course-card {
|
| 76 |
+
transition: all 0.3s ease;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
.course-card:hover {
|
| 80 |
+
transform: translateY(-5px);
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
/* Hero section overlay */
|
| 84 |
+
.hero-overlay {
|
| 85 |
+
position: absolute;
|
| 86 |
+
top: 0;
|
| 87 |
+
left: 0;
|
| 88 |
+
width: 100%;
|
| 89 |
+
height: 100%;
|
| 90 |
+
background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.5));
|
| 91 |
+
}
|