-
Notifications
You must be signed in to change notification settings - Fork 185
/
Copy pathremove-blur.js
23 lines (22 loc) · 1.05 KB
/
remove-blur.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const focusImages = () => {
var bluredContainers = Array.from(document.getElementsByClassName('blurred-container'));
bluredContainers.forEach( (bluredContainer) => {
bluredContainer.firstChild.src = bluredContainer.firstChild.src.replace('/blurred/', '/');
bluredContainer.firstChild.classList.add('bi', 'x0', 'y0', 'w1', 'h1');
bluredContainer.classList.remove('blurred-container');
});
}
window.addEventListener('load', function(){
var pages = document.getElementsByClassName('page-content');
for(i=0; i<pages.length; i++){
pagecontent=pages[i].parentNode.childNodes;
for(j=0; j<pagecontent.length; j++){
if(pagecontent[j].className != "page-content"){
pagecontent[j].parentNode.removeChild(pagecontent[j]);
}
}
pages[i].classList.add("nofilter");
}
document.getElementById('viewer-wrapper').addEventListener('scroll', () => {focusImages()});
document.getElementById('document-wrapper').addEventListener('scroll', (e) => { focusImages()});
});