Wednesday, March 22, 2017

Assignment 5: ASCII

Chanel logo :)


<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function() {
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");

////////////////////////////////////// start below this line ˇˇˇˇˇˇˇˇˇˇ
//left C
var canvas = document.getElementById('myCanvas');
        var context = canvas.getContext('2d');
        var x = canvas.width / 1.8;
        var y = canvas.height / 1.27;
        var radius = 73;
        var startAngle = 1.2 * Math.PI;
        var endAngle = 2.82 * Math.PI;
        var counterClockwise = false;

        context.beginPath();
        context.arc(x, y, radius, startAngle, endAngle, counterClockwise);
      
        context.lineWidth = 27;
        // line color
        context.strokeStyle = "rgb(0,0,0)";
        context.lineCap= "flat";
        context.stroke();

//right C
var canvas = document.getElementById('myCanvas');
        var context = canvas.getContext('2d');
        var x = canvas.width / 1.52;
        var y = canvas.height / 1.27;
        var radius = 73;
        var startAngle = .20 * Math.PI;
        var endAngle = 1.8 * Math.PI;
        var counterClockwise = false;

        context.beginPath();
        context.arc(x, y, radius, startAngle, endAngle, counterClockwise);
      
        context.lineWidth = 27;
        // line color
        context.strokeStyle = "rgb(0,0,0)";
        context.lineCap= "flat";
        context.stroke();







////////////////////////////////////// end above this line ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ

};

</script>
</head>
<body>
<canvas id="myCanvas" width="800" height="600"></canvas>
</body>
</html>

No comments:

Post a Comment

Disqus Shortname

Comments system