️ Added lazy loading for css

This commit is contained in:
Florian Sylvain
2022-02-06 20:47:50 +01:00
parent 1f4e0640f0
commit ea1f41c853
2 changed files with 14 additions and 1 deletions
+2
View File
@@ -5,7 +5,9 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<noscript>
<link rel="stylesheet" type="text/css" href="stylesheet.css"> <link rel="stylesheet" type="text/css" href="stylesheet.css">
</noscript>
<title>Florian Sylvain</title> <title>Florian Sylvain</title>
</head> </head>
+11
View File
@@ -17,6 +17,17 @@ const projectsIDs = Array.from(projectsContentList)
let lastScrollTop = window.pageYOffset; 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) { function toAddClass(toClass, inClass) {
"use strict"; "use strict";