From 45f3395cd525c8ce7ce33de4fe555180058ac532 Mon Sep 17 00:00:00 2001 From: Mhykol Date: Mon, 27 May 2024 09:14:33 -0400 Subject: Added slideshow for blog --- assets/js/main.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'assets/js/main.js') diff --git a/assets/js/main.js b/assets/js/main.js index 4932e53..3dc536d 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -87,13 +87,17 @@ const getBlog = async (x) => { res('success') }) prism.then(output => { + const script = document.createElement('script') main.body.innerHTML = DOMPurify.sanitize(text, { ADD_TAGS: ["iframe"], ADD_ATTR: ['allow', 'allowfullscreen', 'frameborder', 'scrolling'] }) + script.src = `${window.location.origin}/js/blogitem.js` + document.head.appendChild(script) eventListener() window.scrollTo(0, 0) }) }) } +// Event listeners const eventListener = () => { const menuList = document.getElementById('menu-list') const menuIcon = document.getElementById('menu-icon') -- cgit v1.2.3-70-g09d2