Greasy Fork is available in English.

背景変更(Feederチャット)

画像のURLを入力欄に入れると背景がその画像になります。ほとんど手伝ってもらったのは内緒です。

2019/06/23時点のページです。最新版はこちら。

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
// ==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
// ==/UserScript==
(function () {
  'use strict';
  const holder = $("<div>").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();
    $("<img>", {
      src: src
    }).appendTo(holder).css({
      width: $(window).width()
    });
  };
  const backgroundColor_copy = $("#wrapper").css("backgroundColor");
  $("<input>").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
      });
    }
  });
})();