/** * Custom JavaScript for FixIt blog site. * @author @Lruihao https://lruihao.cn */ class FixItBlog { /** * say hello * you can define your own functions below * @returns {FixItBlog} */ hello() { console.log('custom.js: Hello FixIt!'); return this; } /** * initialize * @returns {FixItBlog} */ init() { this.hello(); return this; } } /** * immediate execution */ (() => { window.fixitBlog = new FixItBlog(); // it will be executed when the DOM tree is built document.addEventListener('DOMContentLoaded', () => { window.fixitBlog.init(); }); })();