Diagrammer 0.98
by velo_ninja
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Diagram Editor</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/konva.min.js"></script>
<style>
/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { display: flex; height: 100vh; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #eef1f5; }
/* Toolbar */
#toolbar {
width: 260px;
background: #2c3e50;
padding: 20px;
display: flex;
flex-direction: column;
gap: 15px;
box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}
#toolbar button {
background: #3498db;
color: #fff;
border: none;
border-radius: 5px;
padding: 12px;
font-size: 14px;
cursor: pointer;
transition: background 0.3s ease, transform 0.2s ease;
}
#toolbar button:hover {
background: #5dade2;
transform: translateY(-2px);
}
/* Canvas Container */
#container {
flex: 1;
margin: 20px;
background: #fff;
border-radius: 8px;
box-shadow: 0 4px 20px rgba(0,0,0,0.1);
position: relative;
overflow: hidden;
}
/* Context Menu */
#context-menu {
position: absolute;
display: none;
background: #fff;
border-radius: 5px;
border: 1px solid #ccc;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
z-index: 1000;
min-width: 180px;
}
#context-menu ul { list-style: none; }
#context-menu li {
padding: 10px 14px;
font-size: 13px;
color: #333;
cursor: pointer;
transition: background 0.2s ease;
}
#context-menu li:hover { background: #f4f6fa; }
/* Konva Canvas Styling */
#container canvas {
border-radius: 8px;
background: #fcfcfc;
}
/* Input Modal */
#input-modal { display: none; position: fixed; top: 0; left:...