Skip to content

Commit 02a7d9f

Browse files
uwu
Updated visit counter badge and improved comments.
1 parent 23047f1 commit 02a7d9f

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

index.html

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
radial-gradient(1100px 620px at 72% -8%, rgba(231,181,61,.07), transparent 60%),
3838
radial-gradient(900px 520px at -8% 112%, rgba(79,184,154,.07), transparent 55%),
3939
radial-gradient(700px 700px at 50% 45%, rgba(11,18,32,.55), rgba(11,18,32,.0) 70%);}
40-
40+
4141
.wrap{position:relative; z-index:2; max-width:760px; margin:0 auto;
4242
padding:0 16px env(safe-area-inset-bottom) 16px; padding-top:calc(14px + env(safe-area-inset-top));}
4343

@@ -175,7 +175,8 @@
175175
@media (prefers-reduced-motion: reduce){
176176
*{animation-duration:.001s !important; transition-duration:.05s !important}
177177
}
178-
/* ---- visit counter badge ---- */
178+
179+
/* ---- visit counter badge ---- */
179180
.visits{position:fixed; z-index:40; display:none; align-items:center; gap:8px;
180181
top:calc(10px + env(safe-area-inset-top)); right:12px;
181182
font-family:var(--mono); font-size:11.5px; color:var(--muted);
@@ -186,17 +187,17 @@
186187
.visits.show{display:inline-flex}
187188
.visits i{color:var(--amber); font-size:11px}
188189
.visits b{color:var(--ink); font-weight:600; font-variant-numeric:tabular-nums}
189-
.visits .uq{color:var(--faint)}
190190
@media(max-width:640px){.visits{font-size:10.5px; padding:6px 9px; right:8px}}
191191
</style>
192192
</head>
193193
<body>
194194
<canvas id="mathbg" aria-hidden="true"></canvas>
195195
<div class="bgveil" aria-hidden="true"></div>
196+
196197
<div class="visits" id="visits" title="total page views">
197-
<i class="fa-solid fa-eye"></i><b id="vCount"></b>
198-
<span class="uq" id="vUniq"></span>
198+
<i class="fa-solid fa-eye"></i><b id="vCount">&mdash;</b>
199199
</div>
200+
200201
<div class="wrap">
201202
<div class="term">
202203
<div class="termbar">
@@ -504,22 +505,27 @@ <h2 id="mTitle">Open this page?</h2>
504505
resize();
505506
if(!reduce) raf=requestAnimationFrame(loop);
506507
})();
507-
/* ---------- visit counter (GoatCounter public endpoint) ---------- */
508+
509+
/* ============================================================================
510+
VISIT COUNTER (GoatCounter public endpoint — total pageviews, not unique)
511+
Requires: Settings -> "Allow adding visitor counts to your website" = ON,
512+
otherwise the endpoint sends no CORS header and the badge stays hidden.
513+
========================================================================== */
508514
(function(){
509515
var box=document.getElementById('visits'),
510-
n=document.getElementById('vCount'),
511-
u=document.getElementById('vUniq');
516+
n=document.getElementById('vCount');
512517
fetch('https://realmathmodel.goatcounter.com/counter/TOTAL.json',{cache:'no-store'})
513518
.then(function(r){ if(!r.ok)throw new Error('HTTP '+r.status); return r.json(); })
514519
.then(function(d){
515520
n.textContent=d.count;
516-
if(d.count_unique) u.textContent='· '+d.count_unique+' unique';
517521
box.classList.add('show');
518522
})
519523
.catch(function(){ /* endpoint off or blocked — leave the badge hidden */ });
520524
})();
521525
</script>
522-
<script data-goatcounter="https://realmathmodel.goatcounter.com/count"
526+
527+
<!-- GoatCounter tracking beacon -->
528+
<script data-goatcounter="https://realmathmodel.goatcounter.com/count"
523529
async src="//gc.zgo.at/count.js"></script>
524530
</body>
525531
</html>

0 commit comments

Comments
 (0)