-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
133 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,30 +3,38 @@ | |
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Time Price Calculator</title> | ||
<title>Halt Reopen Band Estimator</title> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"> | ||
<style> | ||
#resultTable tbody tr.final-row { | ||
background-color: #e3f2fd !important; | ||
--bs-table-bg: #e3f2fd !important; | ||
} | ||
#resultTable tbody tr.final-row:hover { | ||
background-color: #c7e6ff !important; | ||
--bs-table-bg: #c7e6ff !important; | ||
} | ||
|
||
#resultTable tbody tr.past-time { | ||
background-color: #e9ecef !important; | ||
--bs-table-bg: #e9ecef !important; | ||
--bs-table-bg: #e9ecef !important; | ||
} | ||
#resultTable tbody tr.past-time:hover { | ||
background-color: #dee2e6 !important; | ||
--bs-table-bg: #dee2e6 !important; | ||
} | ||
|
||
/* If row is both past time and final row, final row color takes precedence */ | ||
#resultTable tbody tr.past-time.final-row { | ||
background-color: #e3f2fd !important; | ||
--bs-table-bg: #e3f2fd !important; | ||
} | ||
#resultTable tbody tr.past-time.final-row:hover { | ||
background-color: #c7e6ff !important; | ||
--bs-table-bg: #c7e6ff !important; | ||
} | ||
|
||
#resultTable tbody tr.valid-price-row { | ||
border: 2px solid #28a745 !important; | ||
} | ||
</style> | ||
</head> | ||
|
@@ -46,16 +54,25 @@ <h3>Halt Reopen Band Estimator</h3> | |
<label for="priceInput" class="form-label">Halt Price</label> | ||
<input type="number" step="0.01" class="form-control" id="priceInput" placeholder="100.00"> | ||
</div> | ||
<div class="mb-3"> | ||
<label for="indicativePriceInput" class="form-label">Current Indicative Price (optional)</label> | ||
<input type="number" step="0.01" class="form-control" id="indicativePriceInput" placeholder="0.00"> | ||
</div> | ||
<div class="alert alert-danger d-none" id="errorMessage"></div> | ||
<button type="submit" class="btn btn-primary w-100" id="generateBtn">Generate Table</button> | ||
</form> | ||
|
||
<div id="validTimeMessage" class="alert alert-success mt-4 d-none"> | ||
<!-- Valid time message will be inserted here --> | ||
</div> | ||
|
||
<div class="mt-4"> | ||
<table class="table table-bordered table-hover d-none" id="resultTable"> | ||
<thead> | ||
<tr> | ||
<th>Time</th> | ||
<th>Price</th> | ||
<th>Lower Band Price</th> | ||
<th>Upper Band Price</th> | ||
</tr> | ||
</thead> | ||
<tbody></tbody> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Time to Milliseconds Calculator</title> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
max-width: 600px; | ||
margin: 40px auto; | ||
padding: 20px; | ||
} | ||
.container { | ||
text-align: center; | ||
} | ||
input { | ||
padding: 8px; | ||
font-size: 16px; | ||
margin: 10px; | ||
} | ||
#result { | ||
margin-top: 20px; | ||
font-size: 18px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h2>Milliseconds Since Midnight Calculator</h2> | ||
<input | ||
type="text" | ||
id="timeInput" | ||
placeholder="Enter time (e.g., 9:50)" | ||
onkeypress="if(event.key === 'Enter') calculateMilliseconds()" | ||
> | ||
<div id="result"></div> | ||
</div> | ||
|
||
<script> | ||
function calculateMilliseconds() { | ||
const timeInput = document.getElementById('timeInput').value; | ||
const [hours, minutes] = timeInput.split(':').map(Number); | ||
|
||
if (isNaN(hours) || isNaN(minutes) || hours < 0 || hours > 23 || minutes < 0 || minutes > 59) { | ||
document.getElementById('result').innerHTML = 'Please enter a valid time (HH:MM)'; | ||
return; | ||
} | ||
|
||
const milliseconds = (hours * 60 * 60 * 1000) + (minutes * 60 * 1000); | ||
document.getElementById('result').innerHTML = `milliseconds since midnight: ${milliseconds.toLocaleString()} milliseconds`; | ||
} | ||
</script> | ||
</body> | ||
</html> |