// ==UserScript== // @name 自動描画 配布用(ベータ版) // @namespace http://tampermonkey.net/ // @version 0.9 // @description 画像を自動で描画します // @author あるぱか // @match https://pictsense.com/* // @icon https://img.icons8.com/?size=100&id=NP2HKyKwWrzn&format=png&color=000000 // @grant none // @license MIT // @downloadURL https://update.greasyfork.icu/scripts/529130/%E8%87%AA%E5%8B%95%E6%8F%8F%E7%94%BB%20%E9%85%8D%E5%B8%83%E7%94%A8%28%E3%83%99%E3%83%BC%E3%82%BF%E7%89%88%29.user.js // @updateURL https://update.greasyfork.icu/scripts/529130/%E8%87%AA%E5%8B%95%E6%8F%8F%E7%94%BB%20%E9%85%8D%E5%B8%83%E7%94%A8%28%E3%83%99%E3%83%BC%E3%82%BF%E7%89%88%29.meta.js // ==/UserScript== const alpacaAutoDraw="ほぼAIに作ってもらったぜ!!!!";!function(){"use strict";let e=document.createElement("div");e.id="SettingMenus",e.style.background="#e0e0e080",e.style.height="660px",e.style.width="0",e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.userSelect="none",e.style.paddingTop="50px",e.style.transition=".05s",e.style.filter="drop-shadow(2px 0px 3px #ccc)",document.getElementById("base").appendChild(e),e.innerHTML='
';let t=document.getElementById("outoDrawMenuButton"),n=document.querySelector("#SettingMenus div");t.addEventListener("click",function(){(l=!l)?(e.style.width="300px",t.style.width="300px",t.innerText="◀︎",n.style.display=null):(e.style.width="0",t.style.width="0",t.innerText="▶︎",n.style.display="none")});let l=!1,i=document.querySelector("#menuE"),o=document.createElement("input");o.type="file",o.accept="image/*",o.style.zIndex="1000",i.appendChild(o);let d=document.createElement("div");d.style.zIndex="1000",d.style.color="white",d.style.backgroundColor="rgba(0, 0, 0, 0.5)",i.appendChild(d);let $=document.createElement("input");$.type="range",$.min="1",$.max="100",$.value="100",$.style.zIndex="1000",$.style.backgroundColor="rgba(0, 0, 0, 0.5)",i.appendChild($),$.addEventListener("input",function(){d.textContent=`現在のスケール: ${$.value}%`}),d.textContent=`現在のスケール: ${$.value}%`;let a=document.createElement("div");a.style.zIndex="1000",a.style.color="white",a.style.backgroundColor="rgba(0, 0, 0, 0.5)",i.appendChild(a);let r=document.createElement("input");r.type="range",r.min="1",r.max="30",r.value="10",r.style.zIndex="1000",r.style.backgroundColor="rgba(0, 0, 0, 0.5)",i.appendChild(r),r.addEventListener("input",function(){a.textContent=`現在のペンサイズ: ${r.value}`}),a.textContent=`現在のペンサイズ: ${r.value}`;let s=document.createElement("div");s.style.zIndex="1000",s.style.color="white",s.style.backgroundColor="rgba(0, 0, 0, 0.5)",s.textContent="ステータス: 待機中",i.appendChild(s);let u=document.createElement("button");u.textContent="実行",u.disabled=!0,u.style.zIndex="1000",u.style.padding="5px 10px",i.appendChild(u);let p=!1,c;o.addEventListener("change",function(){o.files.length>0?u.disabled=!1:u.disabled=!0});let y=document.createElement("canvas"),h=y.getContext("2d"),x;u.addEventListener("click",function(){if(p)clearTimeout(c),s.textContent="ステータス: 中止",u.textContent="実行",p=!1;else{let e=o.files[0],t=new FileReader;t.onload=function(e){let t=new Image;t.onload=function(){let e=Math.min(320/t.width,320/t.height)*($.value/100);y.width=t.width*e,y.height=t.height*e,h.drawImage(t,0,0,y.width,y.height),function e(t){let n=parseInt(r.value,10),l=[],i=t.width,o=t.height,d=t.data,$=n/2,a=null,h=null,g=null;for(let f=0;f