<!doctype html>
Browse files<html lang="fr">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Espace Codage</title>
<link rel="stylesheet" href="./styles.css" />
</head>
<body>
<div class="app">
<!-- COLONNE 1 : Sidebar -->
<aside class="sidebar">
<div class="brand">
<span class="dot"></span>
<span class="brand-title">Espace Codage</span>
</div>
<div class="searchbox">
<button class="icon-btn" title="Nouveau">
✎
</button>
<input type="text" placeholder="Rechercher..." />
</div>
<div class="section-title">PROJETS</div>
<button class="nav-item active">Espace Codage - Projet 1</button>
<button class="nav-item">Espace Codage - Projet 2</button>
<div class="section-title">RACCOURCIS</div>
<button class="nav-item">Bibliothèque</button>
<button class="nav-item">Paramètres</button>
<div class="footer-left">
<span class="badge">Made with DeepSite</span>
<span class="profile">profil</span>
</div>
</aside>
<!-- COLONNE 2 : Zone centrale (vide) + input en bas -->
<main class="center">
<div class="top-tabs">
<button class="pill active">Aperçu</button>
<button class="pill">Projet</button>
<button class="pill">/</button>
</div>
<div class="center-content">
<div class="empty-title">Zone centrale vide</div>
<div class="empty-sub">La barre de recherche / saisie reste en bas, comme demandé.</div>
</div>
<div class="composer">
<button id="btnPlus" class="compose-btn" title="Ajouter">
+
</button>
<label class="compose-btn" title="Joindre un fichier">
📎
<input id="fileInput" type="file" hidden />
</label>
<input id="prompt" class="compose-input" placeholder="Rechercher / écrire..." />
<button id="btnMic" class="compose-btn mic" title="Micro">
🎤
</button>
<button id="btnSend" class="compose-btn send" title="Envoyer">
➤
</button>
</div>
</main>
<!-- COLONNE 3 : Aperçu (iframe) -->
<aside class="preview">
<div class="preview-top">
<div class="preview-title">Aperçu</div>
<div class="preview-actions">
<button id="btnBack" class="mini">‹</button>
<button id="btnForward" class="mini">›</button>
<button id="btnReload" class="mini">↻</button>
<button id="btnOpen" class="mini">⤢</button>
<button id="btnEdit" class="mini big">Modifier</button>
</div>
</div>
<div class="preview-frame-wrap">
<iframe id="previewFrame" title="preview" src="./preview.html"></iframe>
<!-- Overlay erreurs preview -->
<div id="previewError" class="preview-error hidden">
<div class="err-icon">!</div>
<div class="err-title">Échec du chargement de l’aperçu.</div>
<div class="err-sub">Vérifie l’URL / le serveur local, puis rafraîchis.</div>
</div>
</div>
<div class="statusbar">
<span>Statut : <b id="statusTxt">En ligne</b></span>
<span>Mode : <b>Preview</b></span>
</div>
</aside>
</div>
<script src="./app.js"></script>
</body>
</html>
B) styles.css
css
Copier le code
:root{
--bg:#0b1220;
--panel:#121c2c;
--panel2:#101a29;
--stroke:rgba(255,255,255,.08);
--text:rgba(255,255,255,.92);
--muted:rgba(255,255,255,.62);
--muted2:rgba(255,255,255,.45);
--accent:#2f6df6;
--radius:16px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
margin:0;
font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
background:radial-gradient(1200px 800px at 50% 30%, #111b2e 0%, #070d18 60%, #050a13 100%);
color:var(--text);
}
.app{
height:100vh;
display:grid;
grid-template-columns: 320px 1fr 420px;
gap:18px;
padding:16px;
}
.sidebar,.center,.preview{
background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
border:1px solid var(--stroke);
border-radius:var(--radius);
overflow:hidden;
}
.sidebar{
padding:18px 14px;
display:flex;
flex-direction:column;
}
.brand{
display:flex;
align-items:center;
gap:10px;
padding:6px 8px 18px 8px;
}
.dot{
width:10px;height:10px;border-radius:50%;
background:#2ed3b7;
box-shadow:0 0 0 4px rgba(46,211,183,.15);
}
.brand-title{font-weight:700}
.searchbox{
display:flex;
align-items:center;
gap:10px;
padding:10px;
border:1px solid var(--stroke);
border-radius:12px;
background:rgba(0,0,0,.15);
}
.searchbox input{
width:100%;
background:transparent;
border:0;
outline:0;
color:var(--text);
}
.icon-btn{
width:34px;height:34px;
border-radius:10px;
border:1px solid var(--stroke);
background:rgba(255,255,255,.04);
color:var(--text);
cursor:pointer;
}
.section-title{
margin:18px 10px 8px;
font-size:12px;
letter-spacing:.12em;
color:var(--muted2);
}
.nav-item{
text-align:left;
margin:6px 6px;
padding:12px 12px;
border-radius:12px;
border:1px solid var(--stroke);
background:rgba(0,0,0,.12);
color:var(--text);
cursor:pointer;
}
.nav-item.active{
background:rgba(47,109,246,.18);
border-color:rgba(47,109,246,.35);
}
.footer-left{
margin-top:auto;
display:flex;
justify-content:space-between;
align-items:center;
padding:10px 8px 6px;
color:var(--muted2);
font-size:12px;
}
.badge{
border:1px solid var(--stroke);
border-radius:999px;
padding:6px 10px;
background:rgba(0,0,0,.12);
}
/* CENTRE */
.center{
position:relative;
display:flex;
flex-direction:column;
}
.top-tabs{
padding:12px 14px;
display:flex;
gap:10px;
}
.pill{
border:1px solid var(--stroke);
border-radius:999px;
padding:8px 12px;
background:rgba(0,0,0,.12);
color:var(--muted);
cursor:pointer;
}
.pill.active{
background:rgba(255,255,255,.06);
color:var(--text);
}
.center-content{
flex:1;
display:flex;
flex-direction:column;
align-items:center;
justify-content:center;
text-align:center;
padding:30px;
}
.empty-title{font-size:18px;font-weight:700}
.empty-sub{margin-top:8px;color:var(--muted)}
/* BARRE EN BAS */
.composer{
display:flex;
gap:10px;
align-items:center;
padding:12px;
border-top:1px solid var(--stroke);
background:rgba(0,0,0,.12);
}
.compose-btn{
width:42px;height:42px;
display:grid;
place-items:center;
border-radius:12px;
border:1px solid var(--stroke);
background:rgba(255,255,255,.04);
color:var(--text);
cursor:pointer;
user-select:none;
}
.compose-btn.send{
background:rgba(47,109,246,.22);
border-color:rgba(47,109,246,.35);
}
.compose-btn.mic.listening{
outline:2px solid rgba(46,211,183,.45);
}
.compose-input{
flex:1;
height:42px;
border-radius:12px;
border:1px solid var(--stroke);
background:rgba(0,0,0,.14);
color:var(--text);
padding:0 12px;
outline:none;
}
/* PREVIEW */
.preview{
display:flex;
flex-direction:column;
}
.preview-top{
display:flex;
justify-content:space-between;
align-items:center;
padding:12px 12px;
border-bottom:1px solid var(--stroke);
}
.preview-title{font-weight:700}
.preview-actions{display:flex;gap:8px;align-items:center}
.mini{
height:34px;
padding:0 10px;
border-radius:10px;
border:1px solid var(--stroke);
background:rgba(255,255,255,.04);
color:var(--text);
cursor:pointer;
}
.mini.big{padding:0 12px}
.preview-frame-wrap{
position:relative;
flex:1;
background:rgba(0,0,0,.14);
}
iframe{
width:100%;
height:100%;
border:0;
background:white;
}
.preview-error{
position:absolute;
inset:0;
display:flex;
flex-direction:column;
justify-content:center;
align-items:center;
gap:10px;
text-align:center;
background:rgba(6,10,19,.88);
}
.preview-error.hidden{display:none}
.err-icon{
width:58px;height:58px;border-radius:50%;
display:grid;place-items:center;
background:rgba(255,90,90,.18);
border:1px solid rgba(255,90,90,.35);
font-weight:900;
}
.err-title{font-weight:800}
.err-sub{color:var(--muted);max-width:280px}
.statusbar{
display:flex;
justify-content:space-between;
padding:10px 12px;
border-top:1px solid var(--stroke);
color:var(--muted);
}
C) app.js
javascript
Copier le code
// ========= Preview controls =========
const frame = document.getElementById("previewFrame");
const previewError = document.getElementById("previewError");
const statusTxt = document.getElementById("statusTxt");
function showError(on){
previewError.classList.toggle("hidden", !on);
statusTxt.textContent = on ? "Hors ligne" : "En ligne";
}
frame.addEventListener("load", () => {
// Si la page charge, on masque l’erreur
showError(false);
});
// Si le navigateur bloque/échec réseau, on n’a pas toujours d’event "error" sur iframe.
// Donc on fait un petit "ping" de preview.html.
async function pingPreview() {
try{
const res = await fetch("./preview.html", { cache: "no-store" });
if(!res.ok) throw new Error("bad status");
showError(false);
}catch(e){
showError(true);
}
}
pingPreview();
document.getElementById("btnReload").addEventListener("click", async () => {
await pingPreview();
frame.src = frame.src; // reload
});
document.getElementById("btnOpen").addEventListener("click", () => {
window.open("./preview.html", "_blank");
});
// ========= Composer / Input =========
const promptEl = document.getElementById("prompt");
const fileInput = document.getElementById("fileInput");
document.getElementById("btnPlus").addEventListener("click", () => {
// Ici tu peux ouvrir un menu. Pour le test : focus input.
promptEl.focus();
});
// Upload file (trombone)
fileInput.addEventListener("change", () => {
const f = fileInput.files?.[0];
if(!f) return;
alert(`Fichier ajouté : ${f.name} (${Math.round(f.size/1024)} Ko)`);
fileInput.value = "";
});
// Send button
document.getElementById("btnSend").addEventListener("click", () => {
const text = promptEl.value.trim();
if(!text) return;
// Test: on envoie le texte vers la preview via localStorage
localStorage.setItem("preview_prompt", tex
- components/footer.js +50 -0
- components/navbar.js +5 -5
- profile.html +31 -0
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomFooter extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
:host {
|
| 7 |
+
display: block;
|
| 8 |
+
background: var(--bg-panel-dark);
|
| 9 |
+
border-radius: var(--radius);
|
| 10 |
+
padding: 16px;
|
| 11 |
+
border: 1px solid var(--border);
|
| 12 |
+
box-shadow: var(--shadow);
|
| 13 |
+
margin-top: auto;
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
.footer-content {
|
| 17 |
+
display: flex;
|
| 18 |
+
justify-content: space-between;
|
| 19 |
+
align-items: center;
|
| 20 |
+
padding: 10px 8px 6px;
|
| 21 |
+
color: var(--text-muted);
|
| 22 |
+
font-size: 12px;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
.badge {
|
| 26 |
+
border: 1px solid var(--border);
|
| 27 |
+
border-radius: 999px;
|
| 28 |
+
padding: 6px 10px;
|
| 29 |
+
background: rgba(0, 0, 0, 0.12);
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
.profile-link {
|
| 33 |
+
color: var(--text-muted);
|
| 34 |
+
text-decoration: none;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.profile-link:hover {
|
| 38 |
+
color: var(--text-light);
|
| 39 |
+
}
|
| 40 |
+
</style>
|
| 41 |
+
|
| 42 |
+
<div class="footer-content">
|
| 43 |
+
<span class="badge">Made with DeepSite</span>
|
| 44 |
+
<a href="/profile.html" class="profile-link">Profil</a>
|
| 45 |
+
</div>
|
| 46 |
+
`;
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
customElements.define('custom-footer', CustomFooter);
|
|
@@ -116,12 +116,12 @@ class CustomNavbar extends HTMLElement {
|
|
| 116 |
</div>
|
| 117 |
<div class="nav-label">Bibliothèque</div>
|
| 118 |
</div>
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
|
|
|
|
|
|
| 122 |
</div>
|
| 123 |
-
<div class="nav-label">Paramètres</div>
|
| 124 |
-
</div>
|
| 125 |
`;
|
| 126 |
|
| 127 |
// Replace feather icons
|
|
|
|
| 116 |
</div>
|
| 117 |
<div class="nav-label">Bibliothèque</div>
|
| 118 |
</div>
|
| 119 |
+
<div class="nav-item">
|
| 120 |
+
<div class="nav-icon">
|
| 121 |
+
<i data-feather="settings"></i>
|
| 122 |
+
</div>
|
| 123 |
+
<a href="/profile.html" class="nav-label">Profil & Paramètres</a>
|
| 124 |
</div>
|
|
|
|
|
|
|
| 125 |
`;
|
| 126 |
|
| 127 |
// Replace feather icons
|
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="fr">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Profil | Espace Codage</title>
|
| 7 |
+
<link rel="stylesheet" href="style.css">
|
| 8 |
+
</head>
|
| 9 |
+
<body>
|
| 10 |
+
<custom-navbar></custom-navbar>
|
| 11 |
+
|
| 12 |
+
<div class="app-container">
|
| 13 |
+
<main class="main-content">
|
| 14 |
+
<div class="content-header">
|
| 15 |
+
<div class="tag">Profil</div>
|
| 16 |
+
</div>
|
| 17 |
+
|
| 18 |
+
<div class="empty-state">
|
| 19 |
+
<h3>Page de profil</h3>
|
| 20 |
+
<p>Cette page affichera les informations et paramètres de votre compte.</p>
|
| 21 |
+
</div>
|
| 22 |
+
</main>
|
| 23 |
+
</div>
|
| 24 |
+
|
| 25 |
+
<custom-footer></custom-footer>
|
| 26 |
+
|
| 27 |
+
<script src="components/navbar.js"></script>
|
| 28 |
+
<script src="components/footer.js"></script>
|
| 29 |
+
<script src="script.js"></script>
|
| 30 |
+
</body>
|
| 31 |
+
</html>
|