<commit_before><!-- ## Wall Drawing #16 (1969)

Bands of lines 12 inches (30 cm) wide, in three directions (vertical, horizontal, diagonal right) intersecting.

http://www.massmoca.org/lewitt/grid.php
-->
<html><head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
function line(ctx, x1, y1, x2, y2) {
  ctx.beginPath();
  ctx.moveTo(x1, y1);
  ctx.lineTo(x2, y2);
  ctx.stroke();
}

var linew = 3,
    n = 100;

function band(ctx, x1, x2) {
  line(ctx, x1, 0, x2, 0);
  for (var i=1; i < n; i++) {
    var y = i*linew;
    line(ctx, x1, y, x2, y);
    var ny = -i*linew;
    line(ctx, x1, ny, x2, ny);
  }
}

function draw(canvas) {
  var ctx = canvas.getContext("2d"),
      w = canvas.width,
      h = canvas.height,
      X = w/2,
      Y = h/2;

  // horizontal band
  ctx.save();
  ctx.translate(0, Y);
  band(ctx, 0, w);
  ctx.restore();

  // diagonal band
  ctx.save();
  ctx.translate(0, h);
  ctx.rotate(-Math.atan((h-Y)/X));
  band(ctx, 0, h*2);
  ctx.restore();

  // vertical band
  ctx.translate(X, 0);
  ctx.rotate(Math.PI/2);
  band(ctx, 0, h);
}

function resizeCanvas(canvas) {
  canvas.width = window.innerWidth;
  canvas.height = window.innerHeight;

  draw(canvas);
}

$(function() {
  var canvas = $("#wall")[0];

  window.addEventListener('resize', function() { resizeCanvas(canvas); }, false);

  resizeCanvas(canvas);
});
</script>
<style>
body { margin: 0; }
</style>
<html>
  <canvas id="wall" width=1000 height=1000></canvas>
</html>
<commit_msg>add click to re-center<commit_after><!-- ## Wall Drawing #16 (1969)

Bands of lines 12 inches (30 cm) wide, in three directions (vertical, horizontal, diagonal right) intersecting.

http://www.massmoca.org/lewitt/grid.php
-->
<html><head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
function line(ctx, x1, y1, x2, y2) {
  ctx.beginPath();
  ctx.moveTo(x1, y1);
  ctx.lineTo(x2, y2);
  ctx.stroke();
}

var linew = 3,
    n = 100;

function band(ctx, x1, x2) {
  line(ctx, x1, 0, x2, 0);
  for (var i=1; i < n; i++) {
    var y = i*linew;
    line(ctx, x1, y, x2, y);
    var ny = -i*linew;
    line(ctx, x1, ny, x2, ny);
  }
}

function draw(canvas, X, Y) {
  var ctx = canvas.getContext("2d"),
      w = canvas.width,
      h = canvas.height,
      X = X || w/2,
      Y = Y || h/2;

  ctx.clearRect(0,0,w,h);

  // horizontal band
  ctx.save();
  ctx.translate(0, Y);
  band(ctx, 0, w);
  ctx.restore();

  // diagonal band
  ctx.save();
  ctx.translate(0, h);
  ctx.rotate(-Math.atan((h-Y)/X));
  band(ctx, 0, h*2);
  ctx.restore();

  // vertical band
  ctx.save();
  ctx.translate(X, 0);
  ctx.rotate(Math.PI/2);
  band(ctx, 0, h);
  ctx.restore();
}

function resizeCanvas(canvas) {
  canvas.width = window.innerWidth;
  canvas.height = window.innerHeight;

  draw(canvas);
}

function click(canvas, evt) {
  console.log(evt);
  draw(canvas, evt.clientX, evt.clientY);
}

$(function() {
  var canvas = $("#wall")[0];

  window.addEventListener('resize', function() { resizeCanvas(canvas); }, false);

  $(window).click(function(e) { click(canvas, e); });

  resizeCanvas(canvas);
});
</script>
<style>
body { margin: 0; }
</style>
<html>
  <canvas id="wall" width=1000 height=1000></canvas>
</html>

{'fraction_non_alphanumeric': 0.20182648401826483, 'fraction_numerical': 0.035312024353120246, 'mean_word_length': 3.2786458333333335, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 29, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7099592', 'n_tokens_mistral': 1372, 'n_tokens_neox': 1301, 'n_words': 304}