Polytoria Link Texture

Adds A Button To Link Polytoria Textures!

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Polytoria Link Texture
// @icon         https://cdn.discordapp.com/attachments/898314728219242597/900157044009611284/image.png
// @license      Apache-2.0
// @namespace    lol
// @version      1.0.0
// @description  Adds A Button To Link Polytoria Textures!
// @author       levisurely
// @match        https://polytoria.com/shop/*
// @grant        none
// ==/UserScript==

//lev#9999 On Discord
//discord.gg/tmYQr99wTa

(function () {
  const gid = Number(window.location.pathname.split("/")[2]);
  if (!gid) return;

  let btn = document.createElement("button");
  btn.id = "lev-texture";
  btn.onclick = function () {
    window.open(`https://polytoria.com/assets/catalog/${gid}.png`);
  };
  btn.type = "button";
  btn.href = `https://polytoria.com/assets/catalog/${gid}.png`;
  btn.innerHTML = "View Texture";
  btn.className = "btn btn-block";
  btn.style.backgroundColor = "#8c39d1";
  btn.style.color = "#fff";
  btn.style.borderCcolor = "#8c39d1";
  //console.log(document.getElementsByClassName("col-sm-8"));
  document.getElementsByClassName("col-sm-8")[0].prepend(btn);
})();