Reading Time Calculator
Estimated Reading Time:
0 minutes
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
text-align: center;
}
.container {
background-color: #fff;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
margin: 20px auto;
padding: 20px;
max-width: 600px;
}
h1 {
color: #333;
}
.input-container {
margin-top: 20px;
}
label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
textarea {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
background-color: #007bff;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
margin-top: 10px;
}
.result-container {
margin-top: 20px;
}
#reading-time {
font-size: 24px;
color: #007bff;
}
document.getElementById("calculate").addEventListener("click", function() {
const content = document.getElementById("content").value;
const words = content.trim().split(/\s+/).length;
const readingTime = Math.ceil(words / 200); // Assuming an average reading speed of 200 words per minute
document.getElementById("reading-time").textContent = readingTime + " minutes";
});