Skip to content
html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    html, 
    body {
      width: 100vw;
      height: 100vh;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
    }
  </style>
</head>
<body>
  <canvas id="canvas"></canvas>
  <img src="./imgs/shadow-api.png" alt="">

  <script>
    const canvas = document.querySelector('#canvas')
    const context = canvas.getContext('2d')
    const img = new Image()

    canvas.style.background = '#ddd'

    context.shadowColor = 'rgba(0, 0, 0, .7)'
    context.shadowOffsetX = 4
    context.shadowOffsetY = 4
    context.shadowBlur = 5

    context.fillStyle = 'green'
    context.fillRect(10, 10, 100, 100)
  </script>
</body>
</html>