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
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
* text=auto eol=lf

*.jpg binary
*.jpeg binary
*.png binary
*.webp binary
39 changes: 39 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: 2

updates:
- package-ecosystem: npm
directory: /
schedule:
interval: monthly
day: monday
time: "03:00"
timezone: Asia/Shanghai
open-pull-requests-limit: 5
groups:
development-dependencies:
dependency-type: development
patterns:
- "*"
commit-message:
prefix: chore
include: scope
labels:
- dependencies

- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
day: monday
time: "03:30"
timezone: Asia/Shanghai
open-pull-requests-limit: 5
groups:
github-actions:
patterns:
- "*"
commit-message:
prefix: chore
include: scope
labels:
- dependencies
183 changes: 183 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
name: Verify and deploy

on:
pull_request:
push:
branches:
- master
workflow_dispatch:

permissions:
contents: read

concurrency:
group: html-sample-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
validate:
name: Validate (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
steps:
- name: Check out repository
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5

- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
cache: npm

- name: Install locked dependencies
run: npm ci

- name: Run static checks
run: npm run check

- name: Run unit tests
run: npm run test:unit

- name: Audit high-severity dependencies
run: npm audit --audit-level=high

browser-linux:
name: Browser tests (Ubuntu)
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5

- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
cache: npm

- name: Install locked dependencies
run: npm ci

- name: Install browser engines
run: npx playwright install --with-deps chromium firefox webkit

- name: Run Linux browser and visual tests
run: npm run test:e2e:linux

- name: Upload browser diagnostics
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: playwright-ubuntu
path: test-results/
if-no-files-found: ignore
retention-days: 7

browser-windows:
name: Browser tests (Windows)
runs-on: windows-latest
steps:
- name: Check out repository
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5

- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
cache: npm

- name: Install locked dependencies
run: npm.cmd ci

- name: Install browser engines
run: npx.cmd playwright install chromium firefox

- name: Run Windows browser tests
run: npm.cmd run test:e2e:windows

- name: Upload browser diagnostics
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: playwright-windows
path: test-results/
if-no-files-found: ignore
retention-days: 7

lighthouse:
name: Lighthouse budgets
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5

- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
cache: npm

- name: Install locked dependencies
run: npm ci

- name: Run Lighthouse
run: npm run test:lighthouse

- name: Upload Lighthouse reports
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: lighthouse
path: test-results/lighthouse/
if-no-files-found: ignore
retention-days: 7

deploy:
name: Deploy GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs:
- validate
- browser-linux
- browser-windows
- lighthouse
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: read
id-token: write
pages: write
steps:
- name: Check out repository
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5

- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
cache: npm

- name: Install locked dependencies
run: npm ci

- name: Build publish directory
run: npm run build

- name: Configure Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
with:
enablement: true

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
with:
path: _site

- name: Deploy Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules/
_site/
test-results/
playwright-report/
.lighthouseci/

.DS_Store
Thumbs.db
*.log
17 changes: 17 additions & 0 deletions .htmlvalidate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": ["html-validate:recommended"],
"rules": {
"attribute-boolean-style": ["error", { "style": "omit" }],
"attribute-empty-style": ["error", { "style": "omit" }],
"doctype-style": ["error", { "style": "lowercase" }],
"no-inline-style": "error",
"no-redundant-role": "error",
"prefer-native-element": "error",
"void-style": ["error", { "style": "selfclosing" }],
"wcag/h30": "error",
"wcag/h32": "error",
"wcag/h37": "error",
"wcag/h63": "error",
"wcag/h71": "error"
}
}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules/
_site/
test-results/
playwright-report/
.lighthouseci/

assignment-1 2/css/Mutual evaluation.css
assignment-1 2/css/hw1 - old.css
assignment-1 2/css/hw1 - old2.css
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changelog

All notable changes to this project are documented here.

## [Unreleased]

### Added

- Unified bilingual gallery entry point.
- Accessible Learning Profile, Ultimate Field Notes, and Signal Conference examples.
- Zero-data registration form demonstration.
- Windows and Ubuntu CI, browser tests, visual snapshots, accessibility checks, and Lighthouse budgets.
- GitHub Pages deployment workflow and project documentation.

### Changed

- Replaced remote and unverified media with locally owned artwork.
- Rewrote course-derived copy and demo data with original content.
- Preserved every historical public path while modernizing active pages.
56 changes: 56 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Contributing

## Requirements

- Node.js 24 LTS
- npm supplied with Node.js
- Current Chrome, Edge, and Firefox on Windows for the full local matrix

Do not change Windows execution policy or environment variables for this project. In PowerShell, use `npm.cmd` when `npm.ps1` is disabled.

## Workflow

1. Create a focused branch from `master`.
2. Install exactly from the lockfile with `npm.cmd ci`.
3. Keep all existing compatibility paths available.
4. Add or update tests under `test/`.
5. Run the complete relevant test set before committing.
6. Open a pull request and wait for Windows and Ubuntu checks to pass.

## Required checks

```powershell
npm.cmd run check
npm.cmd run test:unit
npm.cmd run test:e2e:windows
npm.cmd run test:lighthouse
npm.cmd run build
```

Ubuntu CI additionally runs Chromium, Firefox, WebKit, mobile Chromium, and the committed screenshot baselines.

## Visual snapshots

Stable baselines live in `test/snapshots/`. Normal tests never overwrite them. Update them only after reviewing the visual change:

```powershell
npm.cmd run test:visual:update
```

Generated reports, failure screenshots, traces, and videos belong in `test-results/` and must not be committed.

## Content and privacy

- Use original copy and locally owned or clearly licensed assets.
- Record any third-party material in `THIRD_PARTY_NOTICES.md`.
- Do not add analytics, remote fonts, tracking pixels, form endpoints, cookies, or browser storage.
- Keep external links deliberate, HTTPS-only, and limited to authoritative references.

## HTML and accessibility

- Preserve landmark and heading order.
- Provide visible keyboard focus.
- Use native elements before ARIA.
- Give every form control a persistent label and useful error message.
- Verify layouts at 200% zoom and with Windows forced colors.
- Update `test/manual-accessibility.md` when behavior changes materially.
Loading
Loading