とちゃき
05/08/2019 (Wed) 11:09:28
[Preview]
No.148507
del
javascript:(function(){var D=document,SA='setAttribute',CE='createElement',CT='createTextNode',I='appendChild',s='style',w='width',h='height',Z=[135,200,270,344,400],zx,zy,S=g('oejs'),ct=S.getContext('2d');function b(v,q){var e=D[CE]('input'),Q='addEventListener';e[SA]('type','button');e[SA]('value',v);e[Q]?e[Q]('click',q,!1):e.onclick=q;return e}function g(n){return D.getElementById(n)}function ig(){var P=ct.getImageData(0,0,S[w],S[h]);return P}function ip(P,x,y){ct.fillStyle='#F0E0D6';ct.fillRect(0,0,S[w],S[h]);ct.putImageData(P,x,y);}function wS(x,y){var X=g('ftxa')[s],T=g('oe3')[s],St=g('oest1')[s],ox=S[w],oy=S[h],zm=1,P=ig();if(S[s].transform.match(/scale\(([0-9]+)\)/))zm=Number(RegExp.$1);X[w]=T[w]=(x*zm+46)+'px';St[w]=x*zm+'px';X[h]=T[h]=y*zm+'px';S[w]=x;S[h]=y;ip(P,(x-ox)/2,(y-oy)/2);}function scr(x,y){var P=ig();ip(P,x,y);}for(zx=0;zx<4;zx++){if(S[w]<=Z[zx])break;}for(zy=0;zy<4;zy++){if(S[h]<=Z[zy])break;}var TOP=D.getElementsByTagName('body')[0],PAL=D.getElementsByClassName('pal'),M=D[CE]('div'),N=D[CE]('div');M[SA]('style','position:relative;height:50px;');M[SA]('class','pal edit');N[SA]('style','position:fixed;background-color:#888888;z-index:999;');if(PAL.length){PAL[PAL.length-1].parentNode.insertBefore(M,PAL[PAL.length-1].nextSibling);}else{TOP.insertBefore(M,TOP.firstChild);}M[I](N);N[I](b('縦+',function(){zy=zy+(zy<4?1:0);wS(Z[zx],Z[zy]);}));N[I](b('縦-',function(){zy=zy-(zy>0?1:0);wS(Z[zx],Z[zy]);}));N[I](b('横+',function(){zx=zx+(zx<4?1:0);wS(Z[zx],Z[zy]);}));N[I](b('横-',function(){zx=zx-(zx>0?1:0);wS(Z[zx],Z[zy]);}));N[I](D[CT]('\u00a0'));N[I](b('上',function(){scr(0,-1);}));N[I](b('下',function(){scr(0,1);}));N[I](b('左',function(){scr(-1,0);}));N[I](b('右',function(){scr(1,0);}));N[I](D[CT]('\u00a0'));N[I](b('上下反転',function(){var P=ig();for(i=0,j=S[h]-1;i<S[h];i++,j--){ct.putImageData(P,0,i-j,0,j,S[w],1);}}));N[I](b('左右反転',function(){var P=ig();for(i=0,j=S[w]-1;i<S[w];i++,j--){ct.putImageData(P,i-j,0,j,0,1,S[h]);}}));N[I](D[CE]('div'));N[I](b('CLOSE',function(){M.parentNode.removeChild(M);}));})();