canvas when window is resized</span>
  <span class="kd">function</span> <span class="nx">resize</span><span class="p">()</span> <span class="p">{</span>
    <span class="nx">ctx</span><span class="p">.</span><span class="nx">canvas</span><span class="p">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">innerWidth</span><span class="p">;</span>
    <span class="nx">ctx</span><span class="p">.</span><span class="nx">canvas</sp