1
0
mirror of https://github.com/GenderDysphoria/GenderDysphoria.fyi.git synced 2025-11-25 12:32:42 +00:00

Working on analytics parsing

This commit is contained in:
Jocelyn Badgley (Twipped)
2021-03-02 08:09:00 -08:00
parent 3f6077eb18
commit 98323f3316
8 changed files with 1656 additions and 51 deletions

View File

@@ -44,10 +44,11 @@
const viewport_height = Math.max(window.document.documentElement.clientHeight, window.innerHeight || 0);
const max_scroll = Math.max(SESSION_DATA.max_scroll, window.scrollY);
const density = window.devicePixelRatio || 1;
const viewed = max_scroll === 0 ? 0 : Math.round(((max_scroll + viewport_height) / page_height) * 100);
Object.assign(SESSION_DATA, { page_height, viewport_height, max_scroll, viewed });
Object.assign(SESSION_DATA, { page_height, viewport_height, max_scroll, viewed, density });
});