Upload 2 files
Browse files- static/js/voice.js +22 -0
- static/style.css +123 -0
static/js/voice.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// static/js/voice.js
|
| 2 |
+
|
| 3 |
+
document.addEventListener('DOMContentLoaded', function () {
|
| 4 |
+
const micBtn = document.getElementById('mic-btn');
|
| 5 |
+
const urgencyInputs = document.getElementsByName('urgency');
|
| 6 |
+
|
| 7 |
+
if (micBtn) {
|
| 8 |
+
micBtn.addEventListener('click', () => {
|
| 9 |
+
const recognition = new (window.SpeechRecognition || window.webkitSpeechRecognition)();
|
| 10 |
+
recognition.lang = 'en-US';
|
| 11 |
+
recognition.start();
|
| 12 |
+
|
| 13 |
+
recognition.onresult = function(event) {
|
| 14 |
+
const transcript = event.results[0][0].transcript.toLowerCase();
|
| 15 |
+
console.log("Heard:", transcript);
|
| 16 |
+
if (transcript.includes('low')) urgencyInputs[0].checked = true;
|
| 17 |
+
else if (transcript.includes('medium')) urgencyInputs[1].checked = true;
|
| 18 |
+
else if (transcript.includes('high')) urgencyInputs[2].checked = true;
|
| 19 |
+
};
|
| 20 |
+
});
|
| 21 |
+
}
|
| 22 |
+
});
|
static/style.css
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Base layout */
|
| 2 |
+
body {
|
| 3 |
+
font-family: 'Segoe UI', sans-serif;
|
| 4 |
+
background: linear-gradient(to right, #f0f8ff, #ffffff);
|
| 5 |
+
text-align: center;
|
| 6 |
+
margin: 0;
|
| 7 |
+
padding: 20px;
|
| 8 |
+
color: #333;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
/* Main container */
|
| 12 |
+
.container {
|
| 13 |
+
background: #ffffff;
|
| 14 |
+
padding: 30px 25px;
|
| 15 |
+
margin: auto;
|
| 16 |
+
max-width: 600px;
|
| 17 |
+
border-radius: 15px;
|
| 18 |
+
box-shadow: 0 4px 20px rgba(0,0,0,0.1);
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
/* Headings */
|
| 22 |
+
h1 {
|
| 23 |
+
color: #6C63FF;
|
| 24 |
+
font-size: 2rem;
|
| 25 |
+
margin-bottom: 15px;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
h2, h3 {
|
| 29 |
+
color: #333;
|
| 30 |
+
margin-top: 30px;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
/* Forms */
|
| 34 |
+
form {
|
| 35 |
+
margin-top: 20px;
|
| 36 |
+
text-align: left;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
label {
|
| 40 |
+
display: block;
|
| 41 |
+
font-weight: 600;
|
| 42 |
+
margin-top: 20px;
|
| 43 |
+
margin-bottom: 6px;
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
select,
|
| 47 |
+
input[type="radio"],
|
| 48 |
+
input[type="file"] {
|
| 49 |
+
margin-top: 5px;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
input[type="submit"],
|
| 53 |
+
button {
|
| 54 |
+
background-color: #6C63FF;
|
| 55 |
+
color: white;
|
| 56 |
+
padding: 10px 20px;
|
| 57 |
+
border: none;
|
| 58 |
+
border-radius: 8px;
|
| 59 |
+
font-size: 16px;
|
| 60 |
+
cursor: pointer;
|
| 61 |
+
margin-top: 20px;
|
| 62 |
+
transition: background-color 0.3s;
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
input[type="submit"]:hover,
|
| 66 |
+
button:hover {
|
| 67 |
+
background-color: #574fd6;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
/* Excuse result display */
|
| 71 |
+
.excuse-box {
|
| 72 |
+
margin-top: 25px;
|
| 73 |
+
padding: 18px;
|
| 74 |
+
background: #fff3cd;
|
| 75 |
+
border-left: 6px solid #ffc107;
|
| 76 |
+
border-radius: 10px;
|
| 77 |
+
color: #333;
|
| 78 |
+
font-size: 1.1rem;
|
| 79 |
+
line-height: 1.5;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
/* Proof image */
|
| 83 |
+
.proof-img {
|
| 84 |
+
max-width: 400px;
|
| 85 |
+
height: auto;
|
| 86 |
+
border-radius: 10px;
|
| 87 |
+
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
| 88 |
+
margin-top: 10px;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
/* Top excuses list */
|
| 92 |
+
ol {
|
| 93 |
+
list-style-type: none;
|
| 94 |
+
padding: 0;
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
li {
|
| 98 |
+
margin: 10px 0;
|
| 99 |
+
font-size: 1rem;
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
li strong {
|
| 103 |
+
font-weight: 600;
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
/* Prediction box */
|
| 107 |
+
.prediction-box {
|
| 108 |
+
background-color: #eef;
|
| 109 |
+
padding: 12px;
|
| 110 |
+
border-radius: 10px;
|
| 111 |
+
margin-top: 25px;
|
| 112 |
+
font-size: 1rem;
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
/* Links */
|
| 116 |
+
a {
|
| 117 |
+
color: #0077cc;
|
| 118 |
+
text-decoration: none;
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
a:hover {
|
| 122 |
+
text-decoration: underline;
|
| 123 |
+
}
|