track which font selected

This commit is contained in:
Koen Lagveen 2023-07-06 20:04:38 +02:00
parent 19e461c4ac
commit 5695076373
1 changed files with 11 additions and 3 deletions

View File

@ -44,7 +44,7 @@ function getFont () {
}
// ProgrammingFonts font selector
function selectFont () {
function selectFont (trigger) {
const msg = document.querySelector('footer .subtitle')
const codeMirror = document.querySelector('.CodeMirror')
const font = getFont()
@ -91,6 +91,15 @@ function selectFont () {
}
}
if (trigger === 'hash') {
plausible(font)
plausible('Font Selected', {
props: {
font
}
})
}
Cookies.set('font', font)
}
@ -219,8 +228,7 @@ function walk (direction) {
}
window.onhashchange = () => {
plausible('Font Selected')
selectFont()
selectFont('hash')
}
window.addEventListener('DOMContentLoaded', () => {