Greasy Fork is available in English.

Komica poi171120

metadata description

2017/11/20時点のページです。最新版はこちら。

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
// ==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.20.1000.build16299
// @grant        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( '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');
    //console.log( $("#new_id").attr('id') );
    $("#poi171120_1").html('html');
    $("#poi171120_2").html('html');
    //
    $("#poi171120_2").css({
        "background-color":"yellow",
        "border":"1px solid #000",
        "width":400,
        "height":400,
        "padding":10,
    });//連結上背景色 不想上色就把這段刪除
    //
    var newCanvas = $('<canvas/>',{'id':'poi171120_canvas','Width':100,'Height':200});
    $("#poi171120_2").html('');
    $('#poi171120_2').append(newCanvas);
    ppp();
    //

}//function poi(){

function ppp(){
    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()