From 74bb8aaf6f0bddc866d0341d347f0d92ddf94a2b Mon Sep 17 00:00:00 2001 From: Oscar Najera Date: Fri, 17 Jan 2025 02:33:06 +0100 Subject: load icons css with delay --- assets/js/loads.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'assets') diff --git a/assets/js/loads.js b/assets/js/loads.js index 71e0173..c8a03a7 100644 --- a/assets/js/loads.js +++ b/assets/js/loads.js @@ -1,4 +1,4 @@ -function load_js(url) { +function load_css(url) { let link = document.createElement("link"); link.rel = "stylesheet"; link.type = "text/css"; @@ -9,6 +9,16 @@ function load_js(url) { addEventListener("load", function () { if (document.querySelector(".highlight .chroma")) { - load_js("/css/syntax.css"); + load_css("/css/syntax.css"); } + + if (document.querySelector(".ai")) { + load_css( + "https://cdn.jsdelivr.net/gh/jpswalsh/academicons@1/css/academicons.min.css", + ); + } + if (document.querySelectorAll(".fa,.fab,.fas,.far")) + load_css( + "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css", + ); }); -- cgit v1.2.3