Skip to content

Commit f07ade9

Browse files
committed
[shared] feat: welcome (元旦快乐~)
1 parent 3fe1343 commit f07ade9

31 files changed

Lines changed: 319 additions & 166 deletions

File tree

apps/app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"frontend:build": "vue-tsc --noEmit && rsbuild build",
1212
"frontend:preview": "rsbuild preview",
1313
"lint": "eslint; prettier --check .",
14-
"fix": "eslint --fix;prettier --write --list-different .",
15-
"test": "tsc --noEmit"
14+
"fix": "eslint --fix; prettier --write --list-different .",
15+
"test": "vue-tsc --noEmit"
1616
},
1717
"dependencies": {
1818
"@repo/configs": "workspace:*",

apps/app/src/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { platform } from "@tauri-apps/plugin-os";
33
import { getCurrentWindow } from "@tauri-apps/api/window";
44
import { ref, watchEffect } from "vue";
55
import App from "./App.vue";
6+
import { exit } from "@tauri-apps/plugin-process";
67

78
export const fullscreen = ref(false);
89

@@ -23,5 +24,11 @@ export const fullscreen = ref(false);
2324
document.body.style.background = "transparent";
2425
}
2526

26-
await load("app", App);
27+
await load(
28+
"app",
29+
() => {
30+
exit();
31+
},
32+
App,
33+
);
2734
})();

apps/app/tsconfig.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
22
"extends": "@repo/configs/ts/vue.json",
3-
"include": [
4-
"src-frontend/**/*.ts",
5-
"src-frontend/**/*.d.ts",
6-
"src-frontend/**/*.tsx",
7-
"src-frontend/**/*.vue"
8-
],
3+
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
94
"references": [
105
{
116
"path": "./tsconfig.node.json"

apps/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"frontend:preview": "rsbuild preview",
1313
"lint": "eslint; prettier --check .; cargo lint",
1414
"fix": "eslint --fix;prettier --write --list-different .; cargo fix",
15-
"test": "tsc --noEmit && cargo test"
15+
"test": "vue-tsc --noEmit && cargo test"
1616
},
1717
"dependencies": {
1818
"@repo/configs": "workspace:*",

apps/web/src-frontend/index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ import router from "@repo/shared/src/router.ts";
44
import { useAccount } from "./utils/store.ts";
55

66
(async () => {
7-
await load("web", App);
7+
await load(
8+
"web",
9+
() => {
10+
window.close();
11+
location.replace("about:blank");
12+
document.body.innerHTML = "";
13+
},
14+
App,
15+
);
816

917
router.beforeEach((to, _from, next) => {
1018
if (useAccount().loggedIn) {

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"shared:lint": "turbo run shared#lint",
2424
"build": "turbo run build",
2525
"lint": "turbo run lint",
26-
"fix": "turbo run fix"
26+
"fix": "turbo run fix",
27+
"test": "turbo run test"
2728
},
2829
"devDependencies": {
2930
"prettier": "^3.6.2",

packages/shared/src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const layout = computed(() => {
2020
<template>
2121
<component v-if="layout" :is="layout" />
2222
<RouterView v-else v-slot="{ Component }">
23-
<transition name="fade" mode="in-out">
23+
<transition name="fade" mode="in-out" :duration="250">
2424
<component :is="Component" />
2525
</transition>
2626
</RouterView>
Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,49 @@
11
<script setup lang="ts">
22
import { useI18n } from "vue-i18n";
33
import FancyBackground from "@repo/ui/src/components/misc/FancyBackground.vue";
4-
import { onMounted } from "vue";
54
import { getPlatform } from "../../index.ts";
6-
import router from "../../router.ts";
7-
import { usePageData } from "../../utils/stores.ts";
85
96
const t = useI18n().t;
10-
11-
onMounted(() => {
12-
setTimeout(() => {
13-
router.push("/welcome/setup");
14-
}, 3400);
15-
});
167
</script>
178

189
<template>
19-
<FancyBackground>
20-
<div class="logo">
21-
<img src="../../assets/MCSL.png" alt="" />
22-
<div>
23-
<h1>
24-
{{ t("shared.app.name.abbr") }} {{ t("shared.app.name.future") }}
25-
{{ t(`${getPlatform()}.app.name.suffix`) }}
26-
</h1>
27-
<h2>{{ t("shared.app.desc") }}</h2>
10+
<div class="welcome-overlay">
11+
<FancyBackground>
12+
<div class="welcome-overlay__logo">
13+
<img src="../../assets/MCSL.png" alt="" width="98" />
14+
<div>
15+
<h1>
16+
{{ t("shared.app.name.abbr") }} {{ t("shared.app.name.future") }}
17+
{{ t(`${getPlatform()}.app.name.suffix`) }}
18+
</h1>
19+
<h2>{{ t("shared.app.desc") }}</h2>
20+
</div>
2821
</div>
29-
</div>
30-
</FancyBackground>
22+
</FancyBackground>
23+
</div>
3124
</template>
3225

3326
<style scoped lang="scss">
34-
.logo {
27+
.welcome-overlay {
28+
z-index: 1000;
29+
width: 100vw;
30+
height: 100vh;
31+
position: fixed;
32+
top: 0;
33+
left: 0;
34+
background: var(--mcsl-bg-color-main);
35+
animation: 0.5s ease-in-out 3s both welcome-overlay__out-anim;
36+
}
37+
38+
.welcome-overlay__logo {
3539
display: flex;
3640
align-items: center;
3741
justify-content: center;
3842
gap: var(--mcsl-spacing-xs);
3943
4044
& > img {
4145
width: 7rem;
42-
animation:
43-
0.5s ease-in-out 0.5s both zoomIn,
44-
0.5s ease-in-out 3s fadeOut;
46+
animation: 0.5s ease-in-out 0.5s both zoomIn;
4547
}
4648
4749
& > div {
@@ -72,9 +74,7 @@ onMounted(() => {
7274
overflow: hidden;
7375
height: 100%;
7476
max-width: 0;
75-
animation:
76-
1s ease-in-out 1s both collapseInHorizontal,
77-
0.5s ease-in-out 3s fadeOut;
77+
animation: 1s ease-in-out 1s both collapseInHorizontal;
7878
}
7979
}
8080
@@ -84,17 +84,23 @@ onMounted(() => {
8484
align-items: center;
8585
8686
& > h1 {
87-
animation:
88-
0.5s ease-in-out 1s both fadeInUp,
89-
0.5s ease-in-out 3s fadeOut;
87+
animation: 0.5s ease-in-out 1s both fadeInUp;
9088
}
9189
9290
& > h2 {
93-
animation:
94-
0.5s ease-in-out 1.25s both fadeInUp,
95-
0.5s ease-in-out 3s fadeOut;
91+
animation: 0.5s ease-in-out 1.25s both fadeInUp;
9692
}
9793
}
9894
}
9995
}
96+
97+
@keyframes welcome-overlay__out-anim {
98+
from {
99+
opacity: 1;
100+
}
101+
to {
102+
opacity: 0;
103+
pointer-events: none;
104+
}
105+
}
100106
</style>

packages/shared/src/dev-entry.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,13 @@ import router from "./router.ts";
88
redirect: "/dashboard",
99
});
1010

11-
load("web", App);
11+
load(
12+
"web",
13+
() => {
14+
window.close();
15+
location.replace("about:blank");
16+
document.body.innerHTML = "";
17+
},
18+
App,
19+
);
1220
})();

0 commit comments

Comments
 (0)