💡 Updated function comments
This commit is contained in:
parent
591fa0176a
commit
296227e9fc
@ -2,10 +2,12 @@
|
|||||||
// │ ├─┤├┬┘ ││└─┐
|
// │ ├─┤├┬┘ ││└─┐
|
||||||
// └─┘┴ ┴┴└──┴┘└─┘
|
// └─┘┴ ┴┴└──┴┘└─┘
|
||||||
|
|
||||||
|
// Print cards
|
||||||
const printCards = () => {
|
const printCards = () => {
|
||||||
for (const card of CONFIG.cards) {
|
for (const card of CONFIG.cards) {
|
||||||
console.log(card.id);
|
console.log(card.id);
|
||||||
|
|
||||||
|
// Card Item
|
||||||
let item = `
|
let item = `
|
||||||
<a
|
<a
|
||||||
href="${card.link}"
|
href="${card.link}"
|
||||||
|
@ -2,11 +2,13 @@
|
|||||||
// │ │└─┐ │ └─┐
|
// │ │└─┐ │ └─┐
|
||||||
// ┴─┘┴└─┘ ┴ └─┘
|
// ┴─┘┴└─┘ ┴ └─┘
|
||||||
|
|
||||||
|
// Print the first List
|
||||||
const printFirstList = () => {
|
const printFirstList = () => {
|
||||||
let icon = `<i class="list__head" data-feather="${CONFIG.firstListIcon}"></i>`;
|
let icon = `<i class="list__head" data-feather="${CONFIG.firstListIcon}"></i>`;
|
||||||
const position = 'beforeend';
|
const position = 'beforeend';
|
||||||
list_1.insertAdjacentHTML(position, icon);
|
list_1.insertAdjacentHTML(position, icon);
|
||||||
for (const link of CONFIG.lists.firstList) {
|
for (const link of CONFIG.lists.firstList) {
|
||||||
|
// List item
|
||||||
let item = `
|
let item = `
|
||||||
<a
|
<a
|
||||||
target="${CONFIG.openInNewTab ? '_blank' : ''}"
|
target="${CONFIG.openInNewTab ? '_blank' : ''}"
|
||||||
@ -20,11 +22,13 @@ const printFirstList = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Print the second List
|
||||||
const printSecondList = () => {
|
const printSecondList = () => {
|
||||||
let icon = `<i class="list__head" data-feather="${CONFIG.secondListIcon}"></i>`;
|
let icon = `<i class="list__head" data-feather="${CONFIG.secondListIcon}"></i>`;
|
||||||
const position = 'beforeend';
|
const position = 'beforeend';
|
||||||
list_2.insertAdjacentHTML(position, icon);
|
list_2.insertAdjacentHTML(position, icon);
|
||||||
for (const link of CONFIG.lists.secondList) {
|
for (const link of CONFIG.lists.secondList) {
|
||||||
|
// List item
|
||||||
let item = `
|
let item = `
|
||||||
<a
|
<a
|
||||||
target="${CONFIG.openInNewTab ? '_blank' : ''}"
|
target="${CONFIG.openInNewTab ? '_blank' : ''}"
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// ┴ ┴┴ ┴└─┘
|
// ┴ ┴┴ ┴└─┘
|
||||||
|
|
||||||
window.onload = displayClock();
|
window.onload = displayClock();
|
||||||
|
// Clock function
|
||||||
function displayClock() {
|
function displayClock() {
|
||||||
const monthNames = [
|
const monthNames = [
|
||||||
'Jan',
|
'Jan',
|
||||||
@ -19,6 +20,7 @@ function displayClock() {
|
|||||||
'Dec',
|
'Dec',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Get clock elements
|
||||||
var d = new Date();
|
var d = new Date();
|
||||||
var mm = monthNames[d.getMonth()];
|
var mm = monthNames[d.getMonth()];
|
||||||
var dd = d.getDate();
|
var dd = d.getDate();
|
||||||
@ -26,12 +28,14 @@ function displayClock() {
|
|||||||
var hh = d.getHours();
|
var hh = d.getHours();
|
||||||
var ampm = '';
|
var ampm = '';
|
||||||
|
|
||||||
|
// Hour format
|
||||||
if (CONFIG.twelveHourFormat) {
|
if (CONFIG.twelveHourFormat) {
|
||||||
ampm = hh >= 12 ? ' pm' : ' am';
|
ampm = hh >= 12 ? ' pm' : ' am';
|
||||||
hh = hh % 12;
|
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('hour').innerText = hh;
|
||||||
document.getElementById('separator').innerHTML = ' : ';
|
document.getElementById('separator').innerHTML = ' : ';
|
||||||
document.getElementById('minutes').innerText = min + ampm;
|
document.getElementById('minutes').innerText = min + ampm;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user