-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
180 lines (161 loc) · 7.86 KB
/
Copy pathindex.html
File metadata and controls
180 lines (161 loc) · 7.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JamBoard — Professional Whiteboard</title>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- Top toolbar -->
<header id="top-bar">
<div class="brand"><i class="fas fa-chalkboard"></i> JamBoard</div>
<div class="top-actions">
<button id="undo-btn" class="icon-btn" title="Undo (Ctrl+Z)" onclick="undo()">
<i class="fas fa-rotate-left"></i>
</button>
<button id="redo-btn" class="icon-btn" title="Redo (Ctrl+Shift+Z)" onclick="redo()">
<i class="fas fa-rotate-right"></i>
</button>
<span class="divider"></span>
<button id="grid-btn" class="icon-btn" title="Toggle grid" onclick="toggleGrid()">
<i class="fas fa-border-all"></i>
</button>
<button id="snap-btn" class="icon-btn" title="Snap to grid" onclick="toggleSnap()">
<i class="fas fa-magnet"></i>
</button>
<button id="layers-btn" class="icon-btn" title="Layers panel" onclick="toggleLayersPanel()">
<i class="fas fa-layer-group"></i>
</button>
<button id="theme-btn" class="icon-btn" title="Toggle dark mode" onclick="toggleTheme()">
<i class="fas fa-moon"></i>
</button>
<span class="divider"></span>
<div class="dropdown" id="export-dropdown">
<button class="icon-btn" title="Export board" onclick="toggleExportMenu(event)">
<i class="fas fa-download"></i>
</button>
<div class="dropdown-menu" id="export-menu">
<button onclick="exportPNG()"><i class="far fa-image"></i> Export as PNG</button>
<button onclick="exportSVG()"><i class="fas fa-bezier-curve"></i> Export as SVG</button>
<button onclick="exportPDFFile()"><i class="far fa-file-pdf"></i> Export as PDF</button>
</div>
</div>
<button id="fullscreen-button" class="icon-btn" title="Toggle fullscreen (F)" onclick="toggleFullscreen()">
<i class="fas fa-expand"></i>
</button>
</div>
</header>
<!-- Layout -->
<div class="board-layout">
<!-- Sidebar -->
<aside id="side-menu">
<button id="pointer-tool" class="tool-btn active" data-tool="pointer" title="Select (V)" onclick="setTool('pointer')">
<i class="fas fa-mouse-pointer"></i>
</button>
<button id="pen-tool" class="tool-btn" data-tool="pen" title="Pen (P)" onclick="setTool('pen')">
<i class="fas fa-pen"></i>
</button>
<button id="eraser-tool" class="tool-btn" data-tool="eraser" title="Eraser (E)" onclick="setTool('eraser')">
<i class="fas fa-eraser"></i>
</button>
<button id="text-tool" class="tool-btn" data-tool="text" title="Text (T)" onclick="setTool('text')">
<i class="fas fa-font"></i>
</button>
<button id="note-tool" class="tool-btn" data-tool="note" title="Sticky note (N)" onclick="setTool('note')">
<i class="fas fa-note-sticky"></i>
</button>
<div class="dropdown shapes-dropdown" id="shapes-dropdown">
<button id="shapes-tool" class="tool-btn" title="Shapes" onclick="toggleShapesMenu(event)">
<i class="fas fa-shapes"></i>
</button>
<div class="dropdown-menu shapes-menu" id="shapes-menu">
<button class="tool-btn" data-tool="line" title="Line (L)" onclick="setTool('line')"><i class="fas fa-minus"></i></button>
<button class="tool-btn" data-tool="rectangle" title="Rectangle (R)" onclick="setTool('rectangle')"><i class="far fa-square"></i></button>
<button class="tool-btn" data-tool="ellipse" title="Ellipse (O)" onclick="setTool('ellipse')"><i class="far fa-circle"></i></button>
<button class="tool-btn" data-tool="arrow" title="Arrow (A)" onclick="setTool('arrow')"><i class="fas fa-arrow-right"></i></button>
<button class="tool-btn" data-tool="triangle" title="Triangle" onclick="setTool('triangle')"><span class="glyph">▲</span></button>
</div>
</div>
<span class="side-divider"></span>
<button id="upload-button" class="tool-btn" title="Upload image" onclick="uploadImage()">
<i class="fas fa-upload"></i>
</button>
<button id="delete-button" class="tool-btn danger" title="Clear board" onclick="deleteEntire()">
<i class="fas fa-trash"></i>
</button>
</aside>
<!-- Main Content -->
<main class="board-main">
<!-- Dynamic Tool Options -->
<section id="tool-options-container">
<div id="common-options" class="tool-options active">
<label title="Stroke color">Color
<input type="color" id="pen-color" value="#111111">
</label>
<label title="Stroke width">Width
<input type="range" id="pen-size" min="1" max="40" value="4">
<span id="pen-size-value" class="value-badge">4</span>
</label>
<label title="Opacity">Opacity
<input type="range" id="opacity" min="5" max="100" value="100">
<span id="opacity-value" class="value-badge">100%</span>
</label>
<label class="checkbox-label" title="Dashed stroke">
<input type="checkbox" id="dashed">
Dashed
</label>
<label class="checkbox-label shape-only" id="fill-toggle-label" title="Fill shape">
<input type="checkbox" id="fill-toggle">
Fill
</label>
<label class="shape-only" id="fill-color-label" title="Fill color">
<input type="color" id="fill-color" value="#7c4dff">
</label>
<label id="eraser-size-label" title="Eraser size">Size
<input type="range" id="eraser-size" min="4" max="80" value="24">
<span id="eraser-size-value" class="value-badge">24</span>
</label>
<label id="font-size-label" title="Font size">Font
<input type="number" id="font-size" value="20" min="8" max="140">
</label>
<label id="note-color-label" title="Note color">Note
<input type="color" id="note-color" value="#fff59d">
</label>
</div>
</section>
<!-- Whiteboard Canvas -->
<section id="canvas-wrap">
<canvas id="whiteboard"></canvas>
<div id="text-editor-overlay" contenteditable="true" spellcheck="false"></div>
</section>
<!-- Floating zoom bar -->
<div id="zoom-bar">
<button class="icon-btn" title="Zoom out" onclick="zoomBy(-0.1)"><i class="fas fa-minus"></i></button>
<span id="zoom-value">100%</span>
<button class="icon-btn" title="Zoom in" onclick="zoomBy(0.1)"><i class="fas fa-plus"></i></button>
<span class="divider"></span>
<button class="icon-btn" title="Fit to screen" onclick="fitToScreen()"><i class="fas fa-compress-arrows-alt"></i></button>
<button class="icon-btn" title="Reset view" onclick="resetView()"><i class="fas fa-crosshairs"></i></button>
</div>
<!-- Layers panel -->
<aside id="layers-panel">
<div class="layers-header">
<span>Layers</span>
<button class="icon-btn" title="Close" onclick="toggleLayersPanel()"><i class="fas fa-xmark"></i></button>
</div>
<ul id="layers-list"></ul>
</aside>
<footer class="mt-auto">
<div class="container text-center py-2">
<h6>JamBoard | Made with ❤️ by <a href="https://github.com/skvprogrammer" target="_blank" rel="noopener">SKV</a></h6>
</div>
</footer>
</main>
</div>
<script src="script.js"></script>
</body>
</html>