Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
remove productivity timer remnants
  • Loading branch information
Alex Mueller committed May 9, 2020
1 parent 2e2a27d commit ee6a06b
Showing 1 changed file with 1 addition and 82 deletions.
83 changes: 1 addition & 82 deletions final/js/main.js
Expand Up @@ -13,7 +13,6 @@ else if (hour > 17) humanTime = "evening";
else if (hour > 12) humanTime = "afternoon"; else if (hour > 12) humanTime = "afternoon";
else if (hour > 6) humanTime = "morning"; else if (hour > 6) humanTime = "morning";
currentTod.innerHTML = humanTime; currentTod.innerHTML = humanTime;
//docTitle.innerHTML = 'New tab: Good ' + humanTime +'!';
// Current Time // Current Time
var time = $('#time') var time = $('#time')
function addZero(i) { function addZero(i) {
Expand Down Expand Up @@ -65,13 +64,8 @@ var prod = $('#prod')
var prodSection = $('#productivity') var prodSection = $('#productivity')
var notes = $('#notes') var notes = $('#notes')
var notesSection = $('#notes-section') var notesSection = $('#notes-section')
//var twentyFive = $('#twenty-five');
//var fiftyTwo = $('#fifty-two')
tod.addEventListener('click', switchTabs) tod.addEventListener('click', switchTabs)
//prod.addEventListener('click', switchTabs)
notes.addEventListener('click', switchTabs) notes.addEventListener('click', switchTabs)
//twentyFive.addEventListener('click', switchTabs)
//fiftyTwo.addEventListener('click', switchTabs)
if (localStorage.getItem('activeTab') == null) localStorage.setItem('activeTab', 'tod') if (localStorage.getItem('activeTab') == null) localStorage.setItem('activeTab', 'tod')
$(`#${localStorage.getItem('activeTab')}`).classList.add('active') $(`#${localStorage.getItem('activeTab')}`).classList.add('active')
$(`#${localStorage.getItem('activeTab')}-section`).classList.remove('hidden') $(`#${localStorage.getItem('activeTab')}-section`).classList.remove('hidden')
Expand All @@ -85,16 +79,7 @@ function switchTabs(e) {
notes.classList.remove('active') notes.classList.remove('active')
notesSection.classList.add('hidden') notesSection.classList.add('hidden')
localStorage.setItem('activeTab', 'tod') localStorage.setItem('activeTab', 'tod')
} } else if (id == "notes") {
// 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") {
tod.classList.remove('active') tod.classList.remove('active')
todSection.classList.add('hidden') todSection.classList.add('hidden')
notes.classList.add('active') notes.classList.add('active')
Expand All @@ -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 // Notepad
var notepad = $('textarea') var notepad = $('textarea')
notepad.addEventListener('input', saveNotes) notepad.addEventListener('input', saveNotes)
Expand Down

0 comments on commit ee6a06b

Please sign in to comment.