Skip to content

Commit 9442e94

Browse files
MarkHersheyclaude
andcommitted
Add a one-page website, published with GitHub Pages
site/index.html is a single static page: icon, name, a download button, the preview and three lines on what the app does. It follows light and dark mode, and a few lines of JavaScript point the button at the latest release's disk image (it falls back to the releases page). The Website workflow copies the icon and previews from docs/ next to it and deploys to GitHub Pages whenever any of them change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent bf11b18 commit 9442e94

3 files changed

Lines changed: 165 additions & 1 deletion

File tree

‎.github/workflows/pages.yml‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Website
2+
3+
# Publishes site/ (plus the icon and previews from docs/) to GitHub Pages:
4+
# https://mxshell.dev/BetterWorldClock/
5+
on:
6+
push:
7+
branches: [main]
8+
paths:
9+
- site/**
10+
- docs/icon.png
11+
- docs/preview-*.png
12+
- .github/workflows/pages.yml
13+
workflow_dispatch:
14+
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
20+
concurrency:
21+
group: pages
22+
cancel-in-progress: true
23+
24+
jobs:
25+
deploy:
26+
runs-on: ubuntu-latest
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
steps:
31+
- uses: actions/checkout@v5
32+
33+
- name: Assemble the site
34+
run: |
35+
mkdir _site
36+
cp -R site/. _site/
37+
cp docs/icon.png docs/preview-light.png docs/preview-dark.png _site/
38+
39+
- uses: actions/configure-pages@v6
40+
41+
- uses: actions/upload-pages-artifact@v5
42+
with:
43+
path: _site
44+
45+
- id: deployment
46+
uses: actions/deploy-pages@v5

‎README.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
A better world clock for the macOS desktop and menu bar, for keeping track of several time zones at a glance.
66

7+
**Website:** [mxshell.dev/BetterWorldClock](https://mxshell.dev/BetterWorldClock/)
8+
79
<picture>
810
<source media="(prefers-color-scheme: dark)" srcset="docs/preview-dark.png">
911
<img alt="Better World Clock showing San Francisco, New York City, London and Singapore, with the three cities where it is night shaded together" src="docs/preview-light.png" width="474">
@@ -60,7 +62,8 @@ The app is signed ad hoc, which is enough to run it on the Mac that built it.
6062
| Unit tests (Swift Testing) | `Tests/BetterWorldClockTests` |
6163
| `Info.plist` and the script that draws the app icon | `Resources` |
6264
| Disk image packaging | `scripts` |
63-
| Release workflow | `.github/workflows` |
65+
| Website (one page, no build step) | `site` |
66+
| Release and website workflows | `.github/workflows` |
6467

6568
- The desktop widget is a borderless window one level above the desktop icons, so app windows always cover it.
6669
- Weather for all cities comes from a single Open-Meteo request every 15 minutes, and again after the Mac wakes.

‎site/index.html‎

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>Better World Clock</title>
7+
<meta name="description" content="A better world clock for your Mac's desktop and menu bar.">
8+
<meta property="og:title" content="Better World Clock">
9+
<meta property="og:description" content="A better world clock for your Mac's desktop and menu bar.">
10+
<meta property="og:image" content="https://mxshell.dev/BetterWorldClock/preview-dark.png">
11+
<meta property="og:url" content="https://mxshell.dev/BetterWorldClock/">
12+
<meta name="twitter:card" content="summary_large_image">
13+
<link rel="icon" href="icon.png">
14+
<link rel="apple-touch-icon" href="icon.png">
15+
<style>
16+
:root {
17+
color-scheme: light dark;
18+
--bg: #fafaf8;
19+
--fg: #141414;
20+
--muted: #6e6e6b;
21+
--line: #e4e4e0;
22+
--button-bg: #141414;
23+
--button-fg: #fafaf8;
24+
}
25+
@media (prefers-color-scheme: dark) {
26+
:root {
27+
--bg: #0b0b0c;
28+
--fg: #f1f1ee;
29+
--muted: #8f8f8b;
30+
--line: #232325;
31+
--button-bg: #f1f1ee;
32+
--button-fg: #0b0b0c;
33+
}
34+
}
35+
* { box-sizing: border-box; margin: 0; padding: 0; }
36+
body {
37+
background: var(--bg);
38+
color: var(--fg);
39+
font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
40+
-webkit-font-smoothing: antialiased;
41+
}
42+
main { max-width: 32rem; margin: 0 auto; padding: 5rem 1rem 3rem; text-align: center; }
43+
.icon { width: 104px; height: 104px; display: block; margin: 0 auto; }
44+
h1 { font-size: 2rem; font-weight: 650; letter-spacing: -0.02em; margin-top: 1.25rem; }
45+
.tagline { color: var(--muted); margin-top: 0.35rem; }
46+
.download {
47+
display: inline-block;
48+
margin-top: 2rem;
49+
padding: 0.8rem 1.6rem;
50+
border-radius: 999px;
51+
background: var(--button-bg);
52+
color: var(--button-fg);
53+
font-weight: 600;
54+
text-decoration: none;
55+
}
56+
.download:hover { opacity: 0.85; }
57+
.meta { color: var(--muted); font-size: 0.8125rem; margin-top: 0.8rem; }
58+
.preview { margin-top: 3.5rem; }
59+
.preview img { display: block; width: 100%; max-width: 474px; height: auto; margin: 0 auto; border-radius: 18px; }
60+
.features { list-style: none; margin-top: 3rem; display: grid; gap: 0.4rem; }
61+
.note {
62+
color: var(--muted);
63+
font-size: 0.8125rem;
64+
margin-top: 3rem;
65+
padding-top: 1.5rem;
66+
border-top: 1px solid var(--line);
67+
}
68+
footer { color: var(--muted); font-size: 0.8125rem; margin-top: 1rem; }
69+
footer a { color: inherit; }
70+
</style>
71+
</head>
72+
<body>
73+
<main>
74+
<img class="icon" src="icon.png" alt="">
75+
<h1>Better World Clock</h1>
76+
<p class="tagline">A better world clock for your Mac's desktop and menu bar.</p>
77+
78+
<a class="download" id="download" href="https://github.com/mxshell/BetterWorldClock/releases/latest">Download for Mac</a>
79+
<p class="meta"><span id="version"></span>Free · macOS 26 or later · Apple silicon and Intel</p>
80+
81+
<div class="preview">
82+
<picture>
83+
<source media="(prefers-color-scheme: dark)" srcset="preview-dark.png">
84+
<img src="preview-light.png" width="474" height="340"
85+
alt="Better World Clock showing San Francisco, New York City, London and Singapore, with the cities where it is night shaded">
86+
</picture>
87+
</div>
88+
89+
<ul class="features">
90+
<li>Your cities, in time zone order.</li>
91+
<li>Weather, and the next sunrise or sunset.</li>
92+
<li>On your desktop and in your menu bar.</li>
93+
</ul>
94+
95+
<p class="note">Open the disk image and drag World Clock+ to Applications. The first time you open it, go to System Settings › Privacy &amp; Security and click Open Anyway.</p>
96+
<footer>
97+
<a href="https://github.com/mxshell/BetterWorldClock">Source on GitHub</a> · MIT License ·
98+
Weather by <a href="https://open-meteo.com">Open-Meteo</a>
99+
</footer>
100+
</main>
101+
102+
<script>
103+
// Point the button straight at the latest disk image and show its version.
104+
// Without this (offline, rate limited, no JavaScript) the button opens the latest release page.
105+
fetch("https://api.github.com/repos/mxshell/BetterWorldClock/releases/latest")
106+
.then((response) => (response.ok ? response.json() : Promise.reject(response.status)))
107+
.then((release) => {
108+
const dmg = release.assets.find((asset) => asset.name.endsWith(".dmg"));
109+
if (dmg) document.getElementById("download").href = dmg.browser_download_url;
110+
document.getElementById("version").textContent = "Version " + release.tag_name.replace(/^v/, "") + " · ";
111+
})
112+
.catch(() => {});
113+
</script>
114+
</body>
115+
</html>

0 commit comments

Comments
 (0)