Skip to content

Commit fa3a9f7

Browse files
committed
scroll into table when generated, change font colors
1 parent c058fcc commit fa3a9f7

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

docs/index.html

+9-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h1 class="text-2xl font-bold mb-4">🧮 Subnet-Calculator</h1>
1414
<div class="flex items-center">
1515
<input type="text" id="ipv4" name="ipv4" value="192.168.1.1" class="shadow appearance-none border rounded w-4/5 py-2 px-3 leading-tight focus:outline-none focus:shadow-outline bg-gray-800 text-white border-gray-600" oninput="calculateSubnet(event)">
1616
<label class="ml-2" for="ipClassValue">Class:</label>
17-
<input type="text" id="ipClassValue" name="ipClass" disabled class="shadow appearance-none border rounded w-1/5 py-2 px-3 leading-tight focus:outline-none focus:shadow-outline text-center ml-1 bg-gray-800 text-white border-gray-600" value="">
17+
<input type="text" id="ipClassValue" name="ipClass" disabled class="shadow appearance-none border rounded w-1/5 py-2 px-3 leading-tight focus:outline-none focus:shadow-outline text-center ml-1 bg-gray-800 text-gray-400 border-gray-600" value="">
1818
</div>
1919
<br>
2020

@@ -25,19 +25,19 @@ <h1 class="text-2xl font-bold mb-4">🧮 Subnet-Calculator</h1>
2525
</div><br>
2626

2727
<label for="net-id">Net ID:</label>
28-
<input type="text" id="net-id" name="net-id" disabled class="shadow appearance-none border rounded w-full py-2 px-3 leading-tight focus:outline-none focus:shadow-outline bg-gray-800 text-white border-gray-600"><br><br>
28+
<input type="text" id="net-id" name="net-id" disabled class="shadow appearance-none border rounded w-full py-2 px-3 leading-tight focus:outline-none focus:shadow-outline bg-gray-800 text-gray-400 border-gray-600"><br><br>
2929

3030
<label for="broadcast">Broadcast:</label>
31-
<input type="text" id="broadcast" name="broadcast" disabled class="shadow appearance-none border rounded w-full py-2 px-3 leading-tight focus:outline-none focus:shadow-outline bg-gray-800 text-white border-gray-600"><br><br>
31+
<input type="text" id="broadcast" name="broadcast" disabled class="shadow appearance-none border rounded w-full py-2 px-3 leading-tight focus:outline-none focus:shadow-outline bg-gray-800 text-gray-400 border-gray-600"><br><br>
3232

3333
<label for="host-addresses">Number of Host Addresses:</label>
34-
<input type="text" id="host-addresses" name="host-addresses" disabled class="shadow appearance-none border rounded w-full py-2 px-3 leading-tight focus:outline-none focus:shadow-outline bg-gray-800 text-white border-gray-600"><br><br>
34+
<input type="text" id="host-addresses" name="host-addresses" disabled class="shadow appearance-none border rounded w-full py-2 px-3 leading-tight focus:outline-none focus:shadow-outline bg-gray-800 text-gray-400 border-gray-600"><br><br>
3535

3636
<label for="subnets">Number of Subnets:</label>
37-
<input type="text" id="subnets" name="subnets" disabled class="shadow appearance-none border rounded w-full py-2 px-3 leading-tight focus:outline-none focus:shadow-outline bg-gray-800 text-white border-gray-600"><br><br>
37+
<input type="text" id="subnets" name="subnets" disabled class="shadow appearance-none border rounded w-full py-2 px-3 leading-tight focus:outline-none focus:shadow-outline bg-gray-800 text-gray-400 border-gray-600"><br><br>
3838

3939
<label for="subnet-id">Subnet ID:</label>
40-
<input type="text" id="subnet-id" name="subnet-id" disabled class="shadow appearance-none border rounded w-full py-2 px-3 leading-tight focus:outline-none focus:shadow-outline bg-gray-800 text-white border-gray-600"><br><br>
40+
<input type="text" id="subnet-id" name="subnet-id" disabled class="shadow appearance-none border rounded w-full py-2 px-3 leading-tight focus:outline-none focus:shadow-outline bg-gray-800 text-gray-400 border-gray-600"><br><br>
4141
</form>
4242

4343
<button id="generate-table-button" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" type="button">
@@ -236,7 +236,7 @@ <h1 class="text-2xl font-bold mb-4">🧮 Subnet-Calculator</h1>
236236
table.appendChild(thead);
237237

238238
const tbody = document.createElement("tbody");
239-
tbody.className = "text-sm text-gray-500";
239+
tbody.className = "text-sm text-gray-400";
240240

241241
const numSubnets = Math.pow(2, subnetMask - minSubnet);
242242

@@ -332,6 +332,8 @@ <h1 class="text-2xl font-bold mb-4">🧮 Subnet-Calculator</h1>
332332

333333
table.appendChild(tbody);
334334
tableContainer.appendChild(table);
335+
336+
table.scrollIntoView({ behavior: 'smooth', block: 'start' });
335337
}
336338

337339
generateTableButton.addEventListener("click", generateSubnetTable);

0 commit comments

Comments
 (0)