️ Rollback before "performance" "improvement" because bad user experience

This commit is contained in:
Florian Sylvain
2022-02-10 19:27:55 +01:00
parent 54fb739045
commit cf5af43fd2
5 changed files with 283 additions and 280 deletions
+7 -11
View File
@@ -15,21 +15,19 @@ const projectsContentList = document.querySelectorAll('.article-content');
const projectsIDs = Array.from(projectsContentList)
.map((project) => project.id);
const stylesheets = ['stylesheet-main.css', 'stylesheet-imgs.css'];
let lastScrollTop = window.scrollY;
function loadCSS() {
"use strict";
stylesheets.forEach(function (stylesheet) {
const link = document.createElement('link');
link.href = stylesheet;
link.rel = 'stylesheet';
link.type = 'text/css';
document.querySelector('head').appendChild(link);
});
const stylesheet = document.createElement('link');
stylesheet.href = 'stylesheet-imgs.css';
stylesheet.rel = 'stylesheet';
stylesheet.type = 'text/css';
document.querySelector('head').appendChild(stylesheet);
}
loadCSS();
function toAddClass(toClass, inClass) {
"use strict";
@@ -178,5 +176,3 @@ document.querySelectorAll('.projects-list article').forEach(function (a) {
switchArticle(document.getElementById(a.classList[0]));
};
});
loadCSS(); // Loading non-essential CSS when everything else is loaded.