Skip to content

Frontend style - #7

Merged
su-nz merged 13 commits into
mainfrom
frontend-style
Jun 17, 2026
Merged

Frontend style#7
su-nz merged 13 commits into
mainfrom
frontend-style

Conversation

@su-nz

@su-nz su-nz commented Jun 17, 2026

Copy link
Copy Markdown
Owner

No description provided.

su-nz and others added 13 commits May 19, 2026 14:18
- Create index.html for the NTNU Visual Toolbox, featuring a tool registration system.
- Implement ntnu-theme.css for shared styling across the application.
- Introduce ntnu-ui.js for UI helpers including toast notifications, modals, and drag-and-drop functionality.
- Add various visual identity assets for the toolbox.
- Document project status and future tasks in todo.md.
- _middleware.js:子網域目錄式 URL(如 /deskcard)以結尾斜線導向其 index;
  bucket 子目錄靜態檔(如 /deskcard/app.js)導入 _sites/<bucket>/,
  根目錄圖檔與 /assets/* 維持共用 apex
- [id].js:對已被改寫為 /_sites/ 的請求放行,避免子網域單段路徑
  被短碼處理器當成短碼而 404

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- 導入精確品牌色票:maroon #93272c、ink #2d2926、cool-gray 系列、navy #003865
- maroon→bright-red 漸層取代舊粉紅;maroon masthead 導覽列;ink footer
- 新增招牌「像素馬賽克帶」motif(hero 接縫與 footer 上緣)
- 按鈕/輸入框 4px 圓角、卡片 8–12px、soft-lift 陰影
- 字體改 Helvetica Neue/Arial + 系統黑體;移除 hero 加號紋路
- 評分星/QR 改品牌 maroon、計數脈衝去金色;既有 GSAP 動畫完整保留
- 新增 ntnu.style 品牌設計參考文件

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 17, 2026 04:50
@su-nz
su-nz merged commit 77049e3 into main Jun 17, 2026
1 check passed
@su-nz
su-nz deleted the frontend-style branch June 17, 2026 04:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a front-end “style system” + host-based routing to support a new tools.ntnu.cc toolbox (static Pages site) alongside the existing ntnu.cc shortener, and adds the first tool (deskcard generator) plus supporting shared assets and documentation/spec.

Changes:

  • Add tools.ntnu.cc hub + A4 deskcard generator (pure front-end import + PDF export) under public/_sites/tools/*.
  • Introduce shared front-end assets (ntnu-theme.css, ntnu-ui.js, colors.json) and an unofficial brand reference (ntnu.style).
  • Update Pages middleware/routing to rewrite subdomain requests into /_sites/<bucket>/... while keeping the shortener behavior intact.

Reviewed changes

Copilot reviewed 13 out of 47 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
todo.md Implementation notes/checklist for SPEC2 + known risks to validate.
SPEC2.md New v2 system specification describing tools subdomain + architecture.
public/index.html Homepage restyle + GSAP reveal animations + toolbox nav link.
public/assets/ntnu-vi/colors.json Adds fetchable VI color palette JSON for tool sub-sites.
public/assets/ntnu-vi/B109.png Adds VI image asset.
public/assets/ntnu-vi/A707_modified.png Adds VI image asset variant.
public/assets/ntnu-ui.js Adds shared UI helper (toast/modal/dropzone/copyText).
public/assets/ntnu-theme.css Adds shared theme CSS used by tools pages.
public/_sites/tools/index.html Adds tools hub page + in-page tool registry.
public/_sites/tools/deskcard/sample.csv Adds sample CSV for import format.
public/_sites/tools/deskcard/index.html Adds deskcard tool UI (import/edit/preview/export).
public/_sites/tools/deskcard/app.js Adds deskcard logic (records, import, localStorage, html2canvas+jsPDF export).
ntnu.style Adds unofficial brand reference document for palette/typography/components.
functions/[id].js Avoids treating /_sites/* paths as shortcodes by passing through.
functions/_middleware.js Adds host-based rewrite (subdomain → /_sites/<bucket>/...) and static-file handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread functions/_middleware.js
const pathname = url.pathname;

// 跳過靜態檔案,讓 Cloudflare Pages 直接處理
const host = (request.headers.get('host') || url.host || '').toLowerCase();
Comment thread functions/_middleware.js
Comment on lines +28 to +30
// 靜態檔案:原則上交給 Cloudflare Pages 直接處理(子網域共用 apex 的 /assets/* 與根目錄圖檔)。
// 但 bucket 子目錄內的靜態檔(例如 tools.ntnu.cc/deskcard/app.js)必須先導入 _sites/<bucket>/,
// 否則會被當成 apex 路徑而 404。策略:子網域先試 bucket 內同路徑,找不到再退回共用 apex。
Comment thread public/assets/ntnu-ui.js
Comment on lines +41 to +43
const body = overlay.querySelector('.ntnu-modal-body');
if (typeof opts.content === 'string') body.innerHTML = opts.content;
else if (opts.content instanceof Node) body.appendChild(opts.content);
Comment on lines +5 to +9
:root {
--primary: #9B2335;
--primary-dark: #7A1C2A;
--primary-light: #C94C5C;
--bg-gradient: linear-gradient(135deg, #9B2335 0%, #B83A4B 50%, #C94C5C 100%);
{
"_meta": {
"name": "NTNU 視覺識別色票",
"source": "依師大紅 #9B2335 為主軸延伸,搭配既有 ntnu.cc 設計系統使用",
Comment on lines +7 to +10
"primary": {
"ntnuRed": { "hex": "#9B2335", "name": "師大紅", "usage": "主色、強調、CTA" },
"ntnuRedDark": { "hex": "#7A1C2A", "name": "師大深紅", "usage": "hover / 重點文字" },
"ntnuRedLight": { "hex": "#C94C5C", "name": "師大粉紅", "usage": "漸層、次要強調" }
},
"gradients": {
"primary": {
"css": "linear-gradient(135deg, #9B2335 0%, #B83A4B 50%, #C94C5C 100%)",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants