aboutsummaryrefslogtreecommitdiffstats
path: root/hitcounter.php
blob: af2312a72deb65d27981d6ec715dae908ef4a678 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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>