Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Preserve the accepted upstream standalone viewer bytes on every platform.
public/architecture/hex-tactics/*.html -text
15 changes: 12 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: Deploy static site to GitHub Pages
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
group: pages-${{ github.ref }}
cancel-in-progress: false

jobs:
Expand All @@ -27,16 +27,25 @@ jobs:
cache: npm
- name: Install dependencies
run: npm ci
- name: Verify accepted architecture bundle
run: node scripts/check-architecture-bundle.mjs
- name: Build
run: npm run build
env:
NEXT_PUBLIC_GOATCOUNTER_CODE: ${{ vars.GOATCOUNTER_CODE }}
- name: Verify architecture files survive static export
run: node scripts/check-architecture-bundle.mjs --export
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: out

deploy:
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ npm run dev
3. Push to `main`; the workflow at `.github/workflows/deploy.yml` will publish the generated `out/` folder.
4. Add a custom domain later in GitHub Pages settings when the domain is ready.

## Interactive architecture

The Projects page links to the Hex Tactics Archify viewers:

- Chinese: https://bibi45c.github.io/architecture/hex-tactics/
- English: https://bibi45c.github.io/architecture/hex-tactics/en.html

These self-contained HTML files are published from `public/architecture/hex-tactics/` without modifying their accepted upstream bytes. Editable JSON and source evidence remain in [the game repository](https://github.com/bibi45c/UEA-CMP-SEM2-GAME-Turn_Based_Strategy); `provenance.json` records the delivery commit, architecture evidence commit and file hashes. Do not hand-edit the generated viewers. To refresh them, validate and deliver in the game repository, copy the accepted HTML/preview files here and update the provenance hashes. Run `node scripts/check-architecture-bundle.mjs`, build, then run it again with `--export` before publishing.

The older `/UEA-CMP-SEM2-GAME-Turn_Based_Strategy/` and `/UEA-CMP-SEM2-GAME-Turn_Based_Strategy/en.html` paths redirect to these blog-hosted viewers, keeping existing game README links usable. No separate game-repository Pages site or DNS change is needed. If a separate game Pages site is enabled later, it may take precedence over those compatibility paths; use the canonical architecture URLs above.

## Visit counts

The site uses GoatCounter for per-post counts and the site total. Create a GoatCounter
Expand Down
20 changes: 20 additions & 0 deletions app/project/page.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Description from "@/components/Description";
import MotionDivWrapper from "@/components/MotionDivWrapper";
import Image from "next/image";

export default function ProjectPage() {
return (
Expand All @@ -10,6 +11,25 @@ export default function ProjectPage() {
className="flex flex-col gap-10"
>
<Description page="Projects" />
<section className="max-w-3xl overflow-hidden rounded-2xl border border-foreground/15 bg-foreground/[0.03]">
<a href="/architecture/hex-tactics/en.html" aria-label="Open the Hex Tactics interactive architecture in English">
<picture>
<source media="(prefers-color-scheme: dark)" srcSet="/architecture/hex-tactics/preview-dark.png" />
<Image src="/architecture/hex-tactics/preview-light.png" alt="Hex Tactics runtime architecture: exploration, shared combat rules and synchronous event feedback" width={1440} height={900} className="h-auto w-full" />
</picture>
</a>
<div className="p-6 text-sm leading-7 text-muted-foreground sm:p-8">
<h2 className="mb-3 text-xl font-semibold text-foreground">Hex Tactics — Interactive architecture / 交互架构图</h2>
<p>Explore the Unity tactical RPG&apos;s exploration and combat systems, shared rules and source references. Both language editions include theme controls, search and export.</p>
<p className="mt-2">查看探索与战斗系统、共用规则和源码证据。中英文版本均支持主题切换、搜索与导出。</p>
<nav aria-label="Hex Tactics architecture links" className="mt-5 flex flex-wrap gap-x-6 gap-y-3 font-medium text-foreground">
<a className="underline underline-offset-4" href="/architecture/hex-tactics/en.html">Open English →</a>
<a className="underline underline-offset-4" href="/architecture/hex-tactics/">打开中文 →</a>
<a className="underline underline-offset-4" href="https://github.com/bibi45c/UEA-CMP-SEM2-GAME-Turn_Based_Strategy">Source repository ↗</a>
</nav>
<p className="mt-5 text-xs">Architecture evidence: main 42f3a2b. This map is a pinned runtime snapshot, not a gameplay acceptance result.</p>
</div>
</section>
<section className="max-w-3xl rounded-2xl border border-foreground/15 bg-foreground/[0.03] p-8 text-sm leading-7 text-muted-foreground">
<p className="mb-4 text-foreground">Case studies are being prepared.</p>
<p>
Expand Down
14 changes: 14 additions & 0 deletions public/UEA-CMP-SEM2-GAME-Turn_Based_Strategy/en.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="refresh" content="0;url=/architecture/hex-tactics/en.html">
<link rel="canonical" href="https://bibi45c.github.io/architecture/hex-tactics/en.html">
<title>Hex Tactics — Interactive architecture</title>
</head>
<body>
<p>The viewer is now hosted on the blog. <a href="/architecture/hex-tactics/en.html">Open the English architecture</a></p>
<script>location.replace('/architecture/hex-tactics/en.html' + location.search + location.hash);</script>
</body>
</html>
14 changes: 14 additions & 0 deletions public/UEA-CMP-SEM2-GAME-Turn_Based_Strategy/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="refresh" content="0;url=/architecture/hex-tactics/">
<link rel="canonical" href="https://bibi45c.github.io/architecture/hex-tactics/">
<title>Hex Tactics — 交互架构图</title>
</head>
<body>
<p>架构图已迁移至博客。<a href="/architecture/hex-tactics/">打开中文架构图</a></p>
<script>location.replace('/architecture/hex-tactics/' + location.search + location.hash);</script>
</body>
</html>
22 changes: 22 additions & 0 deletions public/architecture/hex-tactics/ARCHIFY-LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2026 tt-a1i (Archify)
Copyright (c) 2025 Cocoon AI

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
15,019 changes: 15,019 additions & 0 deletions public/architecture/hex-tactics/en.html

Large diffs are not rendered by default.

15,019 changes: 15,019 additions & 0 deletions public/architecture/hex-tactics/index.html

Large diffs are not rendered by default.

Binary file added public/architecture/hex-tactics/preview-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions public/architecture/hex-tactics/provenance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"sourceRepository": "https://github.com/bibi45c/UEA-CMP-SEM2-GAME-Turn_Based_Strategy",
"deliveryRevision": "55ed3db26cce287c6326080a625e165723e430cc",
"evidenceRevision": "42f3a2b8d6bc3e4b847abec1f34cae841fda204d",
"generator": "Archify 2.17.0-dev.1",
"files": {
"index.html": {"source": "site/index.html", "sha256": "0c337d055885387bc23aaf8a6a513ffdea9cea3d26230c1606df3fcca26bf9f8"},
"en.html": {"source": "site/en.html", "sha256": "60f7cf49bd77fb530e9d87d550d12cb5b61d16dc87a62989694c372ac09d1e2a"},
"preview-light.png": {"source": "Docs/Architecture_Preview_EN.png", "sha256": "85a768e580fde30fb55adc1d3d3dff0b0dc93a3079fc74facf3c20b9e2cdeec9"},
"preview-dark.png": {"source": "Docs/Architecture_Preview_EN_Dark.png", "sha256": "2f529703847f78170c4c68a4d07dc6e784d6de16b29ebf32c4b494c6297696bb"}
}
}
37 changes: 37 additions & 0 deletions scripts/check-architecture-bundle.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import assert from 'node:assert/strict';
import { createHash } from 'node:crypto';
import { readFileSync } from 'node:fs';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';

const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
const bundle = 'architecture/hex-tactics/';
const read = (path) => readFileSync(resolve(root, path));
const manifest = JSON.parse(read(`public/${bundle}provenance.json`));
assert.match(manifest.deliveryRevision, /^[a-f0-9]{40}$/);
assert.match(manifest.evidenceRevision, /^[a-f0-9]{40}$/);
for (const [file, record] of Object.entries(manifest.files)) {
assert.ok(['index.html', 'en.html', 'preview-light.png', 'preview-dark.png'].includes(file));
const bytes = read(`public/${bundle}${file}`);
assert.equal(createHash('sha256').update(bytes).digest('hex'), record.sha256, file);
if (file.endsWith('.html')) {
const html = bytes.toString('utf8');
assert.ok(html.includes(manifest.evidenceRevision));
assert.ok(html.includes(file === 'en.html' ? '<html lang="en"' : '<html lang="zh-CN"'));
assert.ok(!/<(?:script|link)\b[^>]*(?:src|href)=["'](?:https?:)?\/\//i.test(html));
}
if (process.argv.includes('--export')) {
assert.ok(bytes.equals(read(`out/${bundle}${file}`)), `Static export changed ${file}`);
}
}
assert.equal(Object.keys(manifest.files).length, 4);
assert.ok(read(`public/${bundle}ARCHIFY-LICENSE.md`).toString('utf8').includes('MIT License'));
for (const [file, destination] of [['index.html', `/${bundle}`], ['en.html', `/${bundle}en.html`]]) {
const path = `UEA-CMP-SEM2-GAME-Turn_Based_Strategy/${file}`;
const bytes = read(`public/${path}`);
assert.ok(bytes.toString('utf8').includes(`url=${destination}`), `Invalid legacy redirect ${file}`);
if (process.argv.includes('--export')) assert.ok(bytes.equals(read(`out/${path}`)));
}
const projects = read(process.argv.includes('--export') ? 'out/project/index.html' : 'app/project/page.js').toString('utf8');
for (const path of [`/${bundle}`, `/${bundle}en.html`]) assert.ok(projects.includes(path));
console.log('Architecture bundle passed: accepted EN/ZH hashes, themes, license, project links and legacy redirects' + (process.argv.includes('--export') ? ', including static export.' : '.'));
Loading