<commit_before>import {queryString} from './_links.js'
import {floatingCogs} from 'hero-patterns'
import {fill, opacity, patterns, backgrounds} from './_hero-patterns.js'
import {set, setRandom} from './_hero-set.js'
import {scroll} from './_hero-effects.js'
import lazy from './_images.js'

// Initialize Layzr
document.addEventListener('DOMContentLoaded', event => {
  lazy
    .update()
    .check()
    .handlers(true)
})

// Add analytics strings to outbound links
let anchors = document.querySelectorAll('a')
let aQueryString = 'utm_source=lowmess'

for (let i = anchors.length; i--;) {
  anchors[i].addEventListener('click', function (event) {
    event.preventDefault()
    queryString(anchors[i], aQueryString)
    window.location = anchors[i].href
  })
}

// Hero patterns

patterns.forEach(function (item, index, array) {
  let name = item.name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase().split('$').shift()

  let els = document.querySelectorAll('[data-hero-pattern=' + name + ']')
  for (let i = els.length; i--;) {
    set(els[i], item(fill, opacity))<commit_msg>fix: stop query string appendation from preventing links opening in new tab<commit_after>import {queryString} from './_links.js'
import {floatingCogs} from 'hero-patterns'
import {fill, opacity, patterns, backgrounds} from './_hero-patterns.js'
import {set, setRandom} from './_hero-set.js'
import {scroll} from './_hero-effects.js'
import lazy from './_images.js'

// Initialize Layzr
document.addEventListener('DOMContentLoaded', event => {
  lazy
    .update()
    .check()
    .handlers(true)
})

// Add analytics strings to outbound links
let anchors = document.querySelectorAll('a')
let aQueryString = 'utm_source=lowmess'

for (let i = anchors.length; i--;) {
  anchors[i].addEventListener('click', function (event) {
    var href = anchors[i].href
    queryString(anchors[i], aQueryString)
    window.setTimeout(function () {
      anchors[i].href = href
    }, 300)
  })
}

// Hero patterns

patterns.forEach(function (item, index, array) {
  let name = item.name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase().split('$').shift()

  let els = document.querySelectorAll('[data-hero-pattern=' + name + ']')
  for (let i = els.length; i--;) {
    set(els[i], item(fill, opacity))
{'fraction_non_alphanumeric': 0.17305151915455746, 'fraction_numerical': 0.0030823425803610744, 'mean_word_length': 4.187214611872146, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5035420', 'n_tokens_mistral': 755, 'n_tokens_neox': 752, 'n_words': 180}