mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
36 lines
677 B
JavaScript
36 lines
677 B
JavaScript
/**
|
|
* @author @Lruihao https://lruihao.cn
|
|
* @description Custom javascript for the hugo theme FixIt.
|
|
*/
|
|
const CustomJS = new (function () {
|
|
/**
|
|
* Hello World
|
|
* You can define your own functions below.
|
|
* @returns {CustomJS}
|
|
*/
|
|
this.hello = () => {
|
|
console.log('Hello CustomJS!');
|
|
return this;
|
|
}
|
|
/**
|
|
* Initialize.
|
|
* @returns {CustomJS}
|
|
*/
|
|
this.init = () => {
|
|
// Custom infos.
|
|
this.hello();
|
|
return this;
|
|
};
|
|
})();
|
|
|
|
/**
|
|
* Immediate.
|
|
*/
|
|
(() => {
|
|
CustomJS.init();
|
|
// It will be executed when the DOM tree is built.
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
console.log('DOM content loaded!')
|
|
});
|
|
})();
|