Skip to content

Commit fbd6814

Browse files
authored
Merge pull request #160 from our-mini-games/dev
Feat: add arkanoid
2 parents 620d2f0 + e742524 commit fbd6814

File tree

24 files changed

+3860
-3503
lines changed

24 files changed

+3860
-3503
lines changed

.github/workflows/arkanoid.ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Deploy arkanoid page
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- 'packages/arkanoid/**'
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
jobs:
15+
# Single deploy job since we're just deploying
16+
deploy:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: '16'
24+
- uses: pnpm/action-setup@v2
25+
with:
26+
version: 7.13.4
27+
28+
- name: Build and deploy
29+
run: |
30+
cd ./packages/arkanoid
31+
pnpm install
32+
pnpm run build
33+
echo "==========Move dist to root=========="
34+
mkdir -p ../../dist/arkanoid
35+
cp -r dist/* ../../dist/arkanoid
36+
37+
- name: Deploy to GitHub Pages
38+
uses: peaceiris/actions-gh-pages@v4
39+
with:
40+
github_token: ${{ secrets.GITHUB_TOKEN }}
41+
publish_dir: ./dist
42+
keep_files: true # 保留之前构建的文件

packages/arkanoid/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_APP_PATHNAME = /

packages/arkanoid/.env.production

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_APP_PATHNAME = /mini-games/arkanoid/

packages/arkanoid/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

packages/arkanoid/index.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html>
2+
<html lang="zh-CN">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/mini-games/arkanoid.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
7+
<title>打砖块</title>
8+
</head>
9+
<body>
10+
<div id="app">
11+
<header class="header">
12+
<button class="btn btn-back">退出</button>
13+
<h1 class="title">打砖块</h1>
14+
<button class="btn btn-restart">重新开始</button>
15+
</header>
16+
<main class="arkanoid"></main>
17+
<footer class="footer">
18+
<div class="controls">
19+
<button class="btn btn-left">向左走</button>
20+
<button class="btn btn-ctrl">开始游戏</button>
21+
<button class="btn btn-right">向右走</button>
22+
</div>
23+
</footer>
24+
</div>
25+
<script type="module" src="/src/main.ts"></script>
26+
</body>
27+
</html>

packages/arkanoid/package.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "arkanoid",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite --host --port 5174",
8+
"build": "tsc && vite build",
9+
"preview": "vite preview"
10+
},
11+
"devDependencies": {
12+
"@types/cannon": "^0.1.13",
13+
"@types/three": "^0.174.0",
14+
"typescript": "^4.6.4",
15+
"vconsole": "^3.15.1",
16+
"vite": "^3.2.0"
17+
},
18+
"dependencies": {
19+
"cannon": "^0.6.2",
20+
"hammerjs": "^2.0.8",
21+
"three": "^0.174.0",
22+
"unit-path": "^0.0.4"
23+
}
24+
}
66 KB
Loading
3.81 KB
Loading
3.44 KB
Loading
3.29 KB
Loading

0 commit comments

Comments
 (0)