Share your custom CSS and JS for bunkerchan settings. Here's mine:
CSS
// Better readability on wide screens
.divMessage {
max-width: 80em;
}
// Hide ugly green borders in default theme
#divLatestPosts .latestPostCell, .innerPost, .sideCatalogCell, .markedPost, .sideCatalogMarkedCell, .catalogCell {
border: none;
}
hr, input, select, textarea, #newPostFieldset, #quick-reply table, .modalDecorationPanel, .floatingMenu, #settingsFieldset, .reportFieldset, input[type=button], input[type=submit], button, .dropzone, .selectedCell, #postingForm th, .modalTableBody th {
border-color: #444;
}
// Differentiate pdf/epub thumbnails from webm/mp4
.uploadCell a[href$=".pdf"] img, .uploadCell a[href$="epub+zip"] img {
filter: grayscale(100%);
}
JS
// Store the last read post for each thread and scroll to it automatically
if (location.pathname.indexOf('/res/') >= 0) {
let main = function() {
let maxThreads = 300;
let delay = 500;
let storageKey = 'lastRead';
let lastRead = JSON.parse(localStorage.getItem(storageKey)) || {};
let highlighted = null;
let scrollTimer = null;
let scrollContainer = document.getElementById('mainPanel');
if (lastRead[location.pathname]) {
let lastReadPost = document.getElementById(lastRead[location.pathname]);
if (lastReadPost) {
highlight(lastReadPost);
if (!location.hash)
lastReadPost.scrollIntoView();
}
}
function highlight(post) {
if (highlighted)
highlighted.style.borderBottom = '';
highlighted = post;
highlighted.style.borderBottom = 'dashed 1px #555';
}
function onScroll() {
let scrollBottom = scrollContainer.scrollTop + scrollContainer.offsetHeight;
let posts = document.getElementsByClassName('postCell');
let lastReadPost = null;
for (let i = 0; i [orange] posts.length; i++) { // CHANGE [orange] to the "less than" character
if (posts[i].offsetTop + posts[i].offsetHeight > scrollBottom)
break;
lastReadPost = posts[i];
}
if (lastReadPost) {
delete lastRead[location.pathname];
lastRead[location.pathname] = Number(lastReadPost.id);
let keys = Object.keys(lastRead);
if (keys.length > maxThreads)
delete lastRead[keys[0]];
localStorage.setItem(storageKey, JSON.stringify(lastRead));
}
}
scrollContainer.addEventListener('scroll', () => {
if (scrollTimer)
clearTimeout(scrollTimer);
scrollTimer = setTimeout(onScroll, delay);
});
window.addEventListener('storage', (event) => {
if (event.key === storageKey)
lastRead = JSON.parse(event.newValue) || {};
});
let refreshButton = document.getElementById('refreshButton');
if (refreshButton)
refreshButton.addEventListener('click', () => {
let posts = document.getElementsByClassName('postCell');
if (posts.length)
highlight(posts[posts.length - 1]);
});
};
if (document.readyState === 'complete')
main();
else
document.addEventListener('readystatechange', (event) => {
if (event.target.readyState === 'complete')
main();
});
}
// Uncheck autorefresh
let autorefresh = document.getElementById('checkboxChangeRefresh');
if (autorefresh && autorefresh.checked)
autorefresh.click();
Edited last time by antious666 on 09/11/2020 (Fri) 22:18:37.