Simple Kenmei.co QoL improvements. More for personal use but if anyone wants to use it they can.
I really enjoy this script a lot. Also, do you have a Discord server?
The script doesn't work anymore with the new Kenmei update, which is a new problem.
Once the script is changed and works, I'll change the ranking to Good. 👍
I created something for the time being, but all it can do is change the theme. Maybe, at least, it functions partially.
(function() {
'use strict';
const $ = window.jQuery;
const Cookies = window.Cookies;
// Function to generate random ID
function generateID(length) {
let result = '';
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
const charactersLength = characters.length;
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}
// Function to wait for an element to appear
function waitForElement(selector) {
return new Promise(resolve => {
const element = document.querySelector(selector);
if (element) {
resolve(element);
} else {
const observer = new MutationObserver(mutations => {
const target = document.querySelector(selector);
if (target) {
resolve(target);
observer.disconnect();
}
});
observer.observe(document.body, { childList: true, subtree: true });
}
});
}
// Function to initialize functionality
function init() {
const viewState = Cookies.get("view-state");
if (!viewState) {
Cookies.set("view-state", "light", { expires: 7, path: '' });
} else if (viewState === "dark") {
$('html').addClass("dark");
}
const location = window.location.href.toString();
if (location.includes('dashboard')) {
waitForElement('.the-dashboard-header').then(() => {
// Your logic for dashboard
});
}
}
// Check for window resize
const checkWindow = setInterval(() => {
if ($('.the-dashboard-header > div:nth-child(1) > div:nth-child(2)').children().length <= 2 || ($(window).width() < 1024 && $('.the-dashboard-header > div:nth-child(1) > div:nth-child(2)').children().length === 3)) {
$('.open-button, .read-button, .popup-modal').remove();
init();
}
}, 100);
// Initialize functionality
init();
})();
I was a little late, didn't see the changes they had made. I fixed the script and ended up removing the checks I had for window resizing since the new div they placed their buttons in is actually responsive :0
I've tested all functions and it's all working for me, if you have any issues don't hesitate to bring them up.
I don't have a discord server, I started this as a QoL script for myself, not to share, up until the owner banned me for adding the 2 buttons (Not dark mode) so I decided to share the script and add the dark mode feature.
I try to keep up with their updates as often as they come but I only see them when I go to their site so every now and then I miss one. GL though
Thanks for making the changes. It works now 👍
I really enjoy this script a lot. Also, do you have a Discord server?
The script doesn't work anymore with the new Kenmei update, which is a new problem.