Pixmap Void theme

Refresh the website for the theme to appear.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Pixmap Void theme
// @version      1.1
// @description  Refresh the website for the theme to appear.
// @author       TrxrKnocks
// @grant 		 GM_xmlhttpRequest
// @grant 		 unsafeWindow
// @connect		 githubusercontent.com
// @connect		 github.com
// @connect		 pixmap.fun
// @match      *://pixmap.fun/*
// @namespace https://greasyfork.org/users/1293155
// ==/UserScript==

fetch('https://raw.githubusercontent.com/TouchedByDarkness/pixelplanet-void-style/main/style.css')
.then(res => res.text())
.then(css => {
	const ssv = unsafeWindow.ssv;
	const link = Array.from(document.querySelectorAll('link')).find(link => {
		const href = link.getAttribute('href');
		return (
			link.getAttribute('rel') === 'stylesheet' &&
			link.getAttribute('type') === 'text/css' &&
			href &&
			Object.values(ssv.availableStyles).some(path => href.includes(path)) &&
			!href.includes(ssv.availableStyles.default));
	});

	if(link) {
		link.parentNode.removeChild(link);
	}

	const style = document.createElement('style');
	style.innerHTML = css;
	document.head.appendChild(style);
});