Skip to content

lightweight, client-only calendar web application. All data persists in the URL hash for instant sharing, No backend required. Optional AES-GCM password protection keeps shared links locked without a server

JavaScript

feat: integrate Google Tag Manager and Clarity for enhanced analytics across multiple pages

Supun Lakmald17997daf212
diff --git a/404.html b/404.html
index a7b3dac..dd6977b 100644
--- a/404.html
+++ b/404.html
@@ -2,6 +2,25 @@
<html lang="en">
<head>
+ <script async src="https://www.googletagmanager.com/gtag/js?id=G-77V3TP2B5T"></script>
+ <script>
+ window.dataLayer = window.dataLayer || [];
+ function gtag() { dataLayer.push(arguments); }
+ gtag('js', new Date());
+
+ // Security: Exclude URL hash from analytics to prevent leaking data
+ gtag('config', 'G-77V3TP2B5T', {
+ 'page_location': window.location.origin + window.location.pathname,
+ 'page_path': window.location.pathname
+ });
+ </script>
+ <script type="text/javascript">
+ (function (c, l, a, r, i, t, y) {
+ c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments) };
+ t = l.createElement(r); t.async = 1; t.src = "https://www.clarity.ms/tag/" + i;
+ y = l.getElementsByTagName(r)[0]; y.parentNode.insertBefore(t, y);
+ })(window, document, "clarity", "script", "vhsixn9su0");
+ </script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>404 - Page not found | hash-calendar</title>
diff --git a/LLM.md b/LLM.md
index acb44d0..a025f6c 100644
--- a/LLM.md
+++ b/LLM.md
@@ -1,59 +1,77 @@
-# System Role: Hash Calendar Generator
+# System Role: hash-calendar URL Builder
-You are an intelligent URL generator for Hash Calendar.
-Base URL: `https://hash-calendar.netlify.app/json.html?json=`
+You generate shareable `hash-calendar` links from natural-language schedule requests.
-Your job: accept a natural-language schedule request and return a URL that loads the schedule.
+- App URL: `https://hash-calendar.netlify.app/`
+- JSON Bridge URL (preferred): `https://hash-calendar.netlify.app/json.html?json=`
-Output rules (must follow exactly):
+## Output Rules (strict)
-1. If you can run code to compress JSON: output ONLY two lines:
- Title: <calendar title>
- URL: <base_url><json_stringify_payload>
+Return exactly two lines and nothing else:
-Do not include any other text.
+Title: <calendar title>
+URL: <full URL>
----
+No markdown. No explanation text.
-How to generate the data
+## URL Strategy
-1. Parse the request into events, durations, and recurrence.
-2. Pick dates and times:
- - If the user gives dates/times, use them.
- - Interpret times in the user's requested timezone; otherwise use UTC.
- - If only a date is provided (no time), create an all-day event (duration = 0).
- - If no date is provided, start on the next logical Monday at 09:00.
-3. Convert each event start to minutes since Unix epoch:
- startMin = floor(timestamp_ms / 60000)
-4. Build the JSON payload using the compact schema below.
-5. convert json object in to stringify.
-6. Final URL format: <base_url>#<json_stringify_payload>
+1. Build a valid payload object (schema below).
+2. Serialize with `JSON.stringify(payload)`.
+3. URL-encode with `encodeURIComponent(...)`.
+4. Return:
+ `https://hash-calendar.netlify.app/json.html?json=<encoded_json>`
-JSON schema (compact form before compression):
+Do not append `#` to the bridge URL.
+
+## Event Parsing Rules
+
+1. Use user-provided dates/times exactly when specified.
+2. If timezone is provided, interpret times in that timezone before converting to epoch minutes.
+3. If only a date is provided (no time), create an all-day event:
+ - `duration = 0`
+ - start at local midnight for that date in the chosen timezone
+4. If no date is provided, start on the next Monday at `09:00` in `UTC`.
+5. For timed events with no duration, default to `60` minutes.
+6. Recurrence mapping:
+ - daily -> `d`
+ - weekly -> `w`
+ - monthly -> `m`
+ - yearly -> `y`
+
+## Compact Payload Schema
```json
{
"t": "Calendar Title",
- "c": { "0": "2ecc71", "1": "e74c3c" },
+ "c": ["#ff6b6b", "#ffd43b", "#4dabf7", "#63e6be", "#9775fa"],
"e": [
[startMin, duration, "Title", colorIndex, "recurrence"]
],
- "s": { "d": 1, "m": 1, "v": "month" },
- "z": ["UTC"],
- "mp": { "h": "UTC", "z": ["UTC"], "s": timestamp_ms, "d": "YYYY-MM-DD", "f24": 1 }
+ "s": { "d": 0, "m": 0, "v": "month", "l": "en", "r": 0, "n": 0 },
+ "mp": { "h": "UTC", "z": ["UTC"], "s": null, "d": null, "f24": 0 }
}
```
-Field notes
+### Field Notes
-- `c`: palette overrides by index. Values are hex WITHOUT `#`.
-- `e`: each event is `[startMin, duration, title]` with optional `colorIndex` and `recurrence`.
-- `duration`: minutes; `0` means all-day.
-- `recurrence`: `d` (daily), `w` (weekly), `m` (monthly), `y` (yearly).
-- `s`: settings (theme, week start, last view). Use `{ "d": 1, "m": 1, "v": "week" }` unless asked otherwise.
-- `z`: list of saved timezones (IANA strings). Use `"UTC"` if none is requested.
-- `mp`: planner state; set `mp.s` and `mp.d` to the schedule start date.
+- `startMin = floor(timestamp_ms / 60000)`
+- `e` entry format: `[startMin, duration, title, colorIndex?, recurrence?]`
+- `duration` is in minutes; `0` means all-day
+- `colorIndex` defaults to `0` when omitted
+- valid recurrence values: `d`, `w`, `m`, `y`
+- valid `s.v`: `day`, `week`, `month`, `year`, `agenda`, `timeline`
+- keep `mp.z` as IANA timezone names; include `"UTC"` at minimum
-Task -
+## Minimal Safe Payload
-Generate a one-month schedule for me to learn the Python language, starting from February 1, 2026. My target is to gain expert-level knowledge by the end of the month. I need a daily plan where I cover specific parts of Python, ensuring that by the end of the month, I have mastered all Python data concepts.
+When not asked for advanced settings, prefer this minimal shape:
+
+```json
+{
+ "t": "Calendar Title",
+ "e": [[startMin, duration, "Event Title", 0]],
+ "s": { "v": "month" },
+ "mp": { "h": "UTC", "z": ["UTC"] }
+}
+```
diff --git a/about.html b/about.html
index 1abc6ec..7f3560e 100644
--- a/about.html
+++ b/about.html
@@ -2,6 +2,25 @@
<html lang="en">
<head>
+ <script async src="https://www.googletagmanager.com/gtag/js?id=G-77V3TP2B5T"></script>
+ <script>
+ window.dataLayer = window.dataLayer || [];
+ function gtag() { dataLayer.push(arguments); }
+ gtag('js', new Date());
+
+ // Security: Exclude URL hash from analytics to prevent leaking data
+ gtag('config', 'G-77V3TP2B5T', {
+ 'page_location': window.location.origin + window.location.pathname,
+ 'page_path': window.location.pathname
+ });
+ </script>
+ <script type="text/javascript">
+ (function (c, l, a, r, i, t, y) {
+ c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments) };
+ t = l.createElement(r); t.async = 1; t.src = "https://www.clarity.ms/tag/" + i;
+ y = l.getElementsByTagName(r)[0]; y.parentNode.insertBefore(t, y);
+ })(window, document, "clarity", "script", "vhsixn9su0");
+ </script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>About | hash-calendar</title>
diff --git a/faq.html b/faq.html
index fc85e66..0a1f5e1 100644
--- a/faq.html
+++ b/faq.html
@@ -2,6 +2,25 @@
<html lang="en">
<head>
+ <script async src="https://www.googletagmanager.com/gtag/js?id=G-77V3TP2B5T"></script>
+ <script>
+ window.dataLayer = window.dataLayer || [];
+ function gtag() { dataLayer.push(arguments); }
+ gtag('js', new Date());
+
+ // Security: Exclude URL hash from analytics to prevent leaking data
+ gtag('config', 'G-77V3TP2B5T', {
+ 'page_location': window.location.origin + window.location.pathname,
+ 'page_path': window.location.pathname
+ });
+ </script>
+ <script type="text/javascript">
+ (function (c, l, a, r, i, t, y) {
+ c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments) };
+ t = l.createElement(r); t.async = 1; t.src = "https://www.clarity.ms/tag/" + i;
+ y = l.getElementsByTagName(r)[0]; y.parentNode.insertBefore(t, y);
+ })(window, document, "clarity", "script", "vhsixn9su0");
+ </script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>FAQ | hash-calendar</title>
diff --git a/help.html b/help.html
index 6333885..c7a8077 100644
--- a/help.html
+++ b/help.html
@@ -2,6 +2,25 @@
<html lang="en">
<head>
+ <script async src="https://www.googletagmanager.com/gtag/js?id=G-77V3TP2B5T"></script>
+ <script>
+ window.dataLayer = window.dataLayer || [];
+ function gtag() { dataLayer.push(arguments); }
+ gtag('js', new Date());
+
+ // Security: Exclude URL hash from analytics to prevent leaking data
+ gtag('config', 'G-77V3TP2B5T', {
+ 'page_location': window.location.origin + window.location.pathname,
+ 'page_path': window.location.pathname
+ });
+ </script>
+ <script type="text/javascript">
+ (function (c, l, a, r, i, t, y) {
+ c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments) };
+ t = l.createElement(r); t.async = 1; t.src = "https://www.clarity.ms/tag/" + i;
+ y = l.getElementsByTagName(r)[0]; y.parentNode.insertBefore(t, y);
+ })(window, document, "clarity", "script", "vhsixn9su0");
+ </script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Help & Guide | hash-calendar</title>
diff --git a/index.html b/index.html
index 637a253..79ba9c5 100644
--- a/index.html
+++ b/index.html
@@ -14,6 +14,13 @@
'page_path': window.location.pathname
});
</script>
+ <script type="text/javascript">
+ (function (c, l, a, r, i, t, y) {
+ c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments) };
+ t = l.createElement(r); t.async = 1; t.src = "https://www.clarity.ms/tag/" + i;
+ y = l.getElementsByTagName(r)[0]; y.parentNode.insertBefore(t, y);
+ })(window, document, "clarity", "script", "vhsixn9su0");
+ </script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>hash-calendar - private, URL-powered calendar</title>
@@ -290,8 +297,8 @@
<div>
<h2 id="month-label" class="month-label">Month 2026</h2>
<div class="panel-actions">
- <button id="event-search-btn" class="ghost command-palette-btn" type="button"
- aria-label="Search events" title="Search events">
+ <button id="event-search-btn" class="ghost command-palette-btn" type="button" aria-label="Search events"
+ title="Search events">
<i class="fa-solid fa-magnifying-glass" aria-hidden="true"></i>
<span>Search events</span>
</button>
@@ -450,10 +457,8 @@
<h3 id="command-palette-title" class="sr-only" data-i18n="command.paletteTitle">Command palette</h3>
<label class="command-palette-input-wrap" for="command-palette-input">
<i class="fa-solid fa-magnifying-glass" aria-hidden="true"></i>
- <input id="command-palette-input" type="search" autocomplete="off"
- placeholder="Search commands and events"
- data-i18n-placeholder="command.searchPlaceholder"
- data-i18n-aria-label="command.searchAriaLabel"
+ <input id="command-palette-input" type="search" autocomplete="off" placeholder="Search commands and events"
+ data-i18n-placeholder="command.searchPlaceholder" data-i18n-aria-label="command.searchAriaLabel"
aria-label="Search commands and events">
</label>
<button id="command-palette-close" type="button" class="icon-btn" aria-label="Close"
@@ -475,8 +480,7 @@
<h3 id="event-search-title" class="sr-only">Event search</h3>
<label class="command-palette-input-wrap" for="event-search-input">
<i class="fa-solid fa-magnifying-glass" aria-hidden="true"></i>
- <input id="event-search-input" type="search" autocomplete="off"
- placeholder="Search events by title"
+ <input id="event-search-input" type="search" autocomplete="off" placeholder="Search events by title"
aria-label="Search events by title">
</label>
<button id="event-search-close" type="button" class="icon-btn" aria-label="Close"
@@ -530,8 +534,8 @@
</div>
</div>
<p id="event-search-empty" class="command-palette-empty hidden">No matching events</p>
- <ul id="event-search-results" class="command-palette-results" role="listbox"
- aria-label="Event search results"></ul>
+ <ul id="event-search-results" class="command-palette-results" role="listbox" aria-label="Event search results">
+ </ul>
</div>
</div>
</div>
@@ -854,8 +858,7 @@
<a href="faq.html" class="mobile-drawer-item action-link" aria-label="FAQ" target="_blank" rel="noopener">
<i class="fa-solid fa-comments"></i> <span>FAQ</span>
</a>
- <a href="about.html" class="mobile-drawer-item action-link" aria-label="About" target="_blank"
- rel="noopener">
+ <a href="about.html" class="mobile-drawer-item action-link" aria-label="About" target="_blank" rel="noopener">
<i class="fa-solid fa-circle-info"></i> <span>About</span>
</a>
</div>
@@ -940,4 +943,4 @@
<script type="module" src="script.js"></script>
</body>
-</html>
+</html>
\ No newline at end of file
diff --git a/json.html b/json.html
index 83ed87a..80456bd 100644
--- a/json.html
+++ b/json.html
@@ -2,6 +2,25 @@
<html lang="en">
<head>
+ <script async src="https://www.googletagmanager.com/gtag/js?id=G-77V3TP2B5T"></script>
+ <script>
+ window.dataLayer = window.dataLayer || [];
+ function gtag() { dataLayer.push(arguments); }
+ gtag('js', new Date());
+
+ // Security: Exclude URL hash from analytics to prevent leaking data
+ gtag('config', 'G-77V3TP2B5T', {
+ 'page_location': window.location.origin + window.location.pathname,
+ 'page_path': window.location.pathname
+ });
+ </script>
+ <script type="text/javascript">
+ (function (c, l, a, r, i, t, y) {
+ c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments) };
+ t = l.createElement(r); t.async = 1; t.src = "https://www.clarity.ms/tag/" + i;
+ y = l.getElementsByTagName(r)[0]; y.parentNode.insertBefore(t, y);
+ })(window, document, "clarity", "script", "vhsixn9su0");
+ </script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>hash-calendar JSON bridge</title>