Spaces:
Build error
Build error
Update templates/index.html
Browse files- templates/index.html +204 -181
templates/index.html
CHANGED
|
@@ -1,181 +1,204 @@
|
|
| 1 |
-
<!DOCTYPE html>
|
| 2 |
-
<html lang="en">
|
| 3 |
-
|
| 4 |
-
<head>
|
| 5 |
-
<meta charset="UTF-8">
|
| 6 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
-
<meta name="description" content="Heart Attack Prediction Tool - Predict your risk of heart attack using medical data.">
|
| 8 |
-
<title>Heart Attack Prediction</title>
|
| 9 |
-
<link rel="icon" href="static/img/ht.jpg" type="image/x-icon">
|
| 10 |
-
|
| 11 |
-
<!-- Google Fonts -->
|
| 12 |
-
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
|
| 13 |
-
|
| 14 |
-
<!-- Custom Stylesheet -->
|
| 15 |
-
<link rel="stylesheet" href="static/styles.css">
|
| 16 |
-
|
| 17 |
-
<!-- Bootstrap CSS -->
|
| 18 |
-
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
|
| 19 |
-
</head>
|
| 20 |
-
|
| 21 |
-
<body>
|
| 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 |
-
<div class="
|
| 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 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
<
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
<
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
<
|
| 109 |
-
</div>
|
| 110 |
-
|
| 111 |
-
<!--
|
| 112 |
-
<div class="form-group">
|
| 113 |
-
<label for="
|
| 114 |
-
<
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
<
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
<
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
<
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
<
|
| 180 |
-
|
| 181 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
|
| 4 |
+
<head>
|
| 5 |
+
<meta charset="UTF-8">
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<meta name="description" content="Heart Attack Prediction Tool - Predict your risk of heart attack using medical data.">
|
| 8 |
+
<title>Heart Attack Prediction</title>
|
| 9 |
+
<link rel="icon" href="static/img/ht.jpg" type="image/x-icon">
|
| 10 |
+
|
| 11 |
+
<!-- Google Fonts -->
|
| 12 |
+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
|
| 13 |
+
|
| 14 |
+
<!-- Custom Stylesheet -->
|
| 15 |
+
<link rel="stylesheet" href="static/styles.css">
|
| 16 |
+
|
| 17 |
+
<!-- Bootstrap CSS -->
|
| 18 |
+
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
|
| 19 |
+
</head>
|
| 20 |
+
|
| 21 |
+
<body>
|
| 22 |
+
|
| 23 |
+
<div class="app-window bg-light p-4 shadow rounded">
|
| 24 |
+
<section class="bg-primary text-white p-3 text-center w-100 mb-4">
|
| 25 |
+
<div class="container">
|
| 26 |
+
<img src="static/img/ht.png" alt="Heart Health Logo" class="logo mb-2">
|
| 27 |
+
<h1 class="display-4">Heart Attack Prediction</h1>
|
| 28 |
+
</div>
|
| 29 |
+
</section>
|
| 30 |
+
|
| 31 |
+
<h2 class="text-center mb-4">Patient Details</h2>
|
| 32 |
+
<form action="/predict" method="post" class="needs-validation" novalidate>
|
| 33 |
+
<!-- Sex Selection -->
|
| 34 |
+
<div class="form-group row">
|
| 35 |
+
<label for="sex" class="col-sm-4 col-form-label">Sex:</label>
|
| 36 |
+
<div class="col-sm-8">
|
| 37 |
+
<select id="sex" name="sex" class="form-control" required>
|
| 38 |
+
<option value="" disabled selected>Select your sex</option>
|
| 39 |
+
<option value="M">Male</option>
|
| 40 |
+
<option value="F">Female</option>
|
| 41 |
+
</select>
|
| 42 |
+
<div class="invalid-feedback">Please select your sex.</div>
|
| 43 |
+
</div>
|
| 44 |
+
</div>
|
| 45 |
+
|
| 46 |
+
<!-- Chest Pain Type -->
|
| 47 |
+
<div class="form-group row">
|
| 48 |
+
<label for="chestPainType" class="col-sm-4 col-form-label">Chest Pain Type:</label>
|
| 49 |
+
<div class="col-sm-8">
|
| 50 |
+
<select id="chestPainType" name="chestPainType" class="form-control" required>
|
| 51 |
+
<option value="" disabled selected>Select chest pain type</option>
|
| 52 |
+
<option value="ATA">ATA</option>
|
| 53 |
+
<option value="NAP">NAP</option>
|
| 54 |
+
<option value="ASY">ASY</option>
|
| 55 |
+
<option value="TA">TA</option>
|
| 56 |
+
</select>
|
| 57 |
+
<div class="invalid-feedback">Please select chest pain type.</div>
|
| 58 |
+
</div>
|
| 59 |
+
</div>
|
| 60 |
+
|
| 61 |
+
<!-- Resting ECG -->
|
| 62 |
+
<div class="form-group row">
|
| 63 |
+
<label for="restingECG" class="col-sm-4 col-form-label">Resting ECG:</label>
|
| 64 |
+
<div class="col-sm-8">
|
| 65 |
+
<select id="restingECG" name="restingECG" class="form-control" required>
|
| 66 |
+
<option value="" disabled selected>Select resting ECG result</option>
|
| 67 |
+
<option value="Normal">Normal</option>
|
| 68 |
+
<option value="ST">ST</option>
|
| 69 |
+
<option value="LVH">LVH</option>
|
| 70 |
+
</select>
|
| 71 |
+
<div class="invalid-feedback">Please select resting ECG.</div>
|
| 72 |
+
</div>
|
| 73 |
+
</div>
|
| 74 |
+
|
| 75 |
+
<!-- Exercise Angina -->
|
| 76 |
+
<div class="form-group row">
|
| 77 |
+
<label for="exerciseAngina" class="col-sm-4 col-form-label">Exercise Angina:</label>
|
| 78 |
+
<div class="col-sm-8">
|
| 79 |
+
<select id="exerciseAngina" name="exerciseAngina" class="form-control" required>
|
| 80 |
+
<option value="" disabled selected>Select exercise angina</option>
|
| 81 |
+
<option value="N">No</option>
|
| 82 |
+
<option value="Y">Yes</option>
|
| 83 |
+
</select>
|
| 84 |
+
<div class="invalid-feedback">Please select exercise angina.</div>
|
| 85 |
+
</div>
|
| 86 |
+
</div>
|
| 87 |
+
|
| 88 |
+
<!-- ST Slope -->
|
| 89 |
+
<div class="form-group row">
|
| 90 |
+
<label for="stSlope" class="col-sm-4 col-form-label">ST Slope:</label>
|
| 91 |
+
<div class="col-sm-8">
|
| 92 |
+
<select id="stSlope" name="stSlope" class="form-control" required>
|
| 93 |
+
<option value="" disabled selected>Select ST slope</option>
|
| 94 |
+
<option value="Up">Up</option>
|
| 95 |
+
<option value="Flat">Flat</option>
|
| 96 |
+
<option value="Down">Down</option>
|
| 97 |
+
</select>
|
| 98 |
+
<div class="invalid-feedback">Please select ST slope.</div>
|
| 99 |
+
</div>
|
| 100 |
+
</div>
|
| 101 |
+
|
| 102 |
+
<!-- Age -->
|
| 103 |
+
<div class="form-group row">
|
| 104 |
+
<label for="age" class="col-sm-4 col-form-label">Age:</label>
|
| 105 |
+
<div class="col-sm-8">
|
| 106 |
+
<input type="number" id="age" name="age" class="form-control" required min="0" placeholder="Enter your age">
|
| 107 |
+
<div class="invalid-feedback">Please enter a valid age.</div>
|
| 108 |
+
</div>
|
| 109 |
+
</div>
|
| 110 |
+
|
| 111 |
+
<!-- Resting Blood Pressure -->
|
| 112 |
+
<div class="form-group row">
|
| 113 |
+
<label for="restingBP" class="col-sm-4 col-form-label">Resting Blood Pressure (mm Hg):</label>
|
| 114 |
+
<div class="col-sm-8">
|
| 115 |
+
<input type="number" id="restingBP" name="restingBP" class="form-control" required min="0" placeholder="Enter resting blood pressure">
|
| 116 |
+
<div class="invalid-feedback">Please enter resting blood pressure.</div>
|
| 117 |
+
</div>
|
| 118 |
+
</div>
|
| 119 |
+
|
| 120 |
+
<!-- Cholesterol -->
|
| 121 |
+
<div class="form-group row">
|
| 122 |
+
<label for="cholesterol" class="col-sm-4 col-form-label">Cholesterol (mg/dl):</label>
|
| 123 |
+
<div class="col-sm-8">
|
| 124 |
+
<input type="number" id="cholesterol" name="cholesterol" class="form-control" required min="0" placeholder="Enter cholesterol level">
|
| 125 |
+
<div class="invalid-feedback">Please enter cholesterol level.</div>
|
| 126 |
+
</div>
|
| 127 |
+
</div>
|
| 128 |
+
|
| 129 |
+
<!-- Fasting Blood Sugar -->
|
| 130 |
+
<div class="form-group row">
|
| 131 |
+
<label for="fastingBS" class="col-sm-4 col-form-label">Fasting Blood Sugar (mg/dl):</label>
|
| 132 |
+
<div class="col-sm-8">
|
| 133 |
+
<input type="number" id="fastingBS" name="fastingBS" class="form-control" required min="0" placeholder="Enter fasting blood sugar">
|
| 134 |
+
<div class="invalid-feedback">Please enter fasting blood sugar.</div>
|
| 135 |
+
</div>
|
| 136 |
+
</div>
|
| 137 |
+
|
| 138 |
+
<!-- Max Heart Rate -->
|
| 139 |
+
<div class="form-group row">
|
| 140 |
+
<label for="maxHR" class="col-sm-4 col-form-label">Max Heart Rate:</label>
|
| 141 |
+
<div class="col-sm-8">
|
| 142 |
+
<input type="number" id="maxHR" name="maxHR" class="form-control" required min="0" placeholder="Enter max heart rate">
|
| 143 |
+
<div class="invalid-feedback">Please enter max heart rate.</div>
|
| 144 |
+
</div>
|
| 145 |
+
</div>
|
| 146 |
+
|
| 147 |
+
<!-- Oldpeak -->
|
| 148 |
+
<div class="form-group row">
|
| 149 |
+
<label for="oldpeak" class="col-sm-4 col-form-label">Oldpeak:</label>
|
| 150 |
+
<div class="col-sm-8">
|
| 151 |
+
<input type="number" id="oldpeak" name="oldpeak" class="form-control" required step="0.1" min="0" placeholder="Enter oldpeak value">
|
| 152 |
+
<div class="invalid-feedback">Please enter a valid oldpeak value.</div>
|
| 153 |
+
</div>
|
| 154 |
+
</div>
|
| 155 |
+
|
| 156 |
+
<!-- Submit Button -->
|
| 157 |
+
<div class="text-center">
|
| 158 |
+
<input class="btn btn-primary btn-lg mt-3" type="submit" value="Predict Risk of Heart Attack">
|
| 159 |
+
</div>
|
| 160 |
+
</form>
|
| 161 |
+
|
| 162 |
+
<!-- Display prediction result -->
|
| 163 |
+
{% if results %}
|
| 164 |
+
<div class="alert alert-info mt-4 text-center prediction-result">
|
| 165 |
+
<h2 class="result-title">The prediction is:</h2>
|
| 166 |
+
<p class="result-value">{{ results }}</p>
|
| 167 |
+
</div>
|
| 168 |
+
{% endif %}
|
| 169 |
+
</div>
|
| 170 |
+
</main>
|
| 171 |
+
|
| 172 |
+
<footer class="text-center py-3 bg-primary text-white">
|
| 173 |
+
<p>© <span id="year"></span> Heart Health Initiative</p>
|
| 174 |
+
</footer>
|
| 175 |
+
<!-- Include Bootstrap JS for form validation -->
|
| 176 |
+
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
|
| 177 |
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/js/bootstrap.bundle.min.js"></script>
|
| 178 |
+
|
| 179 |
+
<!-- Dynamic Year Update -->
|
| 180 |
+
<script>
|
| 181 |
+
document.getElementById("year").textContent = new Date().getFullYear();
|
| 182 |
+
</script>
|
| 183 |
+
|
| 184 |
+
<!-- Bootstrap Form Validation -->
|
| 185 |
+
<script>
|
| 186 |
+
(function() {
|
| 187 |
+
'use strict';
|
| 188 |
+
window.addEventListener('load', function() {
|
| 189 |
+
var forms = document.getElementsByClassName('needs-validation');
|
| 190 |
+
var validation = Array.prototype.filter.call(forms, function(form) {
|
| 191 |
+
form.addEventListener('submit', function(event) {
|
| 192 |
+
if (form.checkValidity() === false) {
|
| 193 |
+
event.preventDefault();
|
| 194 |
+
event.stopPropagation();
|
| 195 |
+
}
|
| 196 |
+
form.classList.add('was-validated');
|
| 197 |
+
}, false);
|
| 198 |
+
});
|
| 199 |
+
}, false);
|
| 200 |
+
})();
|
| 201 |
+
</script>
|
| 202 |
+
</body>
|
| 203 |
+
|
| 204 |
+
</html>
|