Improve performance

This commit is contained in:
tarikjaber
2023-03-04 00:26:15 -05:00
parent 9a0034e61e
commit 4106d9585d
2 changed files with 2 additions and 8 deletions

View File

@@ -27,9 +27,9 @@
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link defer href="https://fonts.googleapis.com/css2?family=Fira+Code&family=Roboto&display=swap" rel="stylesheet">
<link rel="stylesheet" id="theme-style"
<link rel="stylesheet" id="theme-style" defer
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/github-dark.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
<script defer src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
<link rel="stylesheet" href="styles.css">
</head>

View File

@@ -12,12 +12,6 @@ let selectedTheme = localStorage.getItem('theme') || 'github-dark';
let codeText = localStorage.getItem('code') || 'console.log("Hello World")';
// Set up the initial state
document.addEventListener('securitypolicyviolation', function (event) {
if (event.violatedDirective === 'expect-ct') {
event.preventDefault();
}
});
themeStylesheet.setAttribute('href', getStylesheet(selectedTheme));
themeSelector.value = selectedTheme;
code.classList.add('hljs', `language-${selectedLanguage}`);