A Pen by Naeem Shaikh

Thumbnail
This awesome code was written by naeemshaikh27, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright naeemshaikh27 ©
  • HTML
  • CSS
  • JavaScript
    <div><canvas id='can' width='400' height='400' >
  </canvas> </div> 

/*Downloaded from https://www.codeseek.co/naeemshaikh27/a-pen-by-naeem-shaikh-JELmjx */
    div{
  margin:auto;
  width:400px;
  margin-top:100px;
}


/*Downloaded from https://www.codeseek.co/naeemshaikh27/a-pen-by-naeem-shaikh-JELmjx */
    $(function(){
  var canvas = document.getElementById('can');
  var ctx = canvas.getContext('2d');
  // Cubic curves example
  ctx.fillStyle='#e31b23';
    ctx.beginPath();
    ctx.moveTo(75, 40);
    ctx.bezierCurveTo(75, 37, 70, 25, 50, 25);
    ctx.bezierCurveTo(20, 25, 20, 62.5, 20, 62.5);
    ctx.bezierCurveTo(20, 80, 40, 102, 75, 120);
    ctx.bezierCurveTo(110, 102, 130, 80, 130, 62.5);
    ctx.bezierCurveTo(130, 62.5, 130, 25, 100, 25);
    ctx.bezierCurveTo(85, 25, 75, 37, 75, 40);
    ctx.fill();
});

Comments