// ==UserScript==
// @name 背景変更(Feederチャット)
// @author 反物質ムショクニウム
// @version 0.1
// @description 画像のURLを入力欄に入れると背景がその画像になります。ほとんど手伝ってもらったのは内緒です。
// @match *.x-feeder.info/*/
// @exclude *.x-feeder.info/*/*/*
// @namespace https://www.x-feeder.info/
// @grant none
// @downloadURL none
// ==/UserScript==
(function () {
'use strict';
const holder = $("
").appendTo($("body"));
const setImg = src => {
holder.empty().css({
backgroundColor: "black",
position: "fixed",
zIndex: -114515,
width: $(window).width(),
height: $(window).height(),
left: 0,
top: 0,
textAlign: "center",
display: "flex",
"justify-content": "center",
"align-items": "center",
}).show();
$("
![]()
", {
src: src
}).appendTo(holder).css({
width: $(window).width()
});
};
const backgroundColor_copy = $("#wrapper").css("backgroundColor");
$("
").attr('placeholder', '背景にしたい画像のURL').prependTo($("#post_btn").parent()).change(function () {
if ($(this).val()) {
setImg($(this).val());
$("#wrapper").css({
backgroundColor: "transparent"
}); // 内背景透明化
} else {
holder.hide();
$("#wrapper").css({
backgroundColor: backgroundColor_copy
});
}
});
})();