Class Progress Tracker
Class Progress Tracker
let intervalId;
const startBtn = document.getElementById('start-btn');
const stopBtn = document.getElementById('stop-btn');
const toggleBtn = document.getElementById('toggle-btn');
const inputFormContent = document.getElementById('input-form-content');
const startInput = document.getElementById('start-percent');
const goalInput = document.getElementById('goal-percent');
const timeInput = document.getElementById('time-minutes');
const progressBarFill = document.getElementById('progress-fill');
const progressText = document.getElementById('progress-text');
// Event listeners
startBtn.addEventListener('click', startProgressBar);
stopBtn.addEventListener('click', stopProgressBar);
toggleBtn.addEventListener('click', toggleInputForm);
function toggleInputForm() {
inputFormContent.classList.toggle('collapsed');
if (inputFormContent.classList.contains('collapsed')) {
toggleBtn.textContent = 'Show Settings';
} else {
toggleBtn.textContent = 'Hide Settings';
}
}
function start