Skip to content

Instantly share code, notes, and snippets.

View nextechu's full-sized avatar

Bruce Kyle nextechu

View GitHub Profile
$(document).ready(function () {
//Code here
});
context.save();
// rotate the context to draw at an angle
// the rotation is in radians
var degrees = 55;
context.rotate(degrees * 0.01745);
context.fillText("Main St", 150, -165);
// restore the context
context.beginPath();
context.lineWidth = 10;
context.fillStyle = "blue";
context.arc(305, 135, 10, 0, 360);
context.fill();
context.stroke();
context.closePath();
context.fillRect(25,25,100,100);
context.clearRect(45,45,60,60);
context.strokeRect(50,50,50,50);
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Example document</title>
</head>
<body>
<p>Example paragraph</p>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Example document</title>
</head>
<body>
<p>Example paragraph</p>
</body>
</html>
<!doctype html>
<title>SVG in text/html</title>
<p>
A green circle:
<svg> <circle r="50" cx="50" cy="50" fill="green"/> </svg>
</p>
<figure>
<video src="example.webm" controls></video>
<figcaption>Example</figcaption>
</figure>
<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function() {
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
// Write on the canvas here
context.moveTo(100, 150);
<body>
<canvas id="myCanvas" width="578" height="200"></canvas>
</body>