blob: d97055f89ee6085a60af8d851872b823aaf89d8a [file] [edit]
<html>
<body>
<canvas width="100" height="100" style="border: solid 1px gray"></canvas>
<script>
const shadowOffsetX = -20;
const iterations = 10;
const increment = 4;
const canvas = document.getElementsByTagName('canvas')[0];
const width = canvas.width;
const ctx = canvas.getContext('2d');
ctx.shadowColor = "black";
ctx.shadowOffsetX = shadowOffsetX;
ctx.font = "10px monospace";
ctx.fillStyle = "blue";
for (let i = 0; i < iterations; ++i) {
const x = width + (i - iterations / 2) * increment;
const y = i * 10;
ctx.fillText("Hi", x, y);
}
</script>
</body>
</html>