working preliminary POC

This commit is contained in:
2025-03-22 00:32:16 +01:00
parent 0d55853f03
commit 96c23c62d1
5 changed files with 183 additions and 44 deletions

View File

@@ -1,18 +1,29 @@
<div class="center">
<h1>Basic Calculator</h1>
<h1>NMR Frequency Calculator</h1>
<form action="result">
<input type="number" name="number1" placeholder="Enter first number">
<br>
<br>
<input type="number" name="number2" placeholder="Enter second number">
<br>
<br>
<button type="submit" name="add">Add</button>
<button type="submit" name="subtract">Subtract</button>
<button type="submit" name="multiply">Multiply</button>
<button type="submit" name="divide">Divide</button>
<table>
<tr>
<td>Source isotope:</td>
<td> <input type="text" name="isotope1" placeholder="Current isotope"></td>
</tr>
<tr>
<td>Source frequency in MHz: </td><td><input type="number" name="freq" step="any" placeholder="Larmor frequency in MHz"></td>
</tr>
<tr>
<td>Destination isotope: <td><input type="text" name="isotope2" placeholder="Other isotope"></td>
<td><button type="submit" name="transform">Search</button></td>
</tr>
<tr>
<td>Frequency range in MHz: <td><input type="number" name="freq_range" step="any" placeholder="Range in MHz"></td>
<td><button type="submit" name="search">Search</button></td>
</tr>
<tr>
<td>Gradient in T/m:</td> <td><input type="number" name="gradient" step="any" placeholder="Gradient in T/m"></td>
<td><button type="submit" name="calculate">Search</button></td>
<td>(assuming 5mm sample diameter)</td>
</tr>
</table>
</form>
</div>

View File

@@ -1,15 +1,88 @@
<div class="center">
The result is:
<h1>{{ans}}</h1>
<table>
<caption>
Table downloaded from <a href="https://easyspin.org/documentation/isotopetable.html">easyspin.org</a>
(2023-07-29 markusro)
</caption>
<thead>
<tr>
<th scope="col">N</th>
<th scope="col">Symbol</th>
<th scope="col">Name</th>
<th scope="col">f<sub>0</sub> in MHz</th>
<th scope="col">Spin</th>
<th scope="col">Nat. ab. in %</th>
<th scope="col">&gamma; in MHz/T</th>
</tr>
</thead>
<tbody>
{% for attr in ans %}
<tr>
{% for i in attr %}
<td>{{ i }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
<a href="{% url 'home' %}">Go Back</a>
</div>
<style>
.center {
</div>
<style>
.center {
margin: auto;
width: 60%;
border: 3px solid #a5addb;
padding: 10px;
}
</style>
}
table {
border-collapse: collapse;
border: 2px solid rgb(140 140 140);
font-family: sans-serif;
font-size: 1.2rem;
letter-spacing: 1px;
}
caption {
caption-side: bottom;
padding: 8px;
font-weight: normal;
font-size: 0.8rem;
text-align: center;
}
thead,
tfoot {
background-color: rgb(228 240 245);
}
th,
td {
border: 1px solid rgb(160 160 160);
padding: 10px 4px;
text-align: center;
}
td:last-of-type {
text-align: center;
}
tbody > tr:nth-of-type(even) {
background-color: rgb(237 238 242);
}
tfoot th {
text-align: right;
}
tfoot td {
font-weight: bold;
}
</style>