html
Copy code
Reading Time Calculator Tool
Reading Time Calculator
Total Words: 0
Estimated Reading Time: 0 minutes
CSS (styles.css)
css
Copy code
body {
font-family: Arial, sans-serif;
background: #f0f0f0;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
background: white;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
padding: 20px;
width: 90%;
max-width: 600px;
text-align: center;
}
h1 {
color: #333;
}
textarea {
width: 100%;
height: 150px;
border: 2px solid #ddd;
border-radius: 5px;
padding: 10px;
font-size: 16px;
margin-bottom: 20px;
resize: none;
}
button {
background: #28a745;
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
}
button:hover {
background: #218838;
}
#result {
margin-top: 20px;
}
#result p {
font-size: 18px;
color: #333;
}
#result span {
font-weight: bold;
color: #007bff;
}
JavaScript (script.js)
javascript
Copy code
document.getElementById('calculate-button').addEventListener('click', function() {
const text = document.getElementById('text-input').value;
const words = text.split(/\s+/).filter(word => word.length > 0);
const wordCount = words.length;
const readingTime = Math.ceil(wordCount / 200);
document.getElementById('word-count').innerText = wordCount;
document.getElementById('reading-time').innerText = readingTime;
});