tracreport/static/index.html

249 lines
5.2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>TrACreport</title>
<style>* {
box-sizing: border-box;
}
html {
width: 100%;
margin: 0;
padding: 0;
}
body {
width: 100vw;
padding: 0;
margin: 0;
text-align: center;
color: #f2f3f2;
background-color: #525252;
}
h1 {
padding-top: 20px;
padding-bottom: 20px;
margin:auto;
width: 90%;
}
#report-link {
position: fixed;
top: 10px;
left: 10px;
background: #007bff;
color: white;
padding: 0.5rem 1rem;
border-radius: 4px;
text-decoration: none;
font-weight: bold;
z-index: 9999;
box-shadow: 0 2px 6px rgba(0,0,0,0.2);
transition: background-color 0.3s ease;
}
#report-link:hover {
background: #0056b3;
}
form {
width: 100vw;
padding: 0;
margin: 0;
margin-bottom: 25px;
}
#unitNumber {
width: 40vw;
font-size: larger;
border-radius: 4px;
text-align: center;
margin: 0;
}
h2 {
font-size: larger;
margin-top: 10px;
}
h3 {
font-size: large;
margin-bottom: 0;
}
#formExpansion {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
gap: 0.7rem 2rem;
}
#formExpansion h3 {
flex-basis: 100%;
margin-top: 1.0rem;
margin-bottom: 0rem;
font-weight: bold;
}
#formExpansion h3:first-of-type {
margin-top: 0rem;
}
.checkbox-wrapper {
display: flex;
flex-direction: column;
align-items: center;
font-size: 1rem;
cursor: pointer;
width: 5rem;
}
.checkbox-wrapper input[type="checkbox"] {
width: 1.8rem;
height: 1.8rem;
margin-top: 0rem;
cursor: pointer;
}
.checkbox-wrapper label {
text-transform: capitalize;
user-select: none;
}
#formHidden {
display: none;
width: 100vw;
margin: auto;
padding-top: 10px;
}
#radio-group {
width: 90vw;
margin:auto;
padding-top: 10px;
padding-bottom: 15px;
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 0.5rem;
}
#radio-group p {
font-weight: bold;
}
#radio-group label {
display: flex;
align-items: center;
font-size: 1rem;
padding: 0.25rem 0.75rem; /* top/bottom 0.25rem, left/right 0.75rem */
margin: 0;
cursor: pointer;
border: 1px solid #ccc;
border-radius: 6px;
background-color: #f9f9f9;
color:#525252;
}
#radio-group input[type="radio"] {
width: 1.5rem;
height: 1.5rem;
margin-right: 0.5rem;
}
#commentsLabel {
font-weight: bold;
}
p {
width: 90vw;
margin: auto;
}
button {
width: 60px;
height: 40px;
border-radius: 12px;
}
#formStatus {
display: none;
position: fixed;
top: 37.5vh;
left: 13vw;
width: 74vw;
height: 25vh;
text-align: center;
font-weight: bold;
border-radius: 25px;
justify-content: center;
align-items: center;
}
.status-success {
background-color: green;
color: whitesmoke;
}
.status-warn {
background-color: yellow;
color: black;
}</style>
</head>
<body>
<h1>Report an A/C Defect</h1>
<a href="/generate-report.html" id="report-link">R</a>
<form id="defectForm" action="POST">
<label for="unitNumber">Unit Number</label><br>
<input type="number" id="unitNumber" name="unitNumber" required>
<div id="formExpansion">
<!-- The contents of this DIV is inserted with JS -->
</div>
<div id="formHidden">
<h2>Have you reported this to maintenance?</h2>
<div id="radio-group">
<label>
<input class="radio" type="radio" name="reported" value="via Defect Book" required>
via Defect Book
</label>
<label>
<input class="radio" type="radio" name="reported" value="via App">
via App
</label>
<label>
<input class="radio" type="radio" name="reported" value="via Telephone">
via Telephone
</label>
<label>
<input class="radio" type="radio" name="reported" value="via Email">
via Email
</label>
<label>
<input class="radio" type="radio" name="reported" value="no">
No (Explain reason in comments)
</label>
</div>
<label id="commentsLabel" for="comments">Comments:</label>
<p>eg. If you did not report, why? Did a fitter meet the train? Is there already a response in the defect book?</p>
<textarea id="comments" name="comments" rows="5" cols="35"></textarea>
<br><br>
<button type="submit">Submit</button>
<button type="reset">Reset</button>
</div>
</form>
<div id="formStatus" class="status-message"></div>
<script src="script.js"></script>
</body>
</html>