|
6 | 6 | <title>Notes - Study Hub</title> |
7 | 7 | <!-- Add jsPDF library for PDF generation --> |
8 | 8 | <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script> |
| 9 | + <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> |
9 | 10 | <style> |
10 | 11 | * { |
11 | 12 | margin: 0; |
|
72 | 73 | textarea, |
73 | 74 | #canvas { |
74 | 75 | width: 100%; |
75 | | - height: 300px; |
| 76 | + height: 600px; |
76 | 77 | padding: 10px; |
77 | 78 | font-size: 1.1em; |
78 | 79 | border: 1px solid #ccc; |
|
234 | 235 | display: none; |
235 | 236 | z-index: 1001; |
236 | 237 | } |
| 238 | + |
| 239 | + .material-icons { |
| 240 | + font-size: 18px; |
| 241 | + vertical-align: middle; |
| 242 | + } |
| 243 | + |
| 244 | + .format-button { |
| 245 | + display: flex; |
| 246 | + align-items: center; |
| 247 | + justify-content: center; |
| 248 | + min-width: 30px; |
| 249 | + height: 30px; |
| 250 | + } |
237 | 251 | </style> |
238 | 252 | </head> |
239 | 253 |
|
@@ -274,10 +288,19 @@ <h2>Your Notes</h2> |
274 | 288 | <button class="format-button" onclick="formatText('bold')" title="Bold">B</button> |
275 | 289 | <button class="format-button" onclick="formatText('italic')">I</button> |
276 | 290 | <button class="format-button" onclick="formatText('bullet')">• List</button> |
| 291 | + <button class="format-button" onclick="formatText('left')" title="Align Left"> |
| 292 | + <span class="material-icons">format_align_left</span> |
| 293 | + </button> |
| 294 | + <button class="format-button" onclick="formatText('center')" title="Center"> |
| 295 | + <span class="material-icons">format_align_center</span> |
| 296 | + </button> |
| 297 | + <button class="format-button" onclick="formatText('right')" title="Align Right"> |
| 298 | + <span class="material-icons">format_align_right</span> |
| 299 | + </button> |
277 | 300 | </div> |
278 | 301 |
|
279 | 302 | <textarea id="notes" placeholder="Write your notes here..."></textarea> |
280 | | - <canvas id="canvas" width="800" height="300"></canvas> |
| 303 | + <canvas id="canvas" width="800" height="600"></canvas> |
281 | 304 |
|
282 | 305 | <div class="button-container"> |
283 | 306 | <button class="button" onclick="saveNotes()">Save Notes</button> |
@@ -502,6 +525,15 @@ <h2>Your Notes</h2> |
502 | 525 | const bulletedLines = lines.map(line => '• ' + line).join('\n'); |
503 | 526 | textarea.value = text.slice(0, start) + bulletedLines + text.slice(end); |
504 | 527 | break; |
| 528 | + case 'left': |
| 529 | + textarea.style.textAlign = 'left'; |
| 530 | + break; |
| 531 | + case 'center': |
| 532 | + textarea.style.textAlign = 'center'; |
| 533 | + break; |
| 534 | + case 'right': |
| 535 | + textarea.style.textAlign = 'right'; |
| 536 | + break; |
505 | 537 | } |
506 | 538 | saveToUndoStack(); |
507 | 539 | } |
|
0 commit comments