aboutsummaryrefslogtreecommitdiffstats
path: root/hitcounter.php
diff options
context:
space:
mode:
authorsillylaird <sillyfanboy@gmail.com>2026-09-03 00:33:59 +0000
committersillylaird <sillyfanboy@gmail.com>2026-09-03 00:33:59 +0000
commit898b52edcb47bcb3e9d6106e74ca73e74ea01e70 (patch)
tree85c6ee5ad58b860144551184d4cf86b560c62b91 /hitcounter.php
downloadwww-898b52edcb47bcb3e9d6106e74ca73e74ea01e70.tar.gz
www-898b52edcb47bcb3e9d6106e74ca73e74ea01e70.zip
import live www.sillylaird.ca webrootHEADmain
Diffstat (limited to 'hitcounter.php')
-rw-r--r--hitcounter.php62
1 files changed, 62 insertions, 0 deletions
diff --git a/hitcounter.php b/hitcounter.php
new file mode 100644
index 0000000..af2312a
--- /dev/null
+++ b/hitcounter.php
@@ -0,0 +1,62 @@
+<?php
+require_once __DIR__ . '/partials/i18n.php';
+
+$lang = _i18n_lang();
+$htmlLang = $lang === 'ja' ? 'ja' : ($lang === 'zh' ? 'zh' : 'en');
+$ogLocale = ['en' => 'en_US', 'ja' => 'ja_JP', 'zh' => 'zh_CN'][$lang];
+$self = '/hitcounter' . ($lang === 'ja' ? '_jp' : ($lang === 'zh' ? '_zh' : '')) . '.php';
+?>
+<!doctype html>
+<html lang="<?= $htmlLang ?>">
+<head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width,initial-scale=1" />
+ <title>Visitor Counter (Local) — SillyLaird</title>
+ <meta name="description" content="Local-only visitor counter using localStorage/sessionStorage." />
+ <meta property="og:title" content="Visitor Counter (Local) — SillyLaird" />
+ <meta property="og:description" content="Local-only visitor counter using localStorage/sessionStorage." />
+ <meta property="og:image" content="https://www.sillylaird.ca/assets/img/lain.png" />
+ <meta property="og:type" content="website" />
+ <meta property="og:url" content="https://www.sillylaird.ca<?= $self ?>" />
+ <meta property="og:locale" content="<?= $ogLocale ?>" />
+ <?php foreach (['en_US', 'ja_JP', 'zh_CN'] as $alt): if ($alt !== $ogLocale): ?>
+ <meta property="og:locale:alternate" content="<?= $alt ?>" />
+ <?php endif; endforeach; ?>
+ <meta name="twitter:card" content="summary_large_image" />
+ <meta name="twitter:title" content="Visitor Counter (Local) — SillyLaird" />
+ <meta name="twitter:description" content="Local-only visitor counter using localStorage/sessionStorage." />
+ <meta name="twitter:image" content="https://www.sillylaird.ca/assets/img/lain.png" />
+ <link rel="canonical" href="https://www.sillylaird.ca<?= $self ?>" />
+ <link rel="alternate" hreflang="x-default" href="https://www.sillylaird.ca/hitcounter.php" />
+ <link rel="alternate" hreflang="en" href="https://www.sillylaird.ca/hitcounter.php" />
+ <link rel="alternate" hreflang="zh" href="https://www.sillylaird.ca/hitcounter_zh.php" />
+ <link rel="alternate" hreflang="ja" href="https://www.sillylaird.ca/hitcounter_jp.php" />
+ <link rel="icon" href="https://www.sillylaird.ca/assets/img/lain.png" />
+
+ <link rel="stylesheet" href="/assets/css/fonts.css" />
+ <link rel="stylesheet" href="/assets/css/site.css" />
+ <link rel="stylesheet" href="/assets/css/skeleton.css" />
+ <link rel="stylesheet" href="/assets/css/pages/hitcounter.css" />
+</head>
+
+<body>
+ <a class="skip-link" href="#main"><?= htmlspecialchars(t('common.skip'), ENT_QUOTES, 'UTF-8') ?></a>
+ <?php include 'partials/header.php'; ?>
+
+ <main id="main" class="wrap">
+ <section aria-labelledby="counter-title">
+ <h1 id="counter-title"><?= htmlspecialchars(t('hitcounter.title'), ENT_QUOTES, 'UTF-8') ?></h1>
+ <p class="muted"><?= htmlspecialchars(t('hitcounter.subtitle'), ENT_QUOTES, 'UTF-8') ?></p>
+
+ <div class="counter">
+ <div><?= htmlspecialchars(t('hitcounter.label'), ENT_QUOTES, 'UTF-8') ?></div>
+ <div id="visitor-counter" class="big">0</div>
+ </div>
+ </section>
+ </main>
+
+ <?php include 'partials/footer.php'; ?>
+
+ <script defer src="/assets/js/pages/hitcounter.js"></script>
+</body>
+</html>