Skip to content
Permalink
Browse files

remove productivity timer remnants

  • Loading branch information
Alex Mueller
Alex Mueller committed May 9, 2020
1 parent 2e2a27d commit ee6a06b16b20181d8658105b3be8059cab69b5f7
Showing with 1 addition and 82 deletions.
  1. +1 −82 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)

0 comments on commit ee6a06b

Please sign in to comment.
You can’t perform that action at this time.