-
Notifications
You must be signed in to change notification settings - Fork 0
/
timer.js
20 lines (17 loc) · 878 Bytes
/
timer.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function updatePopoutTimer() {
chrome.storage.local.get(['currentHours', 'currentMinutes', 'currentSeconds'], (result) => {
document.getElementById("hours").textContent = result.currentHours < 10 ? '0' + result.currentHours : result.currentHours;
document.getElementById("minutes").textContent = result.currentMinutes < 10 ? '0' + result.currentMinutes : result.currentMinutes;
document.getElementById("seconds").textContent = result.currentSeconds < 10 ? '0' + result.currentSeconds : result.currentSeconds;
});
}
document.addEventListener('DOMContentLoaded', () => {
chrome.storage.sync.get('selectedTheme', (result) => {
const theme = result.selectedTheme || 'default';
document.body.className = '';
if (theme !== 'default') {
document.body.classList.add(theme);
}
});
});
setInterval(updatePopoutTimer, 1000);