From ee6a06b16b20181d8658105b3be8059cab69b5f7 Mon Sep 17 00:00:00 2001 From: Alex Mueller Date: Fri, 8 May 2020 23:08:26 -0400 Subject: [PATCH] remove productivity timer remnants --- final/js/main.js | 83 +----------------------------------------------- 1 file changed, 1 insertion(+), 82 deletions(-) diff --git a/final/js/main.js b/final/js/main.js index 316ef2f..7a6f82c 100644 --- a/final/js/main.js +++ b/final/js/main.js @@ -13,7 +13,6 @@ else if (hour > 17) humanTime = "evening"; else if (hour > 12) humanTime = "afternoon"; else if (hour > 6) humanTime = "morning"; currentTod.innerHTML = humanTime; -//docTitle.innerHTML = 'New tab: Good ' + humanTime +'!'; // Current Time var time = $('#time') function addZero(i) { @@ -65,13 +64,8 @@ var prod = $('#prod') var prodSection = $('#productivity') var notes = $('#notes') var notesSection = $('#notes-section') -//var twentyFive = $('#twenty-five'); -//var fiftyTwo = $('#fifty-two') tod.addEventListener('click', switchTabs) -//prod.addEventListener('click', switchTabs) notes.addEventListener('click', switchTabs) -//twentyFive.addEventListener('click', switchTabs) -//fiftyTwo.addEventListener('click', switchTabs) if (localStorage.getItem('activeTab') == null) localStorage.setItem('activeTab', 'tod') $(`#${localStorage.getItem('activeTab')}`).classList.add('active') $(`#${localStorage.getItem('activeTab')}-section`).classList.remove('hidden') @@ -85,16 +79,7 @@ function switchTabs(e) { notes.classList.remove('active') notesSection.classList.add('hidden') localStorage.setItem('activeTab', 'tod') - } - // else if (id == 'prod') { - // prod.classList.add('active') - // prodSection.classList.remove('hidden') - // tod.classList.remove('active') - // todSection.classList.add('hidden') - // notes.classList.remove('active') - // notesSection.classList.add('hidden') - // } - else if (id == "notes") { + } else if (id == "notes") { tod.classList.remove('active') todSection.classList.add('hidden') notes.classList.add('active') @@ -103,72 +88,6 @@ function switchTabs(e) { } } - -// Productivity timer -// var timer = $('#timer') -// var timerRunning = localStorage.getItem('timerRunning'); -// console.log(timerRunning); -// var workPeriod = localStorage.getItem('workPeriod'); -// var breakPeriod = localStorage.getItem('breakPeriod') -// var timerInterval; -// function startTimer(work, rest) { -// console.log('run'); -// startButton.disabled = true; -// startButton.classList.add('hidden'); -// cancelButton.classList.remove('hidden'); -// if (localStorage.timerRunning == true) { -// setInterval(function() { -// var timeRemaining = localStorage.getItem('endTime') - new Date(); -// console.log(timeRemaining); -// console.log(localStorage.endTime) -// console.log('first'); - -// if (timeRemaining >= 0) { -// console.log('herefirst'); - -// timer.innerText = Math.floor(timeRemaining / 60000) + ':' + ((timeRemaining % 60000) / 1000).toFixed(0); -// } else { -// clearInterval(); -// } -// }, 1000) -// } else { -// localStorage.setItem('timerRunning', true); -// let endTime = +new Date() + (work*60000); -// console.log(endTime); -// console.log('second'); -// localStorage.setItem('workPeriod', work) -// localStorage.setItem('breakPeriod', rest) -// localStorage.setItem('endTime', endTime) -// timerInterval = setInterval(function() { -// var timeRemaining = localStorage.getItem('endTime') - new Date(); -// console.log(timeRemaining); - -// if (timeRemaining >= 0) { -// console.log('here'); -// timer.innerText = Math.floor(timeRemaining / 60000) + ':' + ((timeRemaining % 60000) / 1000).toFixed(0); -// } else { -// clearInterval(timerInterval); -// } -// }, 1000) -// } -// } -// function checkTimer() { -// if (localStorage.timerRunning == true) startTimer(workPeriod, breakPeriod); -// } -// function cancelTimer() { -// localStorage.clear('endTime') -// localStorage.timerRunning = false; -// clearInterval(timerInterval); -// startButton.classList.remove('hidden'); -// startButton.disabled = false; -// cancelButton.classList.add('hidden'); -// } -// var startButton = $('#start') -// var cancelButton = $('#cancel') -// startButton.addEventListener('click', function() {startTimer(52,17)}) -// cancelButton.addEventListener('click', cancelTimer) -// checkTimer(); - // Notepad var notepad = $('textarea') notepad.addEventListener('input', saveNotes)