-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
92 lines (92 loc) · 3.15 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Matrix Calculator</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
body {
font-family: Arial, sans-serif;
background-color: #f8f9fa;
padding: 20px;
}
.matrix {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 8px;
}
.matrix input {
width: 60px;
}
.btn {
margin-right: 8px;
}
.result {
background-color: white;
padding: 20px;
border-radius: 5px;
border: 1px solid #dee2e6;
}
h1 {
margin-bottom: 24px;
}
.card {
background-color: #ffffff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
}
.matrix-group {
display: flex;
justify-content: space-between;
margin-bottom: 24px;
}
</style>
</head>
<body>
<div class="container">
<div class="card">
<h1>ENGF0002 Matrix Calculator</h1>
<form method="post">
{% csrf_token %}
<div class="matrix-group">
<div>
<h3>Matrix A</h3>
<div class="matrix">
{% for field in form_a %}
{{ field }}
{% endfor %}
</div>
</div>
<div>
<h3>Matrix B (Optional)</h3>
<div class="matrix">
{% for field in form_b %}
{{ field }}
{% endfor %}
</div>
</div>
</div>
<button type="submit" class="btn btn-primary" name="operation" value="add">A+B</button>
<button type="submit" class="btn btn-primary" name="operation" value="subtract">A-B</button>
<button type="submit" class="btn btn-primary" name="operation" value="multiply">AB</button>
<button type="submit" class="btn btn-primary" name="operation" value="determinant">Det(A)</button>
<button type="submit" class="btn btn-primary" name="operation" value="eigenvalues">Eigenvalues</button>
<button type="submit" class="btn btn-primary" name="operation" value="eigenvectors">Eigenvectors</button>
</form>
{% if error %}
<div class="alert alert-danger mt-3" role="alert">
{{ error }}
</div>
{% endif %}
{% if result %}
<div class="result mt-3">
<h2>Result:</h2>
<pre>{{ result }}</pre>
</div>
{% endif %}
</div>
</div>
</body>
</html>