Écran de gestion de projets (Première colonne) :
Browse filesCréez un menu latéral avec des projets ("Espace Codage - Projet 1", "Espace Codage - Projet 2") qui sont des éléments cliquables. En fonction du projet choisi, les autres fonctionnalités comme "La Baleine", "Rosalinda" etc. devraient être également accessibles dans cette colonne.
Le menu des raccourcis doit inclure des liens vers ces outils et projets, tout en maintenant une interface claire.
Explication du code (Deuxième colonne) :
Ajoutez une section d'explication du code. Lorsque l'IA génère du code, vous pouvez afficher ce code dans cette colonne avec des commentaires ou des descriptions expliquant ce que chaque partie du code fait.
Exemple : "La Baleine a généré ce code CSS pour le thème, voici les explications :"
/* Code CSS généré */
body {
background-color: #ff6347; /* Couleur de fond tomatée */
}
Cette explication peut être faite sous forme de texte statique ou dynamique en fonction de ce que l'IA génère.
Génération et transformation en image (Troisième colonne) :
Vous pouvez utiliser un générateur d'image ou un outil comme Canvas pour transformer le code en une image. Par exemple, un code CSS qui définit des couleurs ou des éléments graphiques peut être transformé en une image de ce que cela ressemble (un thème visuel).
Vous pouvez intégrer un outil comme D3.js ou Fabric.js pour dessiner ou générer des visualisations à partir des données ou du code CSS/HTML.
Structure de l'interface :
Vous devrez probablement utiliser un framework front-end comme React ou Vue.js pour gérer la structure des colonnes.
Chaque colonne sera un composant qui interagira avec l'utilisateur, en affichant les projets, les explications de l'IA et la transformation du code en image.
Code pour la logique d'affichage :
React Example (structure basique) :
import React, { useState } from 'react';
function ProjectSpace() {
const [project, setProject] = useState('Projet 1');
const [codeExplanation, setCodeExplanation] = useState('');
const [generatedImage, setGeneratedImage] = useState(null);
const handleCodeGeneration = (code) => {
setCodeExplanation(generateExplanation(code));
setGeneratedImage(generateImageFromCode(code));
};
return (
<div className="project-space">
<div className="sidebar">
<h3>Projets</h3>
<ul>
<li onClick={() => setProject('Projet 1')}>Espace Codage - Projet 1</li>
<li onClick={() => setProject('Projet 2')}>Espace Codage - Projet 2</li>
</ul>
</div>
<div className="code-column">
<h3>Explication du code</h3>
<p>{codeExplanation}</p>
</div>
<div className="image-column">
<h3>Image générée</h3>
{generatedImage && <img src={generatedImage} alt="Generated theme" />}
</div>
</div>
);
}
function generateExplanation(code) {
// Example explanation for CSS
return "Ce code CSS définit la couleur de fond du site à une nuance de tomate.";
}
function generateImageFromCode(code) {
// Logic to generate image from code, or render a preview of the theme
return 'path_to_generated_image.png';
}
export default ProjectSpace;
CSS pour organiser les colonnes :
.project-space {
display: flex;
justify-content: space-between;
}
.sidebar {
width: 20%;
padding: 10px;
}
.code-column, .image-column {
width: 40%;
padding: 10px;
}
- README.md +8 -5
- components/code-explanation.js +125 -0
- components/image-generator.js +137 -0
- components/sidebar.js +154 -0
- index.html +37 -19
- script.js +63 -0
- style.css +29 -19
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: CodeWhale - The Dev Dashboard 🐋
|
| 3 |
+
colorFrom: pink
|
| 4 |
+
colorTo: red
|
| 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).
|
|
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomCodeExplanation extends HTMLElement {
|
| 2 |
+
constructor() {
|
| 3 |
+
super();
|
| 4 |
+
this.attachShadow({ mode: 'open' });
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
connectedCallback() {
|
| 8 |
+
this.render();
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
static get observedAttributes() {
|
| 12 |
+
return ['explanation', 'generated-code'];
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
attributeChangedCallback(name, oldValue, newValue) {
|
| 16 |
+
if (oldValue !== newValue) {
|
| 17 |
+
this.render();
|
| 18 |
+
}
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
render() {
|
| 22 |
+
const explanation = this.getAttribute('explanation') || 'Select a tool to generate code and see explanations';
|
| 23 |
+
const generatedCode = this.getAttribute('generated-code') || '// No code generated yet';
|
| 24 |
+
|
| 25 |
+
this.shadowRoot.innerHTML = `
|
| 26 |
+
<style>
|
| 27 |
+
:host {
|
| 28 |
+
display: block;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
.header {
|
| 32 |
+
display: flex;
|
| 33 |
+
align-items: center;
|
| 34 |
+
margin-bottom: 1.5rem;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.header i {
|
| 38 |
+
margin-right: 0.75rem;
|
| 39 |
+
color: #3b82f6;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
.header h2 {
|
| 43 |
+
font-size: 1.25rem;
|
| 44 |
+
font-weight: 600;
|
| 45 |
+
color: #1e293b;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
.explanation-box {
|
| 49 |
+
background-color: #f8fafc;
|
| 50 |
+
border-radius: 0.5rem;
|
| 51 |
+
padding: 1.5rem;
|
| 52 |
+
margin-bottom: 1.5rem;
|
| 53 |
+
border: 1px solid #e2e8f0;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
.code-box {
|
| 57 |
+
background-color: #1e293b;
|
| 58 |
+
color: #f8fafc;
|
| 59 |
+
border-radius: 0.5rem;
|
| 60 |
+
padding: 1.5rem;
|
| 61 |
+
font-family: monospace;
|
| 62 |
+
white-space: pre-wrap;
|
| 63 |
+
position: relative;
|
| 64 |
+
overflow: hidden;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
.code-box::before {
|
| 68 |
+
content: 'CODE';
|
| 69 |
+
position: absolute;
|
| 70 |
+
top: 0;
|
| 71 |
+
right: 0;
|
| 72 |
+
background-color: #3b82f6;
|
| 73 |
+
color: white;
|
| 74 |
+
font-size: 0.75rem;
|
| 75 |
+
padding: 0.25rem 0.5rem;
|
| 76 |
+
border-bottom-left-radius: 0.5rem;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
.code-tabs {
|
| 80 |
+
display: flex;
|
| 81 |
+
margin-bottom: -1px;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
.code-tab {
|
| 85 |
+
padding: 0.5rem 1rem;
|
| 86 |
+
background-color: #e2e8f0;
|
| 87 |
+
border: 1px solid #cbd5e1;
|
| 88 |
+
border-bottom: none;
|
| 89 |
+
border-radius: 0.375rem 0.375rem 0 0;
|
| 90 |
+
margin-right: 0.25rem;
|
| 91 |
+
cursor: pointer;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
.code-tab.active {
|
| 95 |
+
background-color: #1e293b;
|
| 96 |
+
color: white;
|
| 97 |
+
border-color: #1e293b;
|
| 98 |
+
}
|
| 99 |
+
</style>
|
| 100 |
+
|
| 101 |
+
<div class="header">
|
| 102 |
+
<i data-feather="book-open"></i>
|
| 103 |
+
<h2>Explication du Code</h2>
|
| 104 |
+
</div>
|
| 105 |
+
|
| 106 |
+
<div class="explanation-box">
|
| 107 |
+
${explanation}
|
| 108 |
+
</div>
|
| 109 |
+
|
| 110 |
+
<div class="code-tabs">
|
| 111 |
+
<div class="code-tab active">CSS</div>
|
| 112 |
+
<div class="code-tab">HTML</div>
|
| 113 |
+
<div class="code-tab">JS</div>
|
| 114 |
+
</div>
|
| 115 |
+
|
| 116 |
+
<div class="code-box">
|
| 117 |
+
${generatedCode}
|
| 118 |
+
</div>
|
| 119 |
+
`;
|
| 120 |
+
|
| 121 |
+
feather.replace();
|
| 122 |
+
}
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
customElements.define('custom-code-explanation', CustomCodeExplanation);
|
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomImageGenerator extends HTMLElement {
|
| 2 |
+
constructor() {
|
| 3 |
+
super();
|
| 4 |
+
this.attachShadow({ mode: 'open' });
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
connectedCallback() {
|
| 8 |
+
this.render();
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
static get observedAttributes() {
|
| 12 |
+
return ['image-data'];
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
attributeChangedCallback(name, oldValue, newValue) {
|
| 16 |
+
if (oldValue !== newValue) {
|
| 17 |
+
this.render();
|
| 18 |
+
}
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
render() {
|
| 22 |
+
const imageData = this.getAttribute('image-data') || '';
|
| 23 |
+
const hasImage = imageData !== '';
|
| 24 |
+
|
| 25 |
+
this.shadowRoot.innerHTML = `
|
| 26 |
+
<style>
|
| 27 |
+
:host {
|
| 28 |
+
display: block;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
.header {
|
| 32 |
+
display: flex;
|
| 33 |
+
align-items: center;
|
| 34 |
+
margin-bottom: 1.5rem;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.header i {
|
| 38 |
+
margin-right: 0.75rem;
|
| 39 |
+
color: #3b82f6;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
.header h2 {
|
| 43 |
+
font-size: 1.25rem;
|
| 44 |
+
font-weight: 600;
|
| 45 |
+
color: #1e293b;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
.image-container {
|
| 49 |
+
background-color: #f8fafc;
|
| 50 |
+
border-radius: 0.5rem;
|
| 51 |
+
padding: 1.5rem;
|
| 52 |
+
border: 1px solid #e2e8f0;
|
| 53 |
+
min-height: 300px;
|
| 54 |
+
display: flex;
|
| 55 |
+
flex-direction: column;
|
| 56 |
+
align-items: center;
|
| 57 |
+
justify-content: center;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
.generated-image {
|
| 61 |
+
max-width: 100%;
|
| 62 |
+
border-radius: 0.375rem;
|
| 63 |
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
.placeholder {
|
| 67 |
+
text-align: center;
|
| 68 |
+
color: #64748b;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
.placeholder i {
|
| 72 |
+
font-size: 3rem;
|
| 73 |
+
margin-bottom: 1rem;
|
| 74 |
+
color: #cbd5e1;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
.image-actions {
|
| 78 |
+
display: flex;
|
| 79 |
+
margin-top: 1.5rem;
|
| 80 |
+
gap: 0.75rem;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
.action-button {
|
| 84 |
+
padding: 0.5rem 1rem;
|
| 85 |
+
background-color: #3b82f6;
|
| 86 |
+
color: white;
|
| 87 |
+
border: none;
|
| 88 |
+
border-radius: 0.375rem;
|
| 89 |
+
cursor: pointer;
|
| 90 |
+
display: flex;
|
| 91 |
+
align-items: center;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
.action-button i {
|
| 95 |
+
margin-right: 0.5rem;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
.action-button.secondary {
|
| 99 |
+
background-color: #e2e8f0;
|
| 100 |
+
color: #1e293b;
|
| 101 |
+
}
|
| 102 |
+
</style>
|
| 103 |
+
|
| 104 |
+
<div class="header">
|
| 105 |
+
<i data-feather="image"></i>
|
| 106 |
+
<h2>Visualisation du Thème</h2>
|
| 107 |
+
</div>
|
| 108 |
+
|
| 109 |
+
<div class="image-container">
|
| 110 |
+
${hasImage ?
|
| 111 |
+
`<img src="${imageData}" alt="Generated theme preview" class="generated-image">` :
|
| 112 |
+
`<div class="placeholder">
|
| 113 |
+
<i data-feather="image"></i>
|
| 114 |
+
<p>Générez un thème pour voir la prévisualisation</p>
|
| 115 |
+
</div>`
|
| 116 |
+
}
|
| 117 |
+
</div>
|
| 118 |
+
|
| 119 |
+
${hasImage ? `
|
| 120 |
+
<div class="image-actions">
|
| 121 |
+
<button class="action-button">
|
| 122 |
+
<i data-feather="download"></i>
|
| 123 |
+
Télécharger
|
| 124 |
+
</button>
|
| 125 |
+
<button class="action-button secondary">
|
| 126 |
+
<i data-feather="refresh-cw"></i>
|
| 127 |
+
Régénérer
|
| 128 |
+
</button>
|
| 129 |
+
</div>
|
| 130 |
+
` : ''}
|
| 131 |
+
`;
|
| 132 |
+
|
| 133 |
+
feather.replace();
|
| 134 |
+
}
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
customElements.define('custom-image-generator', CustomImageGenerator);
|
|
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomSidebar extends HTMLElement {
|
| 2 |
+
constructor() {
|
| 3 |
+
super();
|
| 4 |
+
this.attachShadow({ mode: 'open' });
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
connectedCallback() {
|
| 8 |
+
this.render();
|
| 9 |
+
this.addEventListeners();
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
static get observedAttributes() {
|
| 13 |
+
return ['current-project', 'current-tool'];
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
attributeChangedCallback(name, oldValue, newValue) {
|
| 17 |
+
if (oldValue !== newValue) {
|
| 18 |
+
this.render();
|
| 19 |
+
}
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
render() {
|
| 23 |
+
const currentProject = this.getAttribute('current-project') || 'Espace Codage - Projet 1';
|
| 24 |
+
const currentTool = this.getAttribute('current-tool') || '';
|
| 25 |
+
|
| 26 |
+
this.shadowRoot.innerHTML = `
|
| 27 |
+
<style>
|
| 28 |
+
:host {
|
| 29 |
+
display: block;
|
| 30 |
+
width: 280px;
|
| 31 |
+
height: 100%;
|
| 32 |
+
background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
|
| 33 |
+
color: white;
|
| 34 |
+
padding: 1.5rem;
|
| 35 |
+
box-sizing: border-box;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
.logo {
|
| 39 |
+
display: flex;
|
| 40 |
+
align-items: center;
|
| 41 |
+
margin-bottom: 2rem;
|
| 42 |
+
font-weight: 600;
|
| 43 |
+
font-size: 1.25rem;
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
.logo i {
|
| 47 |
+
margin-right: 0.75rem;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
.section-title {
|
| 51 |
+
font-size: 0.75rem;
|
| 52 |
+
text-transform: uppercase;
|
| 53 |
+
letter-spacing: 0.05em;
|
| 54 |
+
color: #94a3b8;
|
| 55 |
+
margin: 1.5rem 0 0.75rem;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.project-item, .tool-item {
|
| 59 |
+
display: flex;
|
| 60 |
+
align-items: center;
|
| 61 |
+
padding: 0.5rem 0.75rem;
|
| 62 |
+
border-radius: 0.375rem;
|
| 63 |
+
margin-bottom: 0.25rem;
|
| 64 |
+
cursor: pointer;
|
| 65 |
+
transition: all 0.2s;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
.project-item:hover, .tool-item:hover {
|
| 69 |
+
background-color: #334155;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
.project-item.active {
|
| 73 |
+
background-color: #3b82f6;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
.tool-item.active {
|
| 77 |
+
background-color: #334155;
|
| 78 |
+
border-left: 3px solid #3b82f6;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
.project-item i, .tool-item i {
|
| 82 |
+
margin-right: 0.75rem;
|
| 83 |
+
width: 20px;
|
| 84 |
+
text-align: center;
|
| 85 |
+
}
|
| 86 |
+
</style>
|
| 87 |
+
|
| 88 |
+
<div class="logo">
|
| 89 |
+
<i data-feather="code"></i>
|
| 90 |
+
<span>CodeWhale</span>
|
| 91 |
+
</div>
|
| 92 |
+
|
| 93 |
+
<div class="section-title">Projets</div>
|
| 94 |
+
<div class="project-item ${currentProject === 'Espace Codage - Projet 1' ? 'active' : ''}" data-project="Espace Codage - Projet 1">
|
| 95 |
+
<i data-feather="folder"></i>
|
| 96 |
+
<span>Espace Codage - Projet 1</span>
|
| 97 |
+
</div>
|
| 98 |
+
<div class="project-item ${currentProject === 'Espace Codage - Projet 2' ? 'active' : ''}" data-project="Espace Codage - Projet 2">
|
| 99 |
+
<i data-feather="folder"></i>
|
| 100 |
+
<span>Espace Codage - Projet 2</span>
|
| 101 |
+
</div>
|
| 102 |
+
|
| 103 |
+
<div class="section-title">Outils</div>
|
| 104 |
+
<div class="tool-item ${currentTool === 'La Baleine' ? 'active' : ''}" data-tool="La Baleine">
|
| 105 |
+
<i data-feather="cpu"></i>
|
| 106 |
+
<span>La Baleine</span>
|
| 107 |
+
</div>
|
| 108 |
+
<div class="tool-item ${currentTool === 'Rosalinda' ? 'active' : ''}" data-tool="Rosalinda">
|
| 109 |
+
<i data-feather="feather"></i>
|
| 110 |
+
<span>Rosalinda</span>
|
| 111 |
+
</div>
|
| 112 |
+
<div class="tool-item ${currentTool === 'CodeExplainer' ? 'active' : ''}" data-tool="CodeExplainer">
|
| 113 |
+
<i data-feather="book-open"></i>
|
| 114 |
+
<span>CodeExplainer</span>
|
| 115 |
+
</div>
|
| 116 |
+
<div class="tool-item ${currentTool === 'ThemeGenerator' ? 'active' : ''}" data-tool="ThemeGenerator">
|
| 117 |
+
<i data-feather="image"></i>
|
| 118 |
+
<span>ThemeGenerator</span>
|
| 119 |
+
</div>
|
| 120 |
+
`;
|
| 121 |
+
|
| 122 |
+
feather.replace();
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
addEventListeners() {
|
| 126 |
+
this.shadowRoot.addEventListener('click', (e) => {
|
| 127 |
+
const projectItem = e.target.closest('.project-item');
|
| 128 |
+
const toolItem = e.target.closest('.tool-item');
|
| 129 |
+
|
| 130 |
+
if (projectItem) {
|
| 131 |
+
const project = projectItem.getAttribute('data-project');
|
| 132 |
+
window.appState.currentProject = project;
|
| 133 |
+
window.appState.currentTool = null;
|
| 134 |
+
window.appState.updateUI();
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
if (toolItem) {
|
| 138 |
+
const tool = toolItem.getAttribute('data-tool');
|
| 139 |
+
window.appState.currentTool = tool;
|
| 140 |
+
|
| 141 |
+
// Simulate generating some code when a tool is selected
|
| 142 |
+
if (tool === 'ThemeGenerator') {
|
| 143 |
+
window.appState.generatedCode = `body {\n background-color: #f8fafc;\n color: #1e293b;\n}\n\n.button {\n background-color: #3b82f6;\n color: white;\n}`;
|
| 144 |
+
window.appState.codeExplanation = window.appState.generateCodeExplanation(window.appState.generatedCode);
|
| 145 |
+
window.appState.generatedImage = window.appState.generateImageFromCode(window.appState.generatedCode);
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
window.appState.updateUI();
|
| 149 |
+
}
|
| 150 |
+
});
|
| 151 |
+
}
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
customElements.define('custom-sidebar', CustomSidebar);
|
|
@@ -1,19 +1,37 @@
|
|
| 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>CodeWhale - Dev Dashboard</title>
|
| 7 |
+
<link rel="stylesheet" href="style.css">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 10 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 11 |
+
<script src="components/sidebar.js"></script>
|
| 12 |
+
<script src="components/code-explanation.js"></script>
|
| 13 |
+
<script src="components/image-generator.js"></script>
|
| 14 |
+
</head>
|
| 15 |
+
<body class="bg-gray-100 font-sans">
|
| 16 |
+
<div class="flex h-screen overflow-hidden">
|
| 17 |
+
<!-- Sidebar Component -->
|
| 18 |
+
<custom-sidebar></custom-sidebar>
|
| 19 |
+
|
| 20 |
+
<!-- Code Explanation Column -->
|
| 21 |
+
<div class="flex-1 overflow-y-auto p-6 bg-white border-r border-gray-200">
|
| 22 |
+
<custom-code-explanation></custom-code-explanation>
|
| 23 |
+
</div>
|
| 24 |
+
|
| 25 |
+
<!-- Image Generator Column -->
|
| 26 |
+
<div class="flex-1 overflow-y-auto p-6 bg-gray-50">
|
| 27 |
+
<custom-image-generator></custom-image-generator>
|
| 28 |
+
</div>
|
| 29 |
+
</div>
|
| 30 |
+
|
| 31 |
+
<script>
|
| 32 |
+
feather.replace();
|
| 33 |
+
</script>
|
| 34 |
+
<script src="script.js"></script>
|
| 35 |
+
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 36 |
+
</body>
|
| 37 |
+
</html>
|
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Global state management
|
| 2 |
+
const state = {
|
| 3 |
+
currentProject: 'Espace Codage - Projet 1',
|
| 4 |
+
tools: ['La Baleine', 'Rosalinda', 'CodeExplainer', 'ThemeGenerator'],
|
| 5 |
+
currentTool: null,
|
| 6 |
+
generatedCode: '',
|
| 7 |
+
codeExplanation: '',
|
| 8 |
+
generatedImage: null
|
| 9 |
+
};
|
| 10 |
+
|
| 11 |
+
// DOM Elements
|
| 12 |
+
const elements = {
|
| 13 |
+
sidebar: document.querySelector('custom-sidebar'),
|
| 14 |
+
codeExplanation: document.querySelector('custom-code-explanation'),
|
| 15 |
+
imageGenerator: document.querySelector('custom-image-generator')
|
| 16 |
+
};
|
| 17 |
+
|
| 18 |
+
// Event Listeners
|
| 19 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 20 |
+
// Initialize the first project
|
| 21 |
+
updateUI();
|
| 22 |
+
});
|
| 23 |
+
|
| 24 |
+
function updateUI() {
|
| 25 |
+
// Update all components based on current state
|
| 26 |
+
if (elements.sidebar) {
|
| 27 |
+
elements.sidebar.setAttribute('current-project', state.currentProject);
|
| 28 |
+
elements.sidebar.setAttribute('current-tool', state.currentTool || '');
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
if (elements.codeExplanation) {
|
| 32 |
+
elements.codeExplanation.setAttribute('explanation', state.codeExplanation);
|
| 33 |
+
elements.codeExplanation.setAttribute('generated-code', state.generatedCode);
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
if (elements.imageGenerator) {
|
| 37 |
+
elements.imageGenerator.setAttribute('image-data', state.generatedImage || '');
|
| 38 |
+
}
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
// Example function to generate code explanation
|
| 42 |
+
function generateCodeExplanation(code) {
|
| 43 |
+
// This would be replaced with actual AI explanation logic
|
| 44 |
+
return `The generated CSS defines visual styles for the application:
|
| 45 |
+
- Background color: Sets the main background
|
| 46 |
+
- Scrollbar: Customizes the scrollbar appearance
|
| 47 |
+
- Animations: Adds subtle pulse animation
|
| 48 |
+
- Transitions: Smooth hover effects`;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
// Example function to simulate image generation
|
| 52 |
+
function generateImageFromCode(code) {
|
| 53 |
+
// In a real app, this would use Canvas or similar to render the code visually
|
| 54 |
+
return 'http://static.photos/technology/640x360/42';
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
// Export functions for components to use
|
| 58 |
+
window.appState = {
|
| 59 |
+
...state,
|
| 60 |
+
updateUI,
|
| 61 |
+
generateCodeExplanation,
|
| 62 |
+
generateImageFromCode
|
| 63 |
+
};
|
|
@@ -1,28 +1,38 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
}
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
margin-top: 0;
|
| 9 |
}
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
margin-bottom: 10px;
|
| 15 |
-
margin-top: 5px;
|
| 16 |
}
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
margin: 0 auto;
|
| 21 |
-
padding: 16px;
|
| 22 |
-
border: 1px solid lightgray;
|
| 23 |
-
border-radius: 16px;
|
| 24 |
}
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Custom scrollbar */
|
| 2 |
+
::-webkit-scrollbar {
|
| 3 |
+
width: 8px;
|
| 4 |
}
|
| 5 |
|
| 6 |
+
::-webkit-scrollbar-track {
|
| 7 |
+
background: #f1f1f1;
|
|
|
|
| 8 |
}
|
| 9 |
|
| 10 |
+
::-webkit-scrollbar-thumb {
|
| 11 |
+
background: #888;
|
| 12 |
+
border-radius: 4px;
|
|
|
|
|
|
|
| 13 |
}
|
| 14 |
|
| 15 |
+
::-webkit-scrollbar-thumb:hover {
|
| 16 |
+
background: #555;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
}
|
| 18 |
|
| 19 |
+
/* Animation for code blocks */
|
| 20 |
+
@keyframes pulse {
|
| 21 |
+
0%, 100% {
|
| 22 |
+
opacity: 1;
|
| 23 |
+
}
|
| 24 |
+
50% {
|
| 25 |
+
opacity: 0.5;
|
| 26 |
+
}
|
| 27 |
}
|
| 28 |
+
|
| 29 |
+
.animate-pulse {
|
| 30 |
+
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
/* Transition effects */
|
| 34 |
+
.transition-all {
|
| 35 |
+
transition-property: all;
|
| 36 |
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
| 37 |
+
transition-duration: 150ms;
|
| 38 |
+
}
|