Files
FixIt/assets/js/_custom.js
T
2022-01-09 22:42:29 +08:00

37 lines
764 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', () => {
// Listen to any DOM change and automatically perform spacing via MutationObserver()
console.log('DOMContentLoaded!')
});
})();