-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
24 lines (20 loc) · 954 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const timerInputs = document.getElementById('timer-inputs')
const studyHoursElement = document.getElementById('study-hours-input')
const intervalMinutsElement = document.getElementById('interval-minuts-input')
const shortBreakMinutsElement = document.getElementById('short-break-minuts-input')
const longBreakMinutsElement = document.getElementById('long-break-minuts-input')
const startBtn = document.getElementById('start')
startBtn.addEventListener('click',() => {
// timerInputs.classList.add('hidden')
studyMinutes = +studyHoursElement.value * 60
intervalMinuts = +intervalMinutsElement.value
shortBreakMinuts = +shortBreakMinutsElement.value
longBreakMinuts = +longBreakMinutsElement.value
let totalStudyingTime =
studyMinutes +
((Math.floor(studyMinutes/intervalMinuts)-2) * shortBreakMinuts) +
longBreakMinuts
console.log(totalStudyingTime)
// let timer = setInterval(function(){
// },1000)
})