From ea1f41c853f391eabb09b641cbfee61fea4a5346 Mon Sep 17 00:00:00 2001 From: Florian Sylvain Date: Sun, 6 Feb 2022 20:47:50 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Added=20lazy=20loading=20f?= =?UTF-8?q?or=20css?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 4 +++- script.js | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index a94651f..d843151 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,9 @@ - + Florian Sylvain diff --git a/script.js b/script.js index a3632a4..e8b0151 100644 --- a/script.js +++ b/script.js @@ -17,6 +17,17 @@ const projectsIDs = Array.from(projectsContentList) let lastScrollTop = window.pageYOffset; +function loadCSS() { + "use strict"; + const stylesheet = document.createElement('link'); + stylesheet.href = 'stylesheet.css'; + stylesheet.rel = 'stylesheet'; + stylesheet.type = 'text/css'; + document.querySelector('head').appendChild(stylesheet); +} + +loadCSS(); + function toAddClass(toClass, inClass) { "use strict";