// ==UserScript==
// @name Komica poi171120
// @name:zh 汲汲營營大報社 畫布
// @namespace https://greasyfork.org/zh-TW/scripts/35430-komica-poi171120
// @description metadata description
// @description:zh 今年一定島 畫布
// @author 稻米
// @include http://*.komica2.net/00/*
// @include https://*.komica2.net/00/*
// @include http://*.komica2.net/*/pixmicat.php?res=*
// @include https://*.komica2.net/*/pixmicat.php?res=*
// @version 2017.11.21.2100.build16299
// @grant none
// @downloadURL none
// ==/UserScript==
//jquery
try{
$(document).ready(function() {
//console.log( 'jquery ready' );
//全域變數//global
time = new Date();
gg=[];
FFF='';
//
poi();
});
//throw "is empty";
}
catch(err){
console.log( ''+err.message );
}
finally {
//console.log( 'jquert測試' );//try-catch-finally
}
function poi(){
//FFF=$(".id").html();
//console.log( ''+FFF );
//console.log( $("#web-ad").attr('id') );
$("#web-ad").attr('id','poi171120_1');
$("#web-ad").attr('id','poi171120_2');
$("#web-ad").attr('id','poi171120_3');
//console.log( $("#new_id").attr('id') );
$("#poi171120_1").html('html');
$("#poi171120_2").html('html');
$("#poi171120_3").html('html');
//
$("#poi171120_3").css({
"border":"1px solid #000",
});//連結上背景色 不想上色就把這段刪除
// "background-color":"yellow",
//
ppp();
//
}//function poi(){
function ppp(){
$("#poi171120_3").html('
tabindex
');// href="#poi171117_a"
$("#poi171117_base").css({
"background-color":"yellow",
"border":"1px solid #000",
"width":400,
"height":300,
"display":"block",
"overflow":"hidden",
"position":"relative",
});//連結上背景色 不想上色就把這段刪除
$("#poi171117_base").append('span');
$("#poi171117_span").css({
"background-color":"green",
"border":"1px solid #000",
"width":100,
"height":100,
"display":"inline-block",
"position":"absolute",
"top":"0px",
"left":"-50px",
});//連結上背景色 不想上色就把這段刪除
$("#poi171117_base").append('span');
$("#poi171117_span_01").css({
"background-color":"#ddd",
"border":"1px solid #000",
"width":100,
"height":100,
"display":"inline-block",
"position":"absolute",
"top":"100px",
"left":"100px",
});//連結上背景色 不想上色就把這段刪除
var xx,yy;
//xx=document.getElementById("poi171120_3");
xx=$("#poi171120_3").css('width');
yy=$("#poi171120_3").css('height');
FFF=xx+'_'+yy;
console.log( FFF );
FFF=xx+'_'+yy;
$("#poi171117_span_01").html(''+FFF);
//取得焦點時的反應
$("#poi171117_base").focus(function() { //focusin
//$( this ).blur();
console.log( 'focus' );
xx=$("#poi171120_3").css('width');
yy=$("#poi171120_3").css('height');
FFF=xx+'_'+yy;
$("#poi171117_span_01").html(''+FFF);
$("#poi171117_span_01").css({
"background-color":"green",
});//連結上背景色 不想上色就把這段刪除
});
//失去焦點時的反應
$("#poi171117_base").blur(function() { //
console.log( 'blur' );
$("#poi171117_span_01").css({
"background-color":"#FFF",
});//連結上背景色 不想上色就把這段刪除
});
//FFF=document.getElementById("poi171117_a");
//console.log( FFF );
//
//
}
function ppp_old(){
var newCanvas = $('',{'id':'poi171120_canvas','Width':100,'Height':200});
$("#poi171120_2").html('');
$('#poi171120_2').append(newCanvas);
var c=document.getElementById("poi171120_canvas");
c.width = 400;
c.height = 400;
var ctx=c.getContext("2d");
//console.log(c.width);
ctx.beginPath();
ctx.moveTo(20,20);
ctx.lineTo(20,100);
ctx.lineTo(70,100);
ctx.closePath();
ctx.stroke();
ctx.fillStyle="green";
ctx.fill();
var gradient=ctx.createLinearGradient(0,0,400,0);
gradient.addColorStop("0","magenta");
gradient.addColorStop("0.5","blue");
gradient.addColorStop("1.0","red");
//ctx.strokeStyle="#0000ff";
ctx.strokeStyle=gradient;
gg[0]=0;
gg[1]=0;
gg[10]=0;
var xx,yy;
var timer = setInterval(function() {
gg[0]=gg[0]+1;
if(gg[0] > c.width){
gg[0]=gg[0]-c.width;
}
xx=gg[0];
//
gg[1]=gg[1]+1;
gg[10]=(c.height/2)+(c.height/2)*Math.sin( gg[1] *(Math.PI / 180) );
yy=gg[10];
//
//console.log(gg[0]);
//console.log(xx+','+yy);
//
ctx.clearRect(0, 0, c.width, c.height);
//
ctx.beginPath();
ctx.moveTo(xx,yy);
ctx.lineTo(300,150);
ctx.moveTo(xx,yy);
ctx.lineTo(200,200);
ctx.lineWidth=10;
ctx.stroke();
}, 100);
}//ppp()