// ==UserScript==
// @name Old KF Layout
// @namespace http://tampermonkey.net/
// @version 1.0
// @description sneed
// @match https://*.kiwifarms.st/*
// @match https://kiwifarms.st/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
if (!window.location.pathname.match(/^\/?$/)) return;
const boards = [
{
id: 16,
title: 'Lolcows',
description: '<span id="lolcow-description" data-lolcow="lolcow">Lolcows are people whose eccentric behavior can be "milked" for entertainment.</span>',
url: '/forums/lolcows.16/?prefix_id=75',
hasSubforum: true,
subforumName: 'Stanchion',
subforumUrl: '/forums/stanchion.140/'
},
{
id: 63,
title: 'Community Watch',
description: 'Lolcows tend to thrive in communities with like-minded people who do not criticize their behavior.',
url: '/forums/lolcows.16/?prefix_id=108',
hasSubforum: false
},
{
id: 83,
title: 'Animal Control',
description: 'The people, communities, and drama of the furry and pony fandoms.',
url: '/forums/lolcows.16/?prefix_id=191',
hasSubforum: false
},
{
id: 18,
title: 'Christian Weston Chandler',
description: 'Chris-Chan is the author of <em>Sonichu</em> and is considered one of the most heavily documented people in human history.',
url: '/forums/christian-weston-chandler.18/',
hasSubforum: false
},
{
id: 113,
title: 'Ethan Ralph / Da Sektur',
description: '<em>The #Killstream</em> and the smoldering ruins of a once great Sektur.',
url: '/forums/ethan-ralph-da-sektur.113/',
hasSubforum: false
},
{
id: 132,
title: 'Grift Wars',
description: 'The fate of western civilization will be decided by the e-daddy with the largest Patreon.',
url: '/forums/lolcows.16/?prefix_id=192',
hasSubforum: false
},
{
id: 95,
title: 'Internet Famous',
description: 'Online personalities, livestreamers, "Internet Bloodsports", and the children of the corn from those communities.',
url: '/forums/lolcows.16/?prefix_id=193',
hasSubforum: false
},
{
id: 130,
title: 'Internet Tough Guys',
description: 'For the toughest tough guys on the Internet.',
url: '/forums/lolcows.16/?prefix_id=194',
hasSubforum: false
},
{
id: 86,
title: 'Phil Burnell / DarkSydePhil',
description: 'DarkSydePhil is a notoriously awful Let\'s Player who built an empire on failure and a permanently sinking ship.',
url: '/forums/phil-burnell-darksydephil.86/',
hasSubforum: false
}
];
function createBoardNode(board) {
const nodeDiv = document.createElement('div');
nodeDiv.className = `node node--id${board.id} node--depth2 node--forum node--unread`;
let subforumHTML = '';
if (board.hasSubforum) {
subforumHTML = `
<div class="node-subNodesFlat">
<span class="node-subNodesLabel">Sub-forums:</span>
<ol class="node-subNodeFlatList">
<li>
<a href="${board.subforumUrl}" class="subNodeLink subNodeLink--forum subNodeLink--unread">
<i class="fa--xf fal fa-comments subNodeLink-icon"><svg xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true"><use href="/data/local/icons/light.svg#comments"></use></svg></i>${board.subforumName}
</a>
</li>
</ol>
</div>`;
}
const svgVersion = document.querySelector('use[href*="light.svg"]')?.getAttribute('href')?.match(/\?v=(\d+)/)?.[1] || '1759184789';
nodeDiv.innerHTML = `
<div class="node-body">
<span class="node-icon" aria-hidden="true">
<i class="fa--xf fal fa-comments "><svg xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true"><use href="/data/local/icons/light.svg?v=${svgVersion}#comments"></use></svg></i>
</span>
<div class="node-main js-nodeMain">
<h3 class="node-title">
<a href="${board.url}" data-xf-init="" data-shortcut="node-description">${board.title}</a>
</h3>
<div class="node-description ">${board.description}</div>
<div class="node-meta">
${subforumHTML}
</div>
</div>
<div class="node-stats">
</div>
<div class="node-extra">
<div class="node-extra-icon"></div>
<div class="node-extra-row"></div>
<div class="node-extra-row"></div>
</div>
</div>
`;
return nodeDiv;
}
const lolcowsBlock = document.querySelector('.block--category62');
if (!lolcowsBlock) return;
const mergedNode = lolcowsBlock.querySelector('.node--id16');
if (!mergedNode) return;
const blockBody = mergedNode.parentElement;
const nodesToKeep = [93, 129, 39];
const allNodes = blockBody.querySelectorAll('.node');
allNodes.forEach(node => {
const nodeId = parseInt(node.className.match(/node--id(\d+)/)?.[1]);
if (!nodesToKeep.includes(nodeId)) {
node.remove();
}
});
const internClique = blockBody.querySelector('.node--id93');
boards.forEach(board => {
const newNode = createBoardNode(board);
blockBody.insertBefore(newNode, internClique);
});
})();