chore: debug

This commit is contained in:
Cory Dransfeldt 2024-03-24 12:40:42 -07:00
parent efd6f7445f
commit 86ab1d894d
No known key found for this signature in database
5 changed files with 61 additions and 3 deletions

View file

@ -15,6 +15,10 @@
{% render "../assets/styles/index.css" %}
{% endcapture %}
<style>{{ css }}</style>
{% capture js %}
{% render "../assets/scripts/index.js" %}
{% endcapture %}
<script>{{ js }}</script>
<script src="https://cdn.usefathom.com/script.js" data-site="CWSVCDJC" defer></script>
<link rel="canonical" href="{{ fullUrl }}" />
<meta property="og:title" content="{{ pageTitle }}" />
@ -86,6 +90,7 @@
{% endif %}
<noscript>
<style>.client-side {display:none}</style>
<img src="/api/event?page={{ fullUrl }}&ns=true" />
</noscript>
</head>
<body>

View file

@ -0,0 +1,15 @@
const id = Math.floor(Math.random() * Date.now())
let i;
if (window.sessionStorage && !window.sessionStorage?.getItem('id')) sessionStorage.setItem('id', id)
if (window.localStorage && window.localStorage.getItem('i')) i = localStorage.getItem('i')
if (!window.fathom) {
fetch(`https://coryd.dev/api/event/?page=${encodeURIComponent(window.location.href)}&num=${sessionStorage.getItem('id' || id)}&lang=${navigator.language}&nav=${navigator.userAgent}&i=${i}`)
.then((data) => {
console.log(data)
return {}
})
.catch(err => {
console.log(err);
return {}
});
}