Created
October 7, 2022 07:31
-
-
Save Askill/9b16c46f7d9599c8bb2c04df98b06b9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function OpenSections() { | |
console.log('Opening Sections...'); | |
var index = 0; | |
var sectionPush = document.querySelectorAll('.js-panel-toggler') | |
var sectionHidden = document.querySelectorAll('.panel--content-wrapper--1g5eE') | |
sectionHidden.forEach((item) => { | |
const hidden = item.getAttribute('aria-hidden'); | |
if (hidden == "true") { | |
sectionPush[index].click(); | |
} | |
index++ | |
}) | |
console.log('Opening Sections DONE'); | |
} | |
function GetToalMins() { | |
let total = 0; | |
const items = document.querySelectorAll('.item-link.udlite-custom-focus-visible') | |
items.forEach((item) => { | |
const isChecked = item.querySelector('.udlite-real-toggle-input').checked; | |
if (!isChecked) { | |
let timer = item.querySelector('.udlite-text-xs span'); | |
if (timer) { | |
time = timer.innerText.replace('min', ''); | |
total+= parseInt(time); | |
} | |
} | |
}) | |
return total | |
} | |
function ConvertMins(total) { | |
console.log('Calculation Total DONE') | |
console.log("Total: " + total + "mins") | |
var minsToHours = 60 | |
var minsToDays = (minsToHours * 24) | |
var days = parseInt(total/minsToDays) | |
total -= (days*minsToDays) | |
var hours = parseInt(total/minsToHours) | |
total -= (hours*minsToHours) | |
var mints = total | |
console.log(days + " day, " + hours + " hours, " + mints + " mins"); | |
} | |
function getLeftTime() { | |
OpenSections(); | |
var total = GetToalMins(); | |
ConvertMins(total); | |
} | |
getLeftTime(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment