Blur code blocks

This commit is contained in:
Lars Tveito 2019-11-19 19:46:07 +01:00
parent 8dc6f59e5d
commit fb82ad5467
2 changed files with 17 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#+TITLE: SMT for IN3070 #+TITLE: SMT for IN3070
#+AUTHOR: Lars Tveito #+AUTHOR: Lars Tveito
#+HTML_HEAD: <script type="text/javascript" src="js/script.js"></script>
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="Rethink/rethink.css" /> #+HTML_HEAD: <link rel="stylesheet" type="text/css" href="Rethink/rethink.css" />
#+OPTIONS: toc:nil num:nil html-style:nil #+OPTIONS: toc:nil num:nil html-style:nil

16
js/script.js Normal file
View File

@ -0,0 +1,16 @@
function blurPython() {
blocksToBlur = document.getElementsByClassName('src-python');
// Note: Skipping the two first code blocks
for (var i = 1; i < blocksToBlur.length; i++) {
const block = blocksToBlur[i]
block.setAttribute("style", "cursor: pointer;");
block.classList.toggle("blur");
block.addEventListener("click", function () {
block.classList.toggle("blur");
});
}
}
document.addEventListener('DOMContentLoaded', function(){
blurPython();
}, false);