1.1. jquery 1 jquery jcanvas javascript jquery JavaScript jquery $() JavaScript JavaScript jquery Googlr Chrome Eddge(Enternet Explorer) Web Web jquer

Similar documents
( )$("canvas").drawarc({strokestyle:"red", x:100, y:100, radius:20, start:0, end:360); drawline(x1:, y1:,... xn:, yn:) drawline n 2 n 3 x1: y1: xn: yn

1.1. jquery 1 jquery jcanvas jquery javascript jquery JavaScript jquery $() JavaScript JavaScript jquery Googlr Chrome Eddge(Enternet Explorer) Web jq

1.1. jquery 1 jquery jcanvas jquery javascript jquery JavaScript jquery $() JavaScript JavaScript jquery Googlr Chrome Eddge(Enternet Explorer) Web jq

1.1. jquery 1 jquery jcanvas jquery JavaScript jquery 1. / jquery Googlr Chrome Eddge(Enternet Explorer) 2. jquery JavaScript HTML div JS jqu

I. 主なメソッド 1. jquery オブジェクトを返すメソッド (1) 図形描画 以下共通のプロパティ strokestyle: 線色,strokeWidth: 線幅 x?: 点の x 座標, y?: 点のy 座標 fillstyle: 色指定で両端結んで塗りつぶす 以上は必須 (fill/st

サンプル CSS web ページを開くと同時にピエロの玉乗りが動き出すアニメーションを作ってみましょう AnimeAuto の説明 HTML の記述 (AnimeAuto.html) ピエロの画像に pierrot という id を 玉の画像に ball という id を付けておきます <!DOCT

transform: translatex(x 方向の移動距離 ) transform: translatey(y 方向の移動距離 ) transform: translate(x 方向の移動距離, Y 方向の移動距離 ) transform: translate 関数は 移動する位置ではなく 移動

ch31.dvi

SVG資料第6回目(その3) SVGとHTMLの間でデータを交換する

</div> </div> </body> </html> CSS の記述 (3DCubeAnime1.css) #stage ステージのスタイルを指定します 背景色を黒色で指定します 画像に軽く遠近感を出すために perspective: 1000px; と指定し perspective-orig

MorphAndTextAnime の説明 HTML の記述 (MorphAndTextAnime.html) id 属性 stage の div 要素を作り その中に div 要素でボックスを記述します id 属性 div1 の div 要素を記述し 中につぎの記述をします id 属性 div2

07_経営論集2010 小松先生.indd

~/WWW-local/compIID (WWW IID ) $ mkdir WWW-local $ cd WWW-local $ mkdir compiid 3. Emacs index.html n (a) $ cd ~/WWW/compIID

untitled

掲示用ヒート表 第34回 藤沢市長杯 2017

untitled

サンプル CSS OutlineAnimation.html の説明 HTML の記述 (OutlineAnimation.html) id 属性 stage の div 要素を作り その中に div 要素でボックスを記述します id 属性 div1 の div 要素を記述し 中にテキストで Out

HTML HTML HTML

JavaScript の使い方

★結果★ 藤沢市長杯 掲示用ヒート表


9 Bootstrap Font Awesome 52 + gem 'bootstrap', '4.0.0.alpha6' 53 + gem 'tether-rails' Gem bootstrap tether-rails Bootstrap JavaScript Tether Ctrl-C Ra

(1) <html>,,,,, <> ( ) (/ ) (2) <!DOCTYPE html> HTML5 (3) <html> HTML (4) <html lang= ja > html (ja) (5) JavaScript CSS (6) <meta charset= shift jis >



xy n n n- n n n n n xn n n nn n O n n n n n n n n

2 PostScript PostScript (token) 437 == 437 == PostScript PostScript 437 == PostScript (operator) 437 == == ==

コンピュータグラフィックス - 第4回 色彩の表現

Title.PDF

JavaScript 1.! DOM Ajax Shelley Powers,, JavaScript David Flanagan, JavaScript 2

Microsoft Word - JavaScript基礎講座Web Speech API.docx

A.1 canvas 要 素 canvas 要 素 について 隅 々まで 知 るためにはW3Cの 仕 様 書 ( the-canvas-element.htmlを 参 照 していただきたい 表 A-1と 表 A-2 には canvas 要 素 の

( 注 )Safari (webkit 系ブラウザ ) と Chrome(webkit にも対応 ) は テキストの輪郭や色を -webkit-text-stroke-width -webkit-text-stroke-color -webkit-text-fill-color のプロパティで描くこ

6 Tgif William Chia-Wei Chang tgif 3.0 pixmap URL Tgif 6.1: Tgif

スタイルシートでデザインを整えよう

JavaScript演習

G-XML

JavaScript 演習 2 1

16 (2) 23 - <div class="col-12 col-md-4"> </div> 23 + <div class="col-12 col-md-4 bg-info text-white text-md-right"> </div> HTML bg-info #17

e10s におけるプロセス間通信の基本 219 HACK #34 Components.manager.removeBootstrappedManifestLocati on() function shutdown(adata, areason) { const IOService =

PowerPoint Presentation

_勉強会_丸山さつき_v3

インターネットマガジン1997年12月号―INTERNET magazine No.35

インターネットマガジン1999年11月号―INTERNET magazine No.58

gnuplot.dvi

3 3.1 SSedit ua012345% ssedit SuperSQL config.ssql log.txt( logs.txt) SSedit SSedit 3.2 ssql Putty SSedit ua012345% ssql HTML /public html/ssql.ssql 4

Kageyama (Kobe Univ.) / 41

ProVisionaire Control V3.0セットアップガイド

cards.gif from Tkinter import * root = Tk() c0 = Canvas(root, width = 400, height = 300) c0.pack() image_data = PhotoImage(file = c1.gif ) c0.create_i

r3.dvi

Windows (L): D:\jyugyou\ D:\jyugyou\ D:\jyugyou\ (N): en2 OK 2

背景の線形グラデーションをアニメーションのように見せる方法は 前章の #div4 ボックスと同じ方法です ( 注 )Safari (webkit 系ブラウザ ) と Chrome(Webkit にも対応 ) は テキストの輪郭や色を -webkit-text-stroke-width -webkit

LeafletとCesiumを切り替えて使用するライブラリS-mapの公開

<!DOCTYPE html> <html> <head> <title>titleanime01</title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="titleanime01.css"> </hea

1. はじめにこのドキュメントは IBMi 上のデータを HTML のテーブルで表示するためのカスタマイズ方法について説明するものです この手法を用いることで スムーズなスクロールによる照会画面 (HTML のテーブル ) を 5250 画面に挿 することが出来ます ( 下図参照 ) なお このドキ

1 シミュレーションとは何か?


Taro13-第6章(まとめ).PDF

Transcription:

1

1.1. jquery 1 jquery jcanvas javascript jquery JavaScript jquery $() JavaScript JavaScript jquery Googlr Chrome Eddge(Enternet Explorer) Web Web jquery jcanvas jquery jcanvas 1.2. jcanvas HTML5 Canvas HTML5 HTML4 HTML5 Canvas jcanvas Canvas HTML JavaScript Web HTML Canvas JavaScript API( ) ( ) ( ) Canvas JavaScript jcanvas HTML5Canvas jquery Canvas API 2

jcanvas (Canvas ) jcanvas jcanvas var context = $("#canvas")[0].getcontext("2d");// 1. context.fillstyle="red";// context.strokestyle="black";// context.linewidth=2;// 2px context.arc(240, 120, 50, 0, 2 * Math.PI, true);// context.fill();// context.stroke();// 2. context.fillstyle="blue";// context.font="24px Arial";// context.textalign = "center";// context.textbaseline = "middle";// ( ) context.filltext("canvas ", 240, 280);// jcanvas $("#canvas").drawarc({ // 1. fillstyle: "red", // strokestyle: "black", // strokewidth: 2, // 2px x: 240, // x 240px y: 120, // y 120px radius: 50 // 50px }). drawtext({ // 2. fillstyle: "blue", // fontsize: 24, // 24px fontfamily: "Arial", // Arial x: 240, // x 240px y: 280, // y 120px text: "Canvas " // }); jcanvas jcanvas 3

jcanvas $("canvas")[0].width = $(window).width(); $("canvas")[0].height = $(window).height(); strokestyle: fillstyle: strokewidth: x: x y: y fillstyle strokestyle 1.3. jcanvas 1. drawarc(x:, y, radius:, start:, end:) drawarc : : radius start: end: ( )$("canvas").drawarc({strokestyle:"red", x:100, y:100, radius:20, start:0, end:360}); drawline(x1:, y1:,... xn:, yn:) drawline n 2 n 3 x1: y1: xn: yn: rounded:ture strokedash:[ ] startarrow:, endallow: ture arrowangle:, arrowradius: ( )$("canvas").drawline({strokestyle: blue, endarrow:true, arrowradius:20, x1:10, y1:20, x2:50, y2:100, x3:70, y3:40}); drawrect(x:, y:, width:, height:) drawrect x: y: width: height: cornerradius: ( )$("canvas").drawrect({fillstyle: red, x:300, y:140, width:300, height:150}); drawpolygon(x:, y:, radius:, sides:, (rotate:)) drawpolygon x: y: radius: sides: rotate: concavity: ( )$("canvas").obj.drawpolygon({fillstyle: green, x:50, y:100, radius:30, sides:3, concavity:0.5}); drawtext(x:, y:, fontstyle:, fontsize:, text: ) drawtext fontstyle: fontsize: text: align center, left, right start x,y end x,y baseline middle, top, hanging, alphabetic, ideographic, bottom fliparctext: true fontfamily: 4

( )$("canvas").drawtext({strokestyle: blue, strokewidth:1, x:150, y:30, fontsize:20, text: }); drawimage(source:, x:, y:) drawimage source: : : HTML width: height: scale: swidth: sheight: sx: sy: cropfromcenter: ( )$( canvas ).drawimage({source: images/fish.jpg, x: 150, y: 150}); drawquadratic(x1:, y1:, cx1:, cy1:, x2:, y2:) drawquadratic 2 x1: y1: 2 cx1: cy1: 2 x2: y2: 2 ( )$("canvas").drawquadratic}({strokestyle: black, x1:70, y1:150, cx1:200, cy1:20, x2:350, y2:100}) drawbezier(x1:, y1:, cx1:,cy1:, cx2:, cy2:, x2:, y2:, cx3:, cy3:, cx4:, cy4:, x3:, y3:[,...]) drawbezie x1: y1: x2: y2: x3: y3: cx1: xy1: cx2: cy2: cx3: cy3: cx4: cy4: ( )$("canvas").drawbezier({strokestyle: black, x1:10, y1:10, cx1:30,cy1:30, cx2:70, cy2:70, x2:120, y2:120, cx3:140, cy3:140, cx4:180, cy4:180, x3:210, y3:210}) drawellipse(x:, y:, width:, height:) drawellipse x: y: width: height: ( )$("canvas").drawellipse({fillstyle: red x:150, y:100, width:200, height:100}); drawslice(x:, y:, radius:, start:, end:) drawslice x: y: radius: start: end spread:(0 1) ( )$("canvas").drawslice({fillstyle:blue, start:60, end:120, x:100, y:100, radius:150, spread:1/40}); drawpath(p1:type:,( ),p2:type:,,...) drawpath type line vector quadratic arc ( )$("canvas").drawpath({strokestyle: #000,strokeWidth: 4, p1: {type: line, x1:200, y1:50,x2:100, y2:150,x3:200, y3:150,x4:120, y4:200}, p2: {type: quadratic, cx1:175, cy1:250,x2:225, y2:200}}); 5

2. Layer drawlayers ( ) drawlayers 0 addlayer (type:, width:, height: ) type: addlayertogroup (, ) animatelayer(, [, ] [, ] [, ] ) linear swing liner swing animatelayergroup( ) delaylayer( ) delaylayergroup( ) movelayer(, ) removelayer( ) removelayerfromgroup( ) removelayergroup( ) removelayers( ) setlayer( ) setlayergroup( ) setlayers( ) getlayer( ) getlayergroup( ) getlayerindex( ) getlayers( ) 6

stoplayer( ) stoplayergroup( ) seteventhooks(add:function(layer) ) click dblclick mousedown mouseup mousemove mouseover canvas mouseout canvas dragstart drag dragstop dragcancel canvas ( )dragstart, drag, dragstop, dblclick $("canvas").drawarc({ layer: true,draggable: true,bringtofront: true,fillstyle: "green", x: 150, y: 150,radius: 50, dragstart: function() {layer.fillstyle="blue"}, drag: function(layer) {layer.fillstyle="red"}, dragstop: function(layer) {layer.fillstyle="yellow"}, dblclick:function(layer){layer.fillstyle="black"}}); 7

( ) $.jcanvas.defaults.layer = true; $("canvas").drawarc({ fillstyle: blue,x: 150, y: 150,radius: 50,draggable:true, name:"rei",drag:function(){$("canvas").removelayer("link");drawlink();}}); function drawlink(){ var ai = obj.getlayer("rei"); $("canvas").drawrect({ fillstyle: red, x:ai.x+100, y:ai.y+100, width: 100, height: 100,draggable: false,name:"link"});} drawlink(); ( ) $.jcanvas.defaults.layer = true; obj.drawline({ strokestyle: "black", strokewidth: 1, x1:10, y1:200, x2:200, y2:30, x3:390, y3:200, draggable: false, name: "link" }); obj.drawarc({ fillstyle: "blue", radius:6, x:200, y:30, draggable:true, name:"vertex", drag:function(layer){ var sen=obj.getlayer("link"); sen.x2=layer.x; sen.y2=layer.y; }}); 3. clearcanvas() rotatecanvas(x:, y:, rotate: ) x: y: rotate: scalecanvas(x:, y:, scalex:, scaley: ) x: y: scalex: scaley: scalecanvas(scale:2).drawrect translatecanvas(translate:) translate: translatey: detectpixelratio(function(ratio)ratio ) restorecanvas( ) getcanvasimage ( ) Base64 PNG, jpg JPEG setpixels( ) 4. creategradient( ) 8

createpattern( ) getcanvasimage( ) Base64 geteventhooks( ) measuretext( ) jcanvas.extend( ) 5. shadowblur: 0 100 0 100 shadowcolor: shadowstroke: shadowx:, shadowy: x y scalex:, scaley: x y canvas opacity: 0 1 0 1 bringtofront: ture false restrictdragtoaxis: x y null disableevents: ture false intangible: ture false visible: ture false autsave: ture false 9

crossorigin: drawimage canvas, anonymous, use-credentials draggroups: indegrees: true false intangible: true false maxwidth: drawtext r1:,r2: null r1 r2 respectalign: drawtext true x y false x y translatex:,translatey: translatex translatey strokejoin: miter bevel round miterlimit: miter imagesmoothing: ture false compositing: source-over, source-in, source-out, source-atop, lighter, destination-over, destination-in, destination-out, destination-atop, copy, xor, mask: ture ccw: ture false intersects: ture false 10

2 1 2.1. 2020 Web IT NPO Code.org 2020 40 NPO Code.org Infocomm Development Authority of Singapore(IDA) 2016 IT 1 IT 2020 36.9 2030 78.9 IT TechAcademy 81.5 38.4 31.1 86.8 IT NPO CANVAS 11

2.2.,, Web IT 4 1 1 2 2-40 40 0 12

1: 2: 3,4 3,4 3: 4: 5,6 5,6 PC 180 5: 6: 13

2.3. (20 ) (25 ) (5 ) CPU CPU CPU CPU CPU 14

2.4. 7: 8: 9: 10: 11: CPU 5 2.4.1. ( 7) obj.drawimage({ draggable: true, source: dengen.jpg, x:50, y:70, width: 100, height: 100, fromcenter: false, rotate:180, dblclick:function(layer){ layer.width=400*yoko/1680; layer.height=150*yoko/1680; obj.drawtext({ strokestyle:"black", fillstyle:"black", strokewidth:1, 15

x:210,y:20, fontsize:30, text:"", name:"setsumei4"});}, dragstart:function(layer){omx=layer.eventx;omy=layer.eventy;}, drag:function(layer) {kaki(layer);}, dragstop:function(layer){ if(-40<=layer.rotate && layer.rotate<=40){ layer.rotate=0;}; if(yoko*50/1680<=layer.y<yoko*781/1680 && yoko*476/1680<=layer.x<=yoko*1245/1680){ //pc if(yoko*595/1680<=layer.y<yoko*748/1680 && yoko*511/1680<=layer.x<=yoko*911/1680){ // if(-10<=layer.rotate%360 && layer.rotate%360<=10){ if(layer.width==400*yoko/1680 && layer.height==150*yoko/1680){ // den();} } if(layer.rotate%180){ dg();} else{ obj.removelayer("eo");} } }}}); function den(){ sweetalert(" "); }; function dg(){ sweetalert(" "); }; :450, :150 if -40 40 0 PC 180 " " " " 16

2.4.2. ( 8) obj.drawimage({ draggable: true, source: hd.jpg, x:10, y:400, width: 150, height:150, fromcenter: false, rotate:180, dblclick:function(layer){ layer.width=170*yoko/1680; layer.height=50*yoko/1680; obj.drawtext({ strokestyle:"black", fillstyle:"black", strokewidth:1, x:240,y:500, fontsize:30, text:"hdd ", name:"setsumei5"});}, dragstart:function(layer){omx=layer.eventx;omy=layer.eventy;}, drag:function(layer) {kaki(layer);}, dragstop:function(layer){ if(-40<=layer.rotate && layer.rotate<=40){ layer.rotate=0;}; if(yoko/2 && tate/2){ //pc if(yoko*1059/1680&&tate*554/873){ //HDD if(-10<=layer.rotate%360 && layer.rotate%360<=10){ if(layer.width==170*yoko/1680 && layer.height==50*yoko/1680){ haad();} } if(layer.rotate%180){ dk();} // else{ obj.removelayer("eo");} 17

} }}}); function haad(){ sweetalert("hdd "); }; function dk(){ sweetalert("hdd "); }; :200, :40 if -40 40 0 PC HD 180 "HDD " "HDD " 2.4.3. ( 9) obj.drawimage({ draggable: true, source: memori01.jpg, x:1100, y:350, width: 70, height: 330, fromcenter: false, rotate:180, dblclick:function(layer){ layer.width=20*yoko/1680; layer.height=300*yoko/1680; obj.drawtext({ strokestyle:"black", fillstyle:"black", strokewidth:1, x:1500,y:500, fontsize:30, text:" ", name:"setsumei1"});}, 18

dragstart:function(layer){omx=layer.eventx;omy=layer.eventy;}, drag:function(layer) {kaki(layer);}, dragstop:function(layer){ if(-40<=layer.rotate && layer.rotate<=40){ layer.rotate=0;}; if(yoko/2 && tate/2){ //pc if(yoko*817/1680&&tate*280/873){ // if(-10<=layer.rotate%360 && layer.rotate%360<=10){ if(layer.width==20*yoko/1680 && layer.height==300*yoko/1680){ aiu();} } if(layer.rotate%180){ mm();} // else{ obj.removelayer("eo");} } }}}); function aiu(){ sweetalert(" "); }; function mm(){ sweetalert(" "); }; :20, :330 if -40 40 0 PC 180 " " " " 2.4.4. ( 10) obj.drawimage({ draggable: true, source: videocard.png, x:1100, y:50, 19

width: 500, height:140, fromcenter: false, rotate:180, dblclick:function(layer){ layer.width=200*yoko/1680; layer.height=20*yoko/1680; obj.drawtext({ strokestyle:"black", fillstyle:"black", strokewidth:1, x:1470,y:150, fontsize:30, text:" ", name:"setsumei2"});}, dragstart:function(layer){omx=layer.eventx;omy=layer.eventy;}, drag:function(layer) {kaki(layer);}, dragstop:function(layer){ if(-40<=layer.rotate && layer.rotate<=40){ layer.rotate=0;}; if(yoko/2 && tate/2){ //pc if(yoko*691/1680&&tate*434/873){ // if(-10<=layer.rotate%360 && layer.rotate%360<=10){ if(layer.width==200*yoko/1680 && layer.height==20*yoko/1680){ aii();} } if(layer.rotate%180){ vc();} // else{ obj.removelayer("iueo");} } }}}); function aii(){ 20

sweetalert(" "); }; function vc(){ sweetalert(" "); }; :200, :20 if -40 40 0 PC 180 " " " " 2.4.5. CPU( 11) obj.drawimage({ draggable: true, source: cpu01.jpg, x:1100, y:230, width:100*yoko/1680, height:110*yoko/1680, fromcenter: false, rotate:180, name:"kakudo", dblclick:function(layer){ obj.drawtext({ strokestyle:"black", fillstyle:"black", strokewidth:1, x:1550,y:260, fontsize:30, text:"cpu ", name:"setsumei3"});}, dragstart:function(layer){omx=layer.eventx;omy=layer.eventy;obj.removelayer("setsumei");}, drag: function(layer) {kaki(layer);}, dragstop:function(layer){ 21

if(-40<=layer.rotate && layer.rotate<=40){ layer.rotate=0;}; if(yoko/2 && tate/2){ //pc if(100*yoko/168&&110*yoko/168){ //cpu if(-10<=layer.rotate%360 && layer.rotate%360<=10){ ai();} if(layer.rotate%180){ cp();} } else{ obj.removelayer("ueo");} } }}); CPU if -40 40 0 PC CPU 180 "CPU " "CPU " 2.5. 2020 22

[1] :,,,. [2] :,,. 23