Skip to content

Commit 0e5eb52

Browse files
committed
feat: 合并main至dev
1 parent 4e1fe3b commit 0e5eb52

File tree

20 files changed

+1599
-314
lines changed

20 files changed

+1599
-314
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
contents: read
1616
strategy:
1717
matrix:
18-
node-version: [18.x]
18+
node-version: [20.x]
1919
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2020

2121
steps:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,4 @@ dist
128128
.yarn/build-state.yml
129129
.yarn/install-state.gz
130130
.pnp.*
131+
target

Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# 使用官方的 Node 镜像作为基础镜像
2+
FROM node:20.12.2
3+
4+
# 设置工作目录
5+
WORKDIR /usr/src/app
6+
7+
# 将本地的 Vite 项目文件复制到工作目录
8+
COPY . .
9+
10+
# 安装依赖
11+
12+
RUN npm install pnpm -g
13+
14+
RUN pnpm install
15+
16+
# 执行 Vite 构建命令,生成 dist 目录
17+
RUN pnpm build
18+
19+
# 使用 Nginx 镜像作为运行时镜像
20+
FROM nginx:1.26
21+
22+
# 修改nginx配置
23+
# 向 #error_page 前添加内容
24+
# location /log-lottery {
25+
# alias /usr/share/nginx/log-lottery;
26+
# index index.html index.htm;
27+
# try_files $uri $uri/ /log-lottery/index.html;
28+
# }
29+
RUN sed -i 's/#error_page/location \/log-lottery {\n alias \/usr\/share\/nginx\/log-lottery;\n index index.html index.htm;\n try_files $uri $uri\/ \/log-lottery\/index.html;\n }\n#error_page/' /etc/nginx/conf.d/default.conf
30+
31+
# 将 Vite 项目的 dist 目录复制到 Nginx 的默认静态文件目录
32+
COPY --from=0 /usr/src/app/dist /usr/share/nginx/log-lottery
33+
34+
# 暴露容器的 80 端口
35+
EXPOSE 80
36+
37+
# Nginx 会在容器启动时自动运行,无需手动设置 CMD

README.md

Lines changed: 60 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
<p align="center">
2-
<a href="http://www.form-create.com">
3-
<svg t="1704902663531" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4318" width="200" height="200"><path d="M433.230769 630.153846m-275.692307 0a275.692308 275.692308 0 1 0 551.384615 0 275.692308 275.692308 0 1 0-551.384615 0Z" fill="#E2FFFF" p-id="4319"></path><path d="M512 0C228.903385 0 0 228.903385 0 512s228.903385 512 512 512 512-228.903385 512-512S795.096615 0 512 0z m42.968615 938.653538V883.396923c0-27.608615-21.464615-46.040615-46.040615-46.040615-24.536615 0-46.040615 21.504-46.040615 46.08v55.21723c-196.450462-21.464615-356.036923-181.090462-377.540923-377.540923H140.603077c24.536615 0 46.040615-21.504 46.040615-46.08 0-24.536615-21.504-46.001231-46.08-46.00123H85.385846c18.392615-199.522462 178.018462-362.220308 377.540923-383.684923v61.36123c0 24.576 21.504 46.08 46.08 46.08 24.536615 0 46.001231-21.504 46.001231-46.08V85.346462c202.594462 21.464615 365.292308 181.090462 383.684923 383.684923h-61.361231c-27.648 0-46.08 18.392615-46.08 46.040615 0 24.536615 21.504 46.040615 46.08 46.040615h61.361231c-21.464615 199.522462-184.162462 359.148308-383.684923 377.540923z" fill="#437DFF" p-id="4320"></path><path d="M499.396923 291.170462a19.692308 19.692308 0 0 1 25.245539 0.039384l2.520615 2.520616 9.964308 12.169846C625.427692 414.208 669.538462 495.340308 669.538462 549.218462 669.538462 637.44 599.04 708.923077 512 708.923077s-157.538462-71.483077-157.538462-159.704615c0-49.900308 37.809231-123.155692 113.506462-219.72677l18.904615-23.630769 9.964308-12.130461a19.692308 19.692308 0 0 1 2.599385-2.56z m12.603077 110.434461l-9.570462 13.075692-13.23323 18.747077-11.815385 17.644308C447.763692 496.679385 433.230769 530.313846 433.230769 549.218462c0 44.937846 35.524923 80.935385 78.769231 80.935384 43.244308 0 78.769231-35.997538 78.769231-80.935384 0-16.305231-11.027692-43.992615-33.437539-81.053539l-10.318769-16.462769a790.843077 790.843077 0 0 0-11.697231-17.565539l-13.115077-18.668307-10.200615-13.863385z" fill="#437DFF" p-id="4321"></path></svg>
1+
<div align="center">
2+
<a href="https://log1997.github.io/log-lottery/">
3+
<img src="./static/images/lottery.png" width="100" height="100" />
44
</a>
5-
</p>
65

76
# log-lottery 🚀🚀🚀🚀
87

8+
[![MIT](https://img.shields.io/github/package-json/v/log1997/log-lottery)](https://github.com/LOG1997/log-lottery)
99
[![MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/LOG1997/log-lottery)
1010
[![github](https://img.shields.io/badge/Author-log1997-blue.svg)](https://github.com/log1997)
11-
[![vue3](https://img.shields.io/badge/VUE-3.0-green.svg)](https://github.com/log1997)
11+
[![vue3](https://img.shields.io/badge/VUE-3-green.svg)](https://github.com/log1997)
12+
[![build](https://img.shields.io/github/actions/workflow/status/log1997/log-lottery/node.js.yml)](https://github.com/log1997)
13+
14+
</div>
1215

1316
log-lottery是一个可配置可定制化的抽奖应用,炫酷3D球体,可用于年会抽奖等活动,支持奖品、人员、界面、图片音乐配置。
1417

1518
> 因原域名到期,现将原域名 (<https://24years.top/log-lottery>)
1619
迁移到 (<https://1kw20.fun/log-lottery>) 。
17-
如果进入到新域名遇到图片无法访问的情况,请到【全局配置】-【界面配置】菜单中点击【重置所有数据】按钮进行更新
20+
21+
> 如果进入网站遇到图片无法显示或有报错的情况,请先到【全局配置】-【界面配置】菜单中点击【重置所有数据】按钮清除数据后进行更新。
22+
23+
> 请尽量拉取代码进行构建部署,本线上网站代码会保持更新,可能影响原有功能和数据。
1824
1925
## 要求
2026

@@ -38,10 +44,13 @@ or
3844
- [x] 🖼️ excel表格导入人员名单、抽奖结果使用excel导出
3945
- [x] 🎈 可增加临时抽奖
4046
- [x] 🧨 国际化多语言
41-
- [ ] 添加docker构建部署和镜像
42-
- [ ] 更换背景图片
47+
- [x] 🍃 更换背景图片
48+
- [x] 🚅 添加docker构建
49+
- [x] 😘 弹幕(开发中)
50+
- [ ] 🧵 卡片组成多种形状
51+
4352
...
44-
需要更多功能请留言
53+
需要更多功能或发现bug请留言[issues](https://github.com/LOG1997/log-lottery/issues)
4554

4655
## 详细介绍
4756

@@ -105,24 +114,64 @@ or
105114

106115
```bash
107116
pnpm i
117+
or
118+
npm install
108119
```
109120

110121
开发运行
111122

112123
```bash
113124
pnpm dev
125+
or
126+
npm run dev
114127
```
115128

116129
打包
117130

118131
```bash
119132
pnpm build
133+
or
134+
npm run build
135+
```
136+
137+
预览
138+
139+
```bash
140+
pnpm preview
141+
or
142+
npm run preview
143+
```
144+
145+
若想直接以打开html文件的方式运行,请执行以下命令进行打包。打包完成后在dist目录中直接打开index.html即可。
146+
147+
```bash
148+
pnpm build:file
149+
or
150+
npm run build:file
120151
```
121152

122153
> 项目思路来源于 <https://github.com/moshang-xc/lottery>
123154
155+
## Docker支持
156+
157+
构建镜像
158+
159+
```bash
160+
docker build -t log-lottery .
161+
```
162+
163+
运行容器
164+
165+
```bash
166+
docker run -d -p 9279:80 log-lottery
167+
```
168+
169+
容器运行成功后即可在本地通过<http://localhost:9279/log-lottery/>访问
170+
171+
## Star History
172+
173+
[![Star History Chart](https://api.star-history.com/svg?repos=LOG1997/log-lottery&type=Date)](https://star-history.com/#LOG1997/log-lottery&Date)
174+
124175
## License
125176

126177
[MIT](http://opensource.org/licenses/MIT)
127-
128-
Copyright (c) 2024-present log1997

eslint.config.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import antfu from '@antfu/eslint-config'
22

33
export default antfu(
4-
{
5-
ignores: ['**/node_modules', '**/public', '**/dist', '**/package.json', '**/*.yaml', '**/.gitignore', '**/.env*', '**/tsconfig*']
6-
},
7-
{
8-
rules: {
9-
"no-console": [1],
10-
},
11-
},
12-
)
4+
{
5+
ignores: ['**/node_modules', '**/public', '**/dist', '**/package.json', '**/*.yaml', '**/.gitignore', '**/.env*', '**/tsconfig*'],
6+
},
7+
)

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"name": "log-lottery",
33
"private": true,
4-
"version": "0.0.2",
4+
"version": "0.0.3",
55
"type": "module",
66
"license": "MIT",
77
"scripts": {
88
"dev": "vite --host 0.0.0.0",
99
"build": "vue-tsc --noEmit && vite build",
1010
"build:pre": "vue-tsc --noEmit && vite build --mode prebuild",
11+
"build:file": "vue-tsc --noEmit && vite build --mode file",
1112
"test": "vitest",
1213
"test:ui": "vitest --ui",
1314
"preview": "vite preview",
@@ -52,6 +53,7 @@
5253
"@types/three": "^0.166.0",
5354
"@typescript-eslint/eslint-plugin": "^8.16.0",
5455
"@typescript-eslint/parser": "^8.16.0",
56+
"@vitejs/plugin-legacy": "^6.0.0",
5557
"@vitejs/plugin-vue": "^5.2.0",
5658
"@vitest/ui": "^2.1.5",
5759
"@vue/test-utils": "^2.4.6",

0 commit comments

Comments
 (0)