💡 Updated function comments

This commit is contained in:
Miguel Avila 2021-08-14 12:02:43 -05:00
parent 591fa0176a
commit 296227e9fc
3 changed files with 11 additions and 1 deletions

View File

@ -2,10 +2,12 @@
// │ ├─┤├┬┘ ││└─┐
// └─┘┴ ┴┴└──┴┘└─┘
// Print cards
const printCards = () => {
for (const card of CONFIG.cards) {
console.log(card.id);
// Card Item
let item = `
<a
href="${card.link}"

View File

@ -2,11 +2,13 @@
// │ │└─┐ │ └─┐
// ┴─┘┴└─┘ ┴ └─┘
// Print the first List
const printFirstList = () => {
let icon = `<i class="list__head" data-feather="${CONFIG.firstListIcon}"></i>`;
const position = 'beforeend';
list_1.insertAdjacentHTML(position, icon);
for (const link of CONFIG.lists.firstList) {
// List item
let item = `
<a
target="${CONFIG.openInNewTab ? '_blank' : ''}"
@ -20,11 +22,13 @@ const printFirstList = () => {
}
};
// Print the second List
const printSecondList = () => {
let icon = `<i class="list__head" data-feather="${CONFIG.secondListIcon}"></i>`;
const position = 'beforeend';
list_2.insertAdjacentHTML(position, icon);
for (const link of CONFIG.lists.secondList) {
// List item
let item = `
<a
target="${CONFIG.openInNewTab ? '_blank' : ''}"

View File

@ -3,6 +3,7 @@
// ┴ ┴┴ ┴└─┘
window.onload = displayClock();
// Clock function
function displayClock() {
const monthNames = [
'Jan',
@ -19,6 +20,7 @@ function displayClock() {
'Dec',
];
// Get clock elements
var d = new Date();
var mm = monthNames[d.getMonth()];
var dd = d.getDate();
@ -26,12 +28,14 @@ function displayClock() {
var hh = d.getHours();
var ampm = '';
// Hour format
if (CONFIG.twelveHourFormat) {
ampm = hh >= 12 ? ' pm' : ' am';
hh = hh % 12;
hh = hh ? hh : 12; //show mod 0 as 12
hh = hh ? hh : 12;
}
// Display clock elements
document.getElementById('hour').innerText = hh;
document.getElementById('separator').innerHTML = ' : ';
document.getElementById('minutes').innerText = min + ampm;