{
 "blyg": "0.4",
 "id": "2he4abvcd10y43w9ey6pe1wdgf",
 "kind": "thread",
 "origin": "https://notionparallax.co.uk/",
 "page": "https://notionparallax.co.uk/2016/east-van-and-friends",
 "author": {
  "name": "Ben Doherty",
  "url": "https://notionparallax.co.uk/"
 },
 "created": "2016-06-12T02:00:00Z",
 "updated": "2016-06-12T02:00:00Z",
 "version": 1,
 "content_md": "# East Van and friends\n\n\n<style type=\"text/css\">\n    .definition{\n      border-bottom: 2px solid;\n      display: inline-block;\n      width: 25%;\n    }\n    .cross-frame {\n      background-color: black;\n      display: inline-block;\n      height: 20em;\n      text-align: center;\n      vertical-align: top;\n      width: 33%;\n    }\n    label {\n      margin-top: 1em;\n      display: inline-block;\n    }\n    #diy-cross-box {\n      background-color: black;\n      display: inline-block;\n      height: 30em;\n      margin-bottom: 2em;\n      padding-top: 1em;\n      text-align: center;\n      width: 50%;\n    }\n    #diy-cross-box .cross-frame {width: 70%;}\n    #cb-manual {\n      display: inline;\n      width: 2em;\n    }\n    .diy-input-box {\n      display: inline-block;\n      padding-left: 1em;\n      vertical-align: top;\n      width: 48%;\n    }\n</style>\n\n<div class=\"diy-box\">\n<div id=\"diy-cross-box\"></div>\n<div class=\"diy-input-box\">\n\n## DIY\n\nIf you want to make your own, go right ahead. It'll find you a matching word for whatever you put in.\n\n<label for=\"across\">Across<input type=\"\" name=\"across\"></label>\n<label for=\"down\">Down<input type=\"\" name=\"down\"></label>\n\n<!-- <label><input type=\"checkbox\" id=\"cb-basic\"  value=\"basic\" > Basic</label><br> -->\n\n<label for=\"cb-manual\">Full manual<input type=\"checkbox\" id=\"cb-manual\" value=\"manual\"></label>\n\nTick this if you want to be able to write in both boxes without it generating you the other word.\n\n</div>\n</div>\n\n<figure class=\"half-width right\">\n![A can of beer that says Craft Lager in the style of the east van sign](https://notionparallax.co.uk/assets/16/tinny.png)\n<figcaption>\nLooks like everyone's on the band wagon\n</figcaption>\n</figure>\n\nWe were having [ramen for lunch](https://drive.google.com/file/d/1xPCi3ebZ6V-9p6F4Z5M48Z_s5h_3eMnd3w/view?usp=sharing)[^1], and I saw a can of beer doing the [East Van sign](https://en.wikipedia.org/wiki/East_Van_Cross) thing. I started wondering how many other word pairs you could do that way.\n\nIt turns out that you can actually make a LOT of these things. I downloaded a word list and did a bit of magic processing. If you aren't interested in the how, and just want to look at the funny combinations of words then skip over all the words to follow and just look at the pictures! They are made live, so keep hitting refresh for a new set.\n\nOne thing that has struck me is how many of these words _seem_ to have a relationship. Making patterns is so baked into the brain!\n\nI downloaded a list of [English words](https://github.com/dwyl/english-words) that has over 350k words in it. It really shows because I have no idea what about half of these words mean. <strike>It'd be interesting to see what comes up if I used Basic English.</strike> **Edit:** _I actually did add the [Basic English](https://en.wikipedia.org/wiki/Basic_English) list; the crosses it pumps out are amazing!_ I then processed these words into two sets of bins; one for the horizontal words and one for the vertical words.\n\nHorizontal words need to have an odd number of letters and be more than three letters long. Vertical words just need to be more than 4 letters long. They are then 'binned' or grouped by the letter at the crossing. That's the middle letter for horizontal words and the second letter for vertical ones.\n\n[^1]: That's my sketches on a chopstick wrapper. I was also faffing about with the [ESPN penis](https://www.buzzfeed.com/mrloganrhoades/fan-made-penis-sign-shown-on-live-tv-to-nations-delight) thing too.\n\n## Basic English\n\n<div id=\"cross-box\"></div>\n<div id=\"definitions\"></div>\n\n## Hard English\n\nHere's some from the full list of english words:\n\n<div id=\"hard-cross-box\"></div>\n<div id=\"hard-definitions\"></div>\n\nThe [repo for this is here](https://github.com/notionparallax/east-van). Thanks to dwyl for the [english-words](https://github.com/dwyl/english-words).\n\n<figure>\n![The East Van Sign at night](https://notionparallax.co.uk/assets/16/east-van1.jpg)\n<figcaption>\nFrom [“…that’s gangster and now the whole world will see…”](https://matthewjvandeventer.wordpress.com/2010/01/)\n</figcaption>\n</figure>\n\n<script type=\"text/javascript\">\n// \"use strict\";\ndocument.addEventListener(\"DOMContentLoaded\", function (event) {\n\n  function triggerDIY(direction, input) {\n    var words, letter, complementWord, url;\n    input = input.trim();\n    if (input.length >= 3) { //&& input.length % 2 == 0 fuck it, lets be permissive\n      document.getElementById(\"diy-cross-box\").html = \"\";\n      if (direction == \"across\") {\n        words = window.simple_words.vwords; //move this out if perf is an issue\n        letter = input[Math.floor(input.length / 2)];\n      } else {\n        words = window.simple_words.hwords;\n        letter = input[1];\n      }\n      if (document.getElementById(\"cb-manual\").checked) {\n        if (direction == \"across\") {\n          complementWord = document.querySelector(\"input[name=down]\").value;\n        } else {\n          complementWord = document.querySelector('input[name=across]').value;\n        }\n      } else {\n        complementWord = getWord(words, letter, 9);\n      }\n\n      if (direction == \"across\") {\n        document.querySelector(\"input[name=down]\").value = complementWord;\n        addNewCross(input, complementWord, \"#diy-cross-box\");\n        url = `/2016/east-van-and-friends#diy?a=${input}&d=${complementWord}`;\n      } else {\n        document.querySelector('input[name=across]').value = complementWord;\n        addNewCross(complementWord, input, \"#diy-cross-box\");\n        url = `/2016/east-van-and-friends#diy?a=${complementWord}&d=${input}`;\n      }\n      console.log(url);\n      history.pushState({}, \"NP generator\", url);\n\n    }\n  }\n\n  function setDIY() {\n    //Setup\n    if (window.location.hash) {\n      var params = window.location.hash.split(\"?\")[1].split(\"&\");\n      var a = params[0].split(\"=\")[1]\n      var d = params[1].split(\"=\")[1]\n      document.querySelector('input[name=across]').value = a;\n      document.querySelector('input[name=down]').value = d;\n      addNewCross(a, d, \"#diy-cross-box\");\n    } else {\n      document.querySelector('input[name=across]').value = \"Van\";\n      document.querySelector('input[name=down]').value = \"East\";\n      addNewCross(\"van\", \"east\", \"#diy-cross-box\");\n    }\n    // action\n    document.querySelector('input[name=across]').addEventListener('input', function () {\n      triggerDIY(\"across\", this.value);\n    });\n    document.querySelector('input[name=down]').addEventListener('input', function () {\n      triggerDIY(\"down\", this.value);\n    });\n  }\n\n  async function addEverything(fileName, numberOfCrosses, hCharLimit, vCharLimit, defContainer, crossContainer) {\n    const App = {};\n\n    async function fetchJson(url) {\n      const response = await fetch(url);\n      if (!response.ok) {\n        throw new Error(`HTTP error! status: ${response.status}`);\n      }\n      return response.json();\n    }\n\n    App.hwords = await fetchJson(`/js/posts/east-van/h${fileName}.json`);\n    App.vwords = await fetchJson(`/js/posts/east-van/v${fileName}.json`);\n\n    const alphabet = \"abcdefghiklmnoprstuvwxy\"; //jqz removed because simple English doesn't have any words in those bins\n    for (let i = 0; i < numberOfCrosses; i++) {\n      const random_letter = alphabet[Math.floor(Math.random() * alphabet.length)];\n      const hword = getWord(App.hwords, random_letter, hCharLimit);\n      const vword = getWord(App.vwords, random_letter, vCharLimit);\n      console.log(random_letter, hword, vword);\n      addNewCross(hword, vword, crossContainer);\n      addDefinitions(hword, vword, defContainer);\n    }\n\n    window[fileName] = App;\n  }\n  addEverything(\"simple_words\", 11, 7, 8, \"#definitions\", \"#cross-box\");\n  addEverything(\"words\", 12, 7, 8, \"#hard-definitions\", \"#hard-cross-box\");\n\n  function getWord(words, letter, limit) {\n    var wordLength = 100;\n    var word = \"\";\n    while (wordLength > limit) {\n      try {\n        word = words[letter][Math.floor(Math.random() * words[letter].length)];\n        wordLength = word.length;\n      }\n      catch (e) {\n        console.log(e, word, letter);\n        break;\n      }\n    }\n    return word;\n  }\n\n  function addDefinitions(hword, vword, selector) {\n    // Create the list element\n    const definitionList = document.createElement('ol');\n    definitionList.className = 'definition';\n\n    // Create list items\n    const vwordItem = document.createElement('li');\n    const hwordItem = document.createElement('li');\n\n    // Create links\n    const vwordLink = document.createElement('a');\n    vwordLink.href = `http://www.thefreedictionary.com/${vword}`;\n    vwordLink.target = '_blank';\n    vwordLink.textContent = vword;\n\n    const hwordLink = document.createElement('a');\n    hwordLink.href = `http://www.thefreedictionary.com/${hword}`;\n    hwordLink.target = '_blank';\n    hwordLink.textContent = hword;\n\n    // Append links to list items\n    vwordItem.appendChild(vwordLink);\n    hwordItem.appendChild(hwordLink);\n\n    // Append list items to list\n    definitionList.appendChild(vwordItem);\n    definitionList.appendChild(hwordItem);\n\n    // Append the list to the container\n    document.querySelector(selector).appendChild(definitionList);\n  }\n\n  function addNewCross(h_test_word, v_test_word, container) {\n    h_test_word = h_test_word.toUpperCase();\n    v_test_word = v_test_word.toUpperCase();\n\n    var h_letters = h_test_word.length;\n    var v_letters = v_test_word.length;\n\n    var rad = 8;\n    var pad = 9;\n    var box = 50;\n\n    var vll = (0) + pad;\n    var vlm = (Math.floor(h_letters / 2) * box) + pad;\n    var vrm = (vlm + box) + pad;\n    var vrr = (h_letters * box) + pad;\n\n    var htt = (0) + pad;\n    var htm = (box) + pad;\n    var hlm = (box * 2) + pad;\n    var hll = (v_letters * box) + pad;\n\n    var v_nudge = 7;\n\n    var blur = 5;\n    var letter_pad = \"    \"; //blur stops at box boundary, this makes the box bigger\n    var blur_colour = \"hsla(180,70%,52%,1)\";\n\n    var svg_head = `<svg viewbox=\\\"0 0 ${vrr + (2 * pad)} ${hll + (2 * pad)}\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">`;\n    var svg_filter = `<filter id=\\\"blurMe\\\">\n                          <feGaussianBlur in=\\\"SourceGraphic\\\" \n                                          stdDeviation=\\\"${blur}\\\" \n                                          x=\"-50%\" \n                                          y=\"-50%\" \n                                          width=\"280%\" \n                                          height=\"280%\"/>\n                        </filter>`;\n    var svg_bg = `<rect x=\\\"0\\\" y=\\\"0\\\" width=\\\"${vrr + (2 * pad)}\\\" height=\\\"${hll + (2 * pad)}\\\" fill=\\\"black\\\" />`;\n\n    var path = `M${vll + rad} ${htm}` + //1       \n      `L ${vlm - rad} ${htm}` + //2\n      `A ${rad} ${rad}, 0, 0, 0, ${vlm} ${htm - rad}` + //3\n      `L ${vlm}  ${htt + rad}` + //4\n      `A ${rad} ${rad}, 0, 0, 1, ${vlm + rad} ${htt}` + //5\n      `L ${vrm - rad}  ${htt}` + //6\n      `A ${rad} ${rad}, 0, 0, 1, ${vrm} ${htt + rad}` + //7\n      `L ${vrm} ${htm - rad}` + //8\n      `A ${rad} ${rad}, 0, 0, 0, ${vrm + rad} ${htm}` + //9\n      `L ${vrr - rad} ${htm}` + //10\n      `A ${rad} ${rad}, 0, 0, 1, ${vrr} ${htm + rad}` + //11\n      `L ${vrr} ${hlm - rad}` + //12\n      `A ${rad} ${rad}, 0, 0, 1, ${vrr - rad} ${hlm}` + //13\n      `L ${vrm + rad} ${hlm}` + //14\n      `A ${rad} ${rad}, 0, 0, 0, ${vrm} ${hlm + rad}` + //15\n      `L ${vrm} ${hll - rad}` + //16\n      `A ${rad} ${rad}, 0, 0, 1, ${vrm - rad} ${hll}` + //17\n      `L ${vlm + rad} ${hll}` + //18\n      `A ${rad} ${rad}, 0, 0, 1, ${vlm} ${hll - rad}` + //19\n      `L ${vlm} ${hlm + rad}` + //20\n      `A ${rad} ${rad}, 0, 0, 0, ${vlm - rad} ${hlm}` + //21\n      `L ${vll + rad} ${hlm}` + //22\n      `A ${rad} ${rad}, 0, 0, 1,  ${vll} ${hlm - rad}` + //23\n      `L  ${vll} ${htm + rad}` + //24\n      `A ${rad} ${rad}, 0, 0, 1, ${vll + rad} ${htm}`;\n\n    var svg_path = `<path id=\\\"glow_path\\\" d=\\\"${path}\\\" stroke=\\\"${blur_colour}\\\" stroke-width=\\\"10\\\"` +\n      `fill=\\\"rgba(255, 255, 255, 0.55)\\\" opacity=\\\"0.6\\\" filter=\\\"url(#blurMe)\\\"></path>` +\n      `<path id=\\\"main_path\\\" d=\\\"${path}\\\" stroke=\\\"white\\\" ` +\n      `fill=\\\"none\\\" stroke-width=\\\"2\\\" fill-opacity=\\\"0.5\\\"></path>`;\n\n\n    var svg_text = \"\"\n    for (let index = 0, len = h_test_word.length; index < len; index++) {\n      var letter = h_test_word[index];\n      svg_text += `<text class=\\\"blur-text\\\"   text-anchor=\\\"middle\\\" x=\\\"${vll + index * box + (box / 2)}\\\" y=\\\"${hlm - v_nudge}\\\" font-size=\\\"${box}\\\" font-family=\\\"sans-serif\\\" fill=\\\"${blur_colour}\\\" filter=\\\"url(#blurMe)\\\">${letter_pad}${letter}${letter_pad}</text>`;\n      svg_text += `<text class=\\\"bright-text\\\" text-anchor=\\\"middle\\\" x=\\\"${vll + index * box + (box / 2)}\\\" y=\\\"${hlm - v_nudge}\\\" font-size=\\\"${box}\\\" font-family=\\\"sans-serif\\\" fill=\\\"white\\\">${letter_pad}${letter}${letter_pad}</text>`;\n    }\n\n    for (let index = 0, len = v_test_word.length; index < len; index++) {\n      var letter = v_test_word[index];\n      if (index !== 1) {\n        svg_text += `<text class=\\\"blur-text\\\"   text-anchor=\\\"middle\\\" x=\\\"${vlm + box / 2}\\\" y=\\\"${htt + (index * box) + box - v_nudge}\\\" font-size=\\\"${box}\\\" font-family=\\\"sans-serif\\\" fill=\\\"${blur_colour}\\\" filter=\\\"url(#blurMe)\\\">${letter_pad}${letter}${letter_pad}</text>`;\n        svg_text += `<text class=\\\"bright-text\\\" text-anchor=\\\"middle\\\" x=\\\"${vlm + box / 2}\\\" y=\\\"${htt + (index * box) + box - v_nudge}\\\" font-size=\\\"${box}\\\" font-family=\\\"sans-serif\\\" fill=\\\"white\\\">${letter_pad}${letter}${letter_pad}</text>`;\n      }\n    }\n\n    var svg = svg_head +\n      svg_filter +\n      svg_bg +\n      svg_path +\n      svg_text +\n      \"</svg>\"\n\n    // Clear the box\n    document.querySelector(container).innerHTML = \"\";\n    // Add the new SVG\n    document\n      .querySelector(container)\n      .appendChild(\n        new DOMParser()\n        .parseFromString(\n          \"<div class='cross-frame'>\" + svg + \"</div>\", \n          \"text/html\"\n          ).body.firstChild\n        );\n  }\n\n  setDIY();\n  addNewCross(\"craft\", \"lager\", \"#cross-box\");\n  addDefinitions(\"van\", \"east\", \"#definitions\");\n  addDefinitions(\"craft\", \"lager\", \"#definitions\");\n});\n</script>\n",
 "content_html": "<h1>East Van and friends</h1>\n<style type=\"text/css\">\n    .definition{\n      border-bottom: 2px solid;\n      display: inline-block;\n      width: 25%;\n    }\n    .cross-frame {\n      background-color: black;\n      display: inline-block;\n      height: 20em;\n      text-align: center;\n      vertical-align: top;\n      width: 33%;\n    }\n    label {\n      margin-top: 1em;\n      display: inline-block;\n    }\n    #diy-cross-box {\n      background-color: black;\n      display: inline-block;\n      height: 30em;\n      margin-bottom: 2em;\n      padding-top: 1em;\n      text-align: center;\n      width: 50%;\n    }\n    #diy-cross-box .cross-frame {width: 70%;}\n    #cb-manual {\n      display: inline;\n      width: 2em;\n    }\n    .diy-input-box {\n      display: inline-block;\n      padding-left: 1em;\n      vertical-align: top;\n      width: 48%;\n    }\n</style>\n\n<div class=\"diy-box\">\n  <div id=\"diy-cross-box\"></div>\n  <div class=\"diy-input-box\">\n\n    <h2 id=\"diy\">DIY</h2>\n\n    <p>If you want to make your own, go right ahead. It’ll find you a matching word for whatever you put in.</p>\n\n    <p><label for=\"across\">Across<input type=\"\" name=\"across\" /></label>\n<label for=\"down\">Down<input type=\"\" name=\"down\" /></label></p>\n\n    <!-- <label><input type=\"checkbox\" id=\"cb-basic\"  value=\"basic\" > Basic</label><br> -->\n\n    <p><label for=\"cb-manual\">Full manual<input type=\"checkbox\" id=\"cb-manual\" value=\"manual\" /></label></p>\n\n    <p>Tick this if you want to be able to write in both boxes without it generating you the other word.</p>\n\n  </div>\n</div>\n\n<figure class=\"half-width right\">\n  <p><img src=\"https://notionparallax.co.uk/assets/16/tinny.png\" alt=\"A can of beer that says Craft Lager in the style of the east van sign\" /></p>\n  <figcaption>\n    <p>Looks like everyone’s on the band wagon</p>\n  </figcaption>\n</figure>\n\n<p>We were having <a href=\"https://drive.google.com/file/d/1xPCi3ebZ6V-9p6F4Z5M48Z_s5h_3eMnd3w/view?usp=sharing\">ramen for lunch</a><sup id=\"fnref:1\" role=\"doc-noteref\"><a href=\"https://notionparallax.co.uk/2016/east-van-and-friends#fn:1\" class=\"footnote\" rel=\"footnote\">1</a></sup>, and I saw a can of beer doing the <a href=\"https://en.wikipedia.org/wiki/East_Van_Cross\">East Van sign</a> thing. I started wondering how many other word pairs you could do that way.</p>\n\n<p>It turns out that you can actually make a LOT of these things. I downloaded a word list and did a bit of magic processing. If you aren’t interested in the how, and just want to look at the funny combinations of words then skip over all the words to follow and just look at the pictures! They are made live, so keep hitting refresh for a new set.</p>\n\n<p>One thing that has struck me is how many of these words <em>seem</em> to have a relationship. Making patterns is so baked into the brain!</p>\n\n<p>I downloaded a list of <a href=\"https://github.com/dwyl/english-words\">English words</a> that has over 350k words in it. It really shows because I have no idea what about half of these words mean. <strike>It'd be interesting to see what comes up if I used Basic English.</strike> <strong>Edit:</strong> <em>I actually did add the <a href=\"https://en.wikipedia.org/wiki/Basic_English\">Basic English</a> list; the crosses it pumps out are amazing!</em> I then processed these words into two sets of bins; one for the horizontal words and one for the vertical words.</p>\n\n<p>Horizontal words need to have an odd number of letters and be more than three letters long. Vertical words just need to be more than 4 letters long. They are then ‘binned’ or grouped by the letter at the crossing. That’s the middle letter for horizontal words and the second letter for vertical ones.</p>\n\n<h2 id=\"basic-english\">Basic English</h2>\n\n<div id=\"cross-box\"></div>\n<div id=\"definitions\"></div>\n\n<h2 id=\"hard-english\">Hard English</h2>\n\n<p>Here’s some from the full list of english words:</p>\n\n<div id=\"hard-cross-box\"></div>\n<div id=\"hard-definitions\"></div>\n\n<p>The <a href=\"https://github.com/notionparallax/east-van\">repo for this is here</a>. Thanks to dwyl for the <a href=\"https://github.com/dwyl/english-words\">english-words</a>.</p>\n\n<figure>\n  <p><img src=\"https://notionparallax.co.uk/assets/16/east-van1.jpg\" alt=\"The East Van Sign at night\" /></p>\n  <figcaption>\n    <p>From <a href=\"https://matthewjvandeventer.wordpress.com/2010/01/\">“…that’s gangster and now the whole world will see…”</a></p>\n  </figcaption>\n</figure>\n\n<script type=\"text/javascript\">\n// \"use strict\";\ndocument.addEventListener(\"DOMContentLoaded\", function (event) {\n\n  function triggerDIY(direction, input) {\n    var words, letter, complementWord, url;\n    input = input.trim();\n    if (input.length >= 3) { //&& input.length % 2 == 0 fuck it, lets be permissive\n      document.getElementById(\"diy-cross-box\").html = \"\";\n      if (direction == \"across\") {\n        words = window.simple_words.vwords; //move this out if perf is an issue\n        letter = input[Math.floor(input.length / 2)];\n      } else {\n        words = window.simple_words.hwords;\n        letter = input[1];\n      }\n      if (document.getElementById(\"cb-manual\").checked) {\n        if (direction == \"across\") {\n          complementWord = document.querySelector(\"input[name=down]\").value;\n        } else {\n          complementWord = document.querySelector('input[name=across]').value;\n        }\n      } else {\n        complementWord = getWord(words, letter, 9);\n      }\n\n      if (direction == \"across\") {\n        document.querySelector(\"input[name=down]\").value = complementWord;\n        addNewCross(input, complementWord, \"#diy-cross-box\");\n        url = `/2016/east-van-and-friends#diy?a=${input}&d=${complementWord}`;\n      } else {\n        document.querySelector('input[name=across]').value = complementWord;\n        addNewCross(complementWord, input, \"#diy-cross-box\");\n        url = `/2016/east-van-and-friends#diy?a=${complementWord}&d=${input}`;\n      }\n      console.log(url);\n      history.pushState({}, \"NP generator\", url);\n\n    }\n  }\n\n  function setDIY() {\n    //Setup\n    if (window.location.hash) {\n      var params = window.location.hash.split(\"?\")[1].split(\"&\");\n      var a = params[0].split(\"=\")[1]\n      var d = params[1].split(\"=\")[1]\n      document.querySelector('input[name=across]').value = a;\n      document.querySelector('input[name=down]').value = d;\n      addNewCross(a, d, \"#diy-cross-box\");\n    } else {\n      document.querySelector('input[name=across]').value = \"Van\";\n      document.querySelector('input[name=down]').value = \"East\";\n      addNewCross(\"van\", \"east\", \"#diy-cross-box\");\n    }\n    // action\n    document.querySelector('input[name=across]').addEventListener('input', function () {\n      triggerDIY(\"across\", this.value);\n    });\n    document.querySelector('input[name=down]').addEventListener('input', function () {\n      triggerDIY(\"down\", this.value);\n    });\n  }\n\n  async function addEverything(fileName, numberOfCrosses, hCharLimit, vCharLimit, defContainer, crossContainer) {\n    const App = {};\n\n    async function fetchJson(url) {\n      const response = await fetch(url);\n      if (!response.ok) {\n        throw new Error(`HTTP error! status: ${response.status}`);\n      }\n      return response.json();\n    }\n\n    App.hwords = await fetchJson(`/js/posts/east-van/h${fileName}.json`);\n    App.vwords = await fetchJson(`/js/posts/east-van/v${fileName}.json`);\n\n    const alphabet = \"abcdefghiklmnoprstuvwxy\"; //jqz removed because simple English doesn't have any words in those bins\n    for (let i = 0; i < numberOfCrosses; i++) {\n      const random_letter = alphabet[Math.floor(Math.random() * alphabet.length)];\n      const hword = getWord(App.hwords, random_letter, hCharLimit);\n      const vword = getWord(App.vwords, random_letter, vCharLimit);\n      console.log(random_letter, hword, vword);\n      addNewCross(hword, vword, crossContainer);\n      addDefinitions(hword, vword, defContainer);\n    }\n\n    window[fileName] = App;\n  }\n  addEverything(\"simple_words\", 11, 7, 8, \"#definitions\", \"#cross-box\");\n  addEverything(\"words\", 12, 7, 8, \"#hard-definitions\", \"#hard-cross-box\");\n\n  function getWord(words, letter, limit) {\n    var wordLength = 100;\n    var word = \"\";\n    while (wordLength > limit) {\n      try {\n        word = words[letter][Math.floor(Math.random() * words[letter].length)];\n        wordLength = word.length;\n      }\n      catch (e) {\n        console.log(e, word, letter);\n        break;\n      }\n    }\n    return word;\n  }\n\n  function addDefinitions(hword, vword, selector) {\n    // Create the list element\n    const definitionList = document.createElement('ol');\n    definitionList.className = 'definition';\n\n    // Create list items\n    const vwordItem = document.createElement('li');\n    const hwordItem = document.createElement('li');\n\n    // Create links\n    const vwordLink = document.createElement('a');\n    vwordLink.href = `http://www.thefreedictionary.com/${vword}`;\n    vwordLink.target = '_blank';\n    vwordLink.textContent = vword;\n\n    const hwordLink = document.createElement('a');\n    hwordLink.href = `http://www.thefreedictionary.com/${hword}`;\n    hwordLink.target = '_blank';\n    hwordLink.textContent = hword;\n\n    // Append links to list items\n    vwordItem.appendChild(vwordLink);\n    hwordItem.appendChild(hwordLink);\n\n    // Append list items to list\n    definitionList.appendChild(vwordItem);\n    definitionList.appendChild(hwordItem);\n\n    // Append the list to the container\n    document.querySelector(selector).appendChild(definitionList);\n  }\n\n  function addNewCross(h_test_word, v_test_word, container) {\n    h_test_word = h_test_word.toUpperCase();\n    v_test_word = v_test_word.toUpperCase();\n\n    var h_letters = h_test_word.length;\n    var v_letters = v_test_word.length;\n\n    var rad = 8;\n    var pad = 9;\n    var box = 50;\n\n    var vll = (0) + pad;\n    var vlm = (Math.floor(h_letters / 2) * box) + pad;\n    var vrm = (vlm + box) + pad;\n    var vrr = (h_letters * box) + pad;\n\n    var htt = (0) + pad;\n    var htm = (box) + pad;\n    var hlm = (box * 2) + pad;\n    var hll = (v_letters * box) + pad;\n\n    var v_nudge = 7;\n\n    var blur = 5;\n    var letter_pad = \"    \"; //blur stops at box boundary, this makes the box bigger\n    var blur_colour = \"hsla(180,70%,52%,1)\";\n\n    var svg_head = `<svg viewbox=\\\"0 0 ${vrr + (2 * pad)} ${hll + (2 * pad)}\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">`;\n    var svg_filter = `<filter id=\\\"blurMe\\\">\n                          <feGaussianBlur in=\\\"SourceGraphic\\\" \n                                          stdDeviation=\\\"${blur}\\\" \n                                          x=\"-50%\" \n                                          y=\"-50%\" \n                                          width=\"280%\" \n                                          height=\"280%\"/>\n                        </filter>`;\n    var svg_bg = `<rect x=\\\"0\\\" y=\\\"0\\\" width=\\\"${vrr + (2 * pad)}\\\" height=\\\"${hll + (2 * pad)}\\\" fill=\\\"black\\\" />`;\n\n    var path = `M${vll + rad} ${htm}` + //1       \n      `L ${vlm - rad} ${htm}` + //2\n      `A ${rad} ${rad}, 0, 0, 0, ${vlm} ${htm - rad}` + //3\n      `L ${vlm}  ${htt + rad}` + //4\n      `A ${rad} ${rad}, 0, 0, 1, ${vlm + rad} ${htt}` + //5\n      `L ${vrm - rad}  ${htt}` + //6\n      `A ${rad} ${rad}, 0, 0, 1, ${vrm} ${htt + rad}` + //7\n      `L ${vrm} ${htm - rad}` + //8\n      `A ${rad} ${rad}, 0, 0, 0, ${vrm + rad} ${htm}` + //9\n      `L ${vrr - rad} ${htm}` + //10\n      `A ${rad} ${rad}, 0, 0, 1, ${vrr} ${htm + rad}` + //11\n      `L ${vrr} ${hlm - rad}` + //12\n      `A ${rad} ${rad}, 0, 0, 1, ${vrr - rad} ${hlm}` + //13\n      `L ${vrm + rad} ${hlm}` + //14\n      `A ${rad} ${rad}, 0, 0, 0, ${vrm} ${hlm + rad}` + //15\n      `L ${vrm} ${hll - rad}` + //16\n      `A ${rad} ${rad}, 0, 0, 1, ${vrm - rad} ${hll}` + //17\n      `L ${vlm + rad} ${hll}` + //18\n      `A ${rad} ${rad}, 0, 0, 1, ${vlm} ${hll - rad}` + //19\n      `L ${vlm} ${hlm + rad}` + //20\n      `A ${rad} ${rad}, 0, 0, 0, ${vlm - rad} ${hlm}` + //21\n      `L ${vll + rad} ${hlm}` + //22\n      `A ${rad} ${rad}, 0, 0, 1,  ${vll} ${hlm - rad}` + //23\n      `L  ${vll} ${htm + rad}` + //24\n      `A ${rad} ${rad}, 0, 0, 1, ${vll + rad} ${htm}`;\n\n    var svg_path = `<path id=\\\"glow_path\\\" d=\\\"${path}\\\" stroke=\\\"${blur_colour}\\\" stroke-width=\\\"10\\\"` +\n      `fill=\\\"rgba(255, 255, 255, 0.55)\\\" opacity=\\\"0.6\\\" filter=\\\"url(#blurMe)\\\"></path>` +\n      `<path id=\\\"main_path\\\" d=\\\"${path}\\\" stroke=\\\"white\\\" ` +\n      `fill=\\\"none\\\" stroke-width=\\\"2\\\" fill-opacity=\\\"0.5\\\"></path>`;\n\n\n    var svg_text = \"\"\n    for (let index = 0, len = h_test_word.length; index < len; index++) {\n      var letter = h_test_word[index];\n      svg_text += `<text class=\\\"blur-text\\\"   text-anchor=\\\"middle\\\" x=\\\"${vll + index * box + (box / 2)}\\\" y=\\\"${hlm - v_nudge}\\\" font-size=\\\"${box}\\\" font-family=\\\"sans-serif\\\" fill=\\\"${blur_colour}\\\" filter=\\\"url(#blurMe)\\\">${letter_pad}${letter}${letter_pad}</text>`;\n      svg_text += `<text class=\\\"bright-text\\\" text-anchor=\\\"middle\\\" x=\\\"${vll + index * box + (box / 2)}\\\" y=\\\"${hlm - v_nudge}\\\" font-size=\\\"${box}\\\" font-family=\\\"sans-serif\\\" fill=\\\"white\\\">${letter_pad}${letter}${letter_pad}</text>`;\n    }\n\n    for (let index = 0, len = v_test_word.length; index < len; index++) {\n      var letter = v_test_word[index];\n      if (index !== 1) {\n        svg_text += `<text class=\\\"blur-text\\\"   text-anchor=\\\"middle\\\" x=\\\"${vlm + box / 2}\\\" y=\\\"${htt + (index * box) + box - v_nudge}\\\" font-size=\\\"${box}\\\" font-family=\\\"sans-serif\\\" fill=\\\"${blur_colour}\\\" filter=\\\"url(#blurMe)\\\">${letter_pad}${letter}${letter_pad}</text>`;\n        svg_text += `<text class=\\\"bright-text\\\" text-anchor=\\\"middle\\\" x=\\\"${vlm + box / 2}\\\" y=\\\"${htt + (index * box) + box - v_nudge}\\\" font-size=\\\"${box}\\\" font-family=\\\"sans-serif\\\" fill=\\\"white\\\">${letter_pad}${letter}${letter_pad}</text>`;\n      }\n    }\n\n    var svg = svg_head +\n      svg_filter +\n      svg_bg +\n      svg_path +\n      svg_text +\n      \"</svg>\"\n\n    // Clear the box\n    document.querySelector(container).innerHTML = \"\";\n    // Add the new SVG\n    document\n      .querySelector(container)\n      .appendChild(\n        new DOMParser()\n        .parseFromString(\n          \"<div class='cross-frame'>\" + svg + \"</div>\", \n          \"text/html\"\n          ).body.firstChild\n        );\n  }\n\n  setDIY();\n  addNewCross(\"craft\", \"lager\", \"#cross-box\");\n  addDefinitions(\"van\", \"east\", \"#definitions\");\n  addDefinitions(\"craft\", \"lager\", \"#definitions\");\n});\n</script>\n\n<div class=\"footnotes\" role=\"doc-endnotes\">\n  <ol>\n    <li id=\"fn:1\" role=\"doc-endnote\">\n      <p>That’s my sketches on a chopstick wrapper. I was also faffing about with the <a href=\"https://www.buzzfeed.com/mrloganrhoades/fan-made-penis-sign-shown-on-live-tv-to-nations-delight\">ESPN penis</a> thing too. <a href=\"https://notionparallax.co.uk/2016/east-van-and-friends#fnref:1\" class=\"reversefootnote\" role=\"doc-backlink\">&#8617;</a></p>\n    </li>\n  </ol>\n</div>\n",
 "content_hash": "sha256:55d1a8b71d7e76b5877bc4e6f8c1f0c8307b16e9818541d4d59f3928ad03a47f",
 "media": [],
 "changelog": [
  {
   "version": 1,
   "at": "2016-06-12T02:00:00Z",
   "note": null
  }
 ],
 "transclusions": []
}