Joonistamine

Joonistamine







Lipud








canvas#tahvel{ width: 40%; background-color: peachpuff; border: 1px solid black; } canvas#lipp{ border: 1px solid black; } function ring() { const tahvel = document.getElementById(“tahvel”); if (tahvel.getContext) { let t = tahvel.getContext(“2d”); t.beginPath(); t.arc(50, 50, 30, 0, 2 * Math.PI, true); t.strokeStyle = “grey”; t.stroke(); t.fillStyle = “red”; t.fill(); } } function ring2() { const tahvel = document.getElementById(“tahvel”); if (tahvel.getContext) { let t = tahvel.getContext(“2d”); t.beginPath(); t.arc(120, 50, 30, 0, 2 * Math.PI, true); t.strokeStyle = “black”; t.stroke(); t.fillStyle = “grey”; t.fill(); } } function kustuta() { const tahvel = document.getElementById(“tahvel”); if (tahvel.getContext) { let t = tahvel.getContext(“2d”); t.clearRect(0, 0, 400, 400); } } function ristkylik() { const tahvel = document.getElementById(“tahvel”); if (tahvel.getContext) { let t = tahvel.getContext(“2d”); t.fillStyle = “blue”; t.fillRect(35, 100, 100, 100); } } function joon() { const tahvel = document.getElementById(“tahvel”); if (tahvel.getContext) { let t = tahvel.getContext(“2d”); t.beginPath(); t.lineWidth = “7”; t.moveTo(50, 60); t.lineTo(100, 120); t.lineTo(200, 100); t.lineTo(50, 60); t.strokeStyle = “pink”; t.stroke(); } } function eesti() { const lipp = document.getElementById(“lipp”); if (lipp.getContext) { let l = lipp.getContext(“2d”); l.fillStyle = “blue”; l.fillRect(0, 0, 330, 70); l.fillStyle = “black”; l.fillRect(0, 70, 330, 140); l.fillStyle = “white”; l.fillRect(0, 140, 330, 210); } } function azerbadzan() { const lipp = document.getElementById(“lipp”); if (lipp.getContext) { let l = lipp.getContext(“2d”); l.fillStyle = “blue”; l.fillRect(0, 0, 330, 70); l.fillStyle = “red”; l.fillRect(0, 70, 330, 140); l.fillStyle = “green”; l.fillRect(0, 140, 330, 210); image=new Image(); image.src = “Hõiva.PNG”; l.drawImage(image, 120, 70); } } function germani() { const lipp = document.getElementById(“lipp”); if (lipp.getContext) { let l = lipp.getContext(“2d”); l.fillStyle = “black”; l.fillRect(0, 0, 330, 70); l.fillStyle = “red”; l.fillRect(0, 70, 330, 140); l.fillStyle = “orange”; l.fillRect(0, 140, 330, 210); } } function tyrkih() { const lipp = document.getElementById(“lipp”); if (lipp.getContext) { let l = lipp.getContext(“2d”); l.fillStyle = “red”; l.fillRect(0, 0, 330, 70); l.fillStyle = “red”; l.fillRect(0, 70, 330, 140); l.fillStyle = “red”; l.fillRect(0, 140, 330, 210); image=new Image(); image.src = “scale_1200.jpg”; l.drawImage(image, 120, 70); } } function vengria() { const lipp = document.getElementById(“lipp”); if (lipp.getContext) { let l = lipp.getContext(“2d”); l.fillStyle = “red”; l.fillRect(0, 0, 330, 70); l.fillStyle = “white”; l.fillRect(0, 70, 330, 140); l.fillStyle = “green”; l.fillRect(0, 140, 330, 210); } } function china() { const lipp = document.getElementById(“lipp”); if (lipp.getContext) { let l = lipp.getContext(“2d”); l.fillStyle = “red”; l.fillRect(0, 0, 330, 70); l.fillStyle = “red”; l.fillRect(0, 70, 330, 140); l.fillStyle = “red”; l.fillRect(0, 140, 330, 210); image=new Image(); image.src = “Hõivaa.PNG”; l.drawImage(image, 120, 70); } } function kustuta2() { const lipp = document.getElementById(“lipp”); if (lipp.getContext) { let l = lipp.getContext(“2d”); l.clearRect(0, 0, 400, 400); } }