Skip to content

Commit

Permalink
feat(ui): 下载页面 | Dev 0.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim-Lin-4549 committed Feb 7, 2025
1 parent 76f6497 commit 913fda2
Show file tree
Hide file tree
Showing 56 changed files with 772 additions and 85 deletions.
8 changes: 8 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 开发环境 Flag 配置文件

# 禁用刷新
VITE_FLAG_DISABLE_REFRESH = false
# 禁用历史
VITE_FLAG_DISABLE_HISTORY = true
# 禁用开发者工具
VITE_FLAG_DISABLE_DEVTOOLS = false

# 启动音效
VITE_FLAG_LAUNCH_SOUND = false
14 changes: 11 additions & 3 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
FLAG_DISABLE_REFRESH = true
FLAG_DISABLE_HISTORY = true
FLAG_DISABLE_DEVTOOLS = true
## 生产环境 Flag 配置文件

# 禁用刷新
VITE_FLAG_DISABLE_REFRESH = true
# 禁用历史
VITE_FLAG_DISABLE_HISTORY = true
# 禁用开发者工具
VITE_FLAG_DISABLE_DEVTOOLS = true

# 启动音效
VITE_FLAG_LAUNCH_SOUND = true
File renamed without changes.
65 changes: 65 additions & 0 deletions .github/workflows/publish_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: 'Publish App'

on:
push:
branches:
- build/dev
- build/beta
- build/release

# This workflow will trigger on each push to the build branchs to create or update a GitHub release, build your app, and upload the artifacts to the release.

jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04.
args: ''
- platform: 'windows-latest'
args: ''

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4

- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: install Rust Nightly
uses: dtolnay/rust-toolchain@nightly
with:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}

- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
# webkitgtk 4.1 is for Tauri v2.

- name: install frontend dependencies
run: | # change this to npm, pnpm or bun depending on which one you use.
npm install -g pnpm
pnpm install
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: __VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: __VERSION__
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ package-lock.json
pnpm-lock.yaml
yarn.lock

# user-specifc:wuliaodexiaoluo
# Local Files
taupd.js
41 changes: 41 additions & 0 deletions docs/CODE_OF_CONDUCT
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
1. 尊重与包容
我们鼓励所有成员互相尊重,无论其背景、性别、种族、宗教、性取向、经验水平或身份。每个成员都应该在尊重他人的前提下进行交流和互动。

2. 零容忍骚扰
任何形式的骚扰,包括但不限于恶意评论、辱骂、歧视性言论、骚扰行为等,都是不被接受的。我们致力于创建一个没有恐惧和歧视的环境。所有的成员都应感到安全、受尊重。

3. 专业交流
我们鼓励清晰、友好、建设性的交流。请确保你的言辞礼貌、专业并且富有同理心。对于不同意见,尊重对方的观点并以开放的心态进行讨论。

4. 保持公开透明
我们鼓励成员之间进行透明的沟通,尤其是在决定如何改进项目或解决问题时。任何工作进展、决策和问题应尽可能公开,并且在适当的情况下向社区汇报。

5. 安全与隐私
请不要发布任何可能侵犯他人隐私的内容,包括但不限于个人信息、私人对话或未经授权的敏感数据。尊重每个人的隐私权和自由。

6. 遵守法律与平台政策
所有成员必须遵守适用的法律法规,以及所在平台(如 GitHub、QQ 等)或社区的使用政策。

7. 反对恶意行为
任何形式的恶意攻击、垃圾邮件、广告推广或其他不正当行为都不被允许。这包括针对他人的虚假陈述、恶意破坏等。

8. 处理冲突
如果你目睹或成为行为不当的受害者,请通过以下方式处理冲突:

- 直接与相关方沟通,尽量解决问题。
- 如果问题无法解决,请联系项目维护者或管理者。
- 项目维护者将会遵循公开透明的程序来解决问题。

9. 违规行为处理
对于违反行为准则的行为,项目维护者有权采取以下措施:

- 警告并要求改正行为。
- 暂时禁言或移除访问权限。
- 永久禁言或封禁账号,视情况而定。

10. 联系方式
如果你有任何问题或需要报告行为问题,请通过以下方式与我们联系:

邮箱: [email protected]
聊天平台: https://qm.qq.com/q/2JmrfMPbi8
我们鼓励大家共同维护一个友好、开放、健康的社区环境!
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pcl2-nova-app",
"private": true,
"version": "0.2.1",
"version": "0.2.2",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -12,9 +12,7 @@
"dependencies": {
"@tauri-apps/api": "^2",
"@tauri-apps/plugin-opener": "^2",
"vue": "^3.5.13",
"chalk": "^5.4.1",
"inquirer": "^12.3.3"
"vue": "^3.5.13"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.0.0",
Expand All @@ -29,6 +27,7 @@
"tailwindcss": "^4.0.0",
"typescript": "~5.6.2",
"vite": "^6.0.11",
"vite-plugin-vue-devtools": "^7.7.1",
"vue-router": "^4.5.0",
"vue-tsc": "^2.1.10"
}
Expand Down
File renamed without changes
File renamed without changes
Binary file added public/Images/Icons/Fabric.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Images/Icons/Forge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Images/Icons/Iris.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Images/Icons/NeoForge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Images/Icons/Oculus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Images/Icons/OptiFine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Images/Icons/Quilt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "Plain_Craft_Launcher_2_Nova"
version = "0.2.1"
version = "0.2.2"
description = "A cross-platform Minecraft Launcher, rewrite from PCL"
authors = ["PCL-Community"]
edition = "2021"
Expand Down
4 changes: 1 addition & 3 deletions src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"windows": [
"main"
],
"windows": ["main"],
"permissions": [
"core:default",
"core:window:allow-start-dragging",
Expand Down
12 changes: 9 additions & 3 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Plain Craft Launcher 2 Nova Dev",
"version": "0.2.1",
"version": "0.2.2",
"identifier": "nova.pcl2.app",
"build": {
"devUrl": "http://localhost:1420",
Expand All @@ -27,6 +27,12 @@
"bundle": {
"active": true,
"targets": "all",
"icon": ["icons/32x32.png", "icons/128x128.png", "icons/[email protected]", "icons/icon.icns", "icons/icon.ico"]
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/[email protected]",
"icons/icon.icns",
"icons/icon.ico"
]
}
}
}
16 changes: 13 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
<script lang="ts" setup>
import { onMounted } from "vue";
import { ModEventBus } from "./modules/ModEventBus";
import { LogLevel } from "./modules/rust/ModLogger";
import metadata from "./metadata.json"
import LayoutHeader from "./ui/layouts/LayoutHeader.vue";
onMounted(() => {
const welcome = new Audio("/Popup.SAO.Welcome.wav");
welcome.volume = 0.35;
welcome.play();
if (JSON.parse(import.meta.env.VITE_FLAG_LAUNCH_SOUND)) {
const welcome = new Audio("/Popup.SAO.Welcome.wav");
welcome.volume = 0.35;
welcome.play();
}
ModEventBus.emit("logger:modify", "log.txt");
ModEventBus.emit("logger:log", {
message: `PCL II: Nova [渠道 ${metadata.channel} | 版本 ${metadata.version}] 已启动!`,
level: LogLevel.INFO,
});
});
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/app/FrmDownloads.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<template>
<section class="h-[calc(100vh-calc(var(--spacing)*14))] flex">
<LayoutLeft class="basis-42" />
<section class="basis-full w-full h-full p-4">
<section class="subrouter basis-full w-full h-full p-4">
<RouterView />
</section>
</section>
Expand Down
1 change: 0 additions & 1 deletion src/app/FrmHome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@
</section>
</template>

<style lang="scss" scoped></style>
2 changes: 1 addition & 1 deletion src/app/FrmLinks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<template>
<section class="h-[calc(100vh-calc(var(--spacing)*14))] flex">
<LayoutLeft class="basis-36" />
<section class="basis-full w-full h-full p-4">
<section class="subrouter basis-full w-full h-full p-4">
<RouterView />
</section>
</section>
Expand Down
2 changes: 1 addition & 1 deletion src/app/FrmOthers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<template>
<section class="h-[calc(100vh-calc(var(--spacing)*14))] flex">
<LayoutLeft class="basis-44" />
<section class="basis-full w-full h-full p-4 overflow-y-auto">
<section class="subrouter basis-full w-full h-full p-4 overflow-y-auto">
<RouterView />
</section>
</section>
Expand Down
2 changes: 1 addition & 1 deletion src/app/FrmSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<template>
<section class="h-[calc(100vh-calc(var(--spacing)*14))] flex">
<LayoutLeft class="basis-36" />
<section class="basis-full w-full h-full p-4">
<section class="subrouter basis-full w-full h-full p-4">
<RouterView />
</section>
</section>
Expand Down
17 changes: 13 additions & 4 deletions src/assets/style.css → src/assets/style.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@font-face {
font-family: PCL;
src: url("/font.ttf");
src: url("/PCL-English.ttf");
}

* {
Expand All @@ -12,11 +12,20 @@ body div#app main {
transition: all 0.15s ease-in-out;
opacity: 100%;
transform: translateX(0%);

&.fadeout {
opacity: 0%;
transform: translateX(-100%);
}
}

body div#app main.fadeout {
opacity: 0%;
transform: translateX(-100%);
body div#app section.subrouter {
transition: all 0.15s ease-in-out;
opacity: 100%;

&.fadeout {
opacity: 0%;
}
}

*::-webkit-scrollbar {
Expand Down
4 changes: 0 additions & 4 deletions src/assets/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,3 @@

--color-btn-hover: #0007;
}

* {
user-select: none;
}
15 changes: 5 additions & 10 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,34 @@
import { createApp } from "vue";
import App from "./App.vue";
import router from "./modules/ModRouter.ts";
import { $env, booleanWrapper } from "./modules/ModUtils.ts";

createApp(App).use(router).mount("#app");

import "./assets/tailwind.css";
import "./assets/style.css";

const env = import.meta.env;
const booleanWrapper: Record<string, boolean> = {
true: true,
false: false,
};
import "./assets/style.scss";

(function () {
window.oncontextmenu = (e: MouseEvent) => e.preventDefault();
window.onkeydown = (e: KeyboardEvent) => {
// 禁用刷新:[F5, Ctrl + R, Ctrl + Shift + R]
if (
booleanWrapper[env.VITE_FLAG_DISABLE_REFRESH] &&
booleanWrapper[$env.VITE_FLAG_DISABLE_REFRESH] &&
(e.key === "F5" || (e.ctrlKey && e.key.toLowerCase() === "r") || (e.ctrlKey && e.shiftKey && e.key.toLowerCase() === "r"))
) {
e.preventDefault();
}
// 禁用历史切换:Alt + [↑, ↓, ←, →]
if (
booleanWrapper[env.VITE_FLAG_DISABLE_HISTORY] &&
booleanWrapper[$env.VITE_FLAG_DISABLE_HISTORY] &&
e.altKey &&
["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(e.key)
) {
e.preventDefault();
}
// 禁用在构建中的 DevTools
if (
booleanWrapper[env.VITE_FLAG_DISABLE_DEVTOOLS] &&
booleanWrapper[$env.VITE_FLAG_DISABLE_DEVTOOLS] &&
(e.key === "F12" || (e.ctrlKey && e.shiftKey && e.key.toLowerCase() === "i"))
) {
e.preventDefault();
Expand Down
2 changes: 1 addition & 1 deletion src/metadata.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "0.2.1",
"version": "0.2.2",
"channel": "Dev"
}
Loading

0 comments on commit 913fda2

Please sign in to comment.