Skip to content

Commit ef9bc24

Browse files
Merge pull request steam-bell-92#1100 from Alvi24-hub/main
Feature: Add Matrix Calculator implementation to web app
2 parents 783ab7d + d4cc013 commit ef9bc24

5 files changed

Lines changed: 642 additions & 2 deletions

File tree

31.2 KB
Loading

web-app/generate_banners.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,25 @@ def draw_o(ox, oy):
378378
v_draw.line([(550, 115), (250, 335)], fill=color_accent_dim, width=3)
379379
v_draw.rounded_rectangle([305, 160, 495, 290], radius=24, fill=(255,255,255,14), outline=color_accent, width=3)
380380
v_draw.text((400, 225), "A+3", fill=color_accent, anchor="mm")
381+
elif "matrix" in n_lower or "matrix calculator" in n_lower:
382+
# Matrix brackets and grid pattern
383+
cx, cy = 400, 225
384+
# Draw matrix brackets
385+
v_draw.line([(200, 140), (200, 310)], fill=color_accent, width=5)
386+
v_draw.line([(600, 140), (600, 310)], fill=color_accent, width=5)
387+
# Draw matrix grid lines
388+
for i in range(3):
389+
y = 165 + i * 60
390+
v_draw.line([(220, y), (580, y)], fill=color_accent_dim, width=2)
391+
# Draw sample numbers
392+
sample_nums = [["2", "1"], ["3", "4"]]
393+
for i in range(2):
394+
for j in range(2):
395+
x = 290 + j * 100
396+
y = 200 + i * 60
397+
v_draw.text((x, y), sample_nums[i][j], fill=color_accent, anchor="mm", font=font_title)
398+
# Draw operation symbol
399+
v_draw.text((400, 280), "×", fill=color_accent, anchor="mm", font=font_title)
381400
elif "pet" in n_lower or "productivity" in n_lower:
382401
# Cute paw print
383402
cx, cy = 400, 225
@@ -472,6 +491,7 @@ def draw_o(ox, oy):
472491
("Binary Search", "math", "binary-search.webp"),
473492
("Bubble Sort", "math", "bubble-sort.webp"),
474493
("Tower of Hanoi", "math", "tower-of-hanoi.webp"),
494+
("Matrix Calculator", "math", "matrix-calculator.webp"),
475495

476496
# UTILITIES
477497
("Morse Code", "utilities", "morse-code.webp"),

web-app/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,7 @@ <h3>Legal</h3>
875875
<script defer src="js/projects/color-palette.js"></script>
876876
<script defer src="js/projects/resume-analyzer.js"></script>
877877
<script src="js/projects/caesar-cipher.js"></script>
878+
<script src="js/projects/matrix-calculator.js"></script>
878879
<script defer src="js/projects.js"></script>
879880
<script defer src="js/cm-editor.js"></script>
880881
<script defer src="js/playground.js"></script>
@@ -1070,6 +1071,13 @@ <h3>Legal</h3>
10701071
desc: "Recognize sequences",
10711072
tags: "math,sequences",
10721073
},
1074+
{
1075+
project: "matrix-calculator",
1076+
title: "Matrix Calculator",
1077+
category: "math",
1078+
desc: "Add, subtract, multiply, transpose, determinant, rank, inverse",
1079+
tags: "math,matrix,algebra,calculator",
1080+
},
10731081
{
10741082
project: "coordinate-polar-transform",
10751083
title: "Coordinate Transform",

web-app/js/projects.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ function getProjectHTML(projectName) {
2121
'derivative-calculator': getDerivativeCalculatorHTML(),
2222
'morse-code': getMorseCodeHTML(),
2323
'tower-of-hanoi': getTowerOfHanoiHTML(),
24-
'nqueens' : getNQueensHTML()
24+
'nqueens' : getNQueensHTML(),
25+
'matrix-calculator': () => getMatrixCalculatorHTML()
2526
};
2627

2728
return projects[projectName] || '<h2>Project Coming Soon!</h2>';
@@ -47,7 +48,8 @@ function initializeProject(projectName) {
4748
'derivative-calculator': initDerivativeCalculator,
4849
'morse-code': initMorseCode,
4950
'tower-of-hanoi': initTowerOfHanoi,
50-
'nqueens' : initNQueens()
51+
'nqueens' : initNQueens(),
52+
'matrix-calculator': initMatrixCalculator
5153
};
5254

5355
if (initializers[projectName]) {

0 commit comments

Comments
 (0)