track which font selected
This commit is contained in:
parent
19e461c4ac
commit
5695076373
14
index.js
14
index.js
|
@ -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', () => {
|
||||
|
|
Loading…
Reference in New Issue