Skip to content

Commit df72edd

Browse files
committed
refactor: frontend
1 parent 6486723 commit df72edd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2236
-2230
lines changed

frontend/src/App.vue

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { ref } from 'vue'
33
44
import { EventsOn, WindowHide, IsStartup } from '@/bridge'
5-
import { NavigationBar, MainPage, TitleBar } from '@/components'
5+
import { NavigationBar, TitleBar } from '@/components'
66
import * as Stores from '@/stores'
77
import { exitApp, sampleID, sleep, message } from '@/utils'
88
import AboutView from '@/views/AboutView.vue'
@@ -89,20 +89,24 @@ appSettings.setupAppSettings().then(async () => {
8989

9090
<template>
9191
<SplashView v-if="loading">
92-
<div class="progress">
93-
<Progress
94-
:percent="percent"
95-
:status="hasError ? 'danger' : 'primary'"
96-
:radius="10"
97-
type="circle"
98-
/>
99-
</div>
92+
<Progress
93+
:percent="percent"
94+
:status="hasError ? 'danger' : 'primary'"
95+
:radius="10"
96+
type="circle"
97+
/>
10098
</SplashView>
10199
<template v-else>
102100
<TitleBar />
103-
<div class="main">
101+
<div class="flex-1 overflow-y-auto flex flex-col p-8">
104102
<NavigationBar />
105-
<MainPage />
103+
<div class="flex flex-col overflow-y-auto mt-8 px-8 h-full">
104+
<RouterView #="{ Component }">
105+
<KeepAlive>
106+
<component :is="Component" />
107+
</KeepAlive>
108+
</RouterView>
109+
</div>
106110
</div>
107111
</template>
108112

@@ -130,17 +134,3 @@ appSettings.setupAppSettings().then(async () => {
130134

131135
<CommandView v-if="!loading" />
132136
</template>
133-
134-
<style scoped>
135-
.main {
136-
flex: 1;
137-
overflow-y: auto;
138-
display: flex;
139-
flex-direction: column;
140-
padding: 8px;
141-
}
142-
143-
.progress {
144-
animation: rotate 2s infinite linear;
145-
}
146-
</style>

frontend/src/assets/main.less

Lines changed: 5 additions & 241 deletions
Original file line numberDiff line numberDiff line change
@@ -1,241 +1,5 @@
1-
@import './theme.less';
2-
3-
body {
4-
margin: 0;
5-
color: var(--color);
6-
background-color: var(--bg-color);
7-
user-select: none;
8-
-webkit-user-select: none;
9-
line-height: 1.32;
10-
}
11-
12-
body[debug-outline='true'] {
13-
* {
14-
outline: 1px solid var(--color);
15-
}
16-
}
17-
18-
@keyframes clip {
19-
from {
20-
clip-path: circle(0% at var(--x) var(--y));
21-
}
22-
to {
23-
clip-path: circle(100% at var(--x) var(--y));
24-
}
25-
}
26-
27-
::view-transition-old(root) {
28-
animation: none;
29-
}
30-
::view-transition-new(root) {
31-
mix-blend-mode: normal;
32-
animation: clip 0.5s ease-in;
33-
}
34-
35-
.slide-down-enter-active,
36-
.slide-down-leave-active {
37-
transition: transform 0.2s ease-out;
38-
}
39-
40-
.slide-down-enter-from,
41-
.slide-down-leave-to {
42-
transform: translateY(-100%);
43-
}
44-
45-
div,
46-
input {
47-
box-sizing: border-box;
48-
}
49-
50-
a {
51-
text-decoration: none;
52-
color: var(--color);
53-
}
54-
55-
#app {
56-
height: 100vh;
57-
display: flex;
58-
flex-direction: column;
59-
}
60-
61-
.form-item {
62-
padding: 4px;
63-
display: flex;
64-
align-items: center;
65-
justify-content: space-between;
66-
}
67-
68-
.form-action {
69-
display: flex;
70-
justify-content: flex-end;
71-
margin-top: 8px;
72-
}
73-
74-
.flex {
75-
display: flex;
76-
}
77-
78-
.flex-col {
79-
flex-direction: column;
80-
}
81-
82-
.items-center {
83-
align-items: center;
84-
}
85-
86-
.flex-start {
87-
align-items: flex-start;
88-
}
89-
90-
.cursor-pointer {
91-
cursor: pointer;
92-
}
93-
94-
.pt-4 {
95-
padding-top: 4px !important;
96-
}
97-
98-
.py-2 {
99-
padding-top: 2px !important;
100-
padding-bottom: 2px !important;
101-
}
102-
103-
.px-8 {
104-
padding-left: 8px !important;
105-
padding-right: 8px !important;
106-
}
107-
108-
.mt-4 {
109-
margin-top: 4px !important;
110-
}
111-
112-
.mr-4 {
113-
margin-right: 4px !important;
114-
}
115-
116-
.ml-4 {
117-
margin-left: 4px !important;
118-
}
119-
120-
.mb-2 {
121-
margin-bottom: 2px !important;
122-
}
123-
124-
.mt-8 {
125-
margin-top: 8px !important;
126-
}
127-
128-
.mr-8 {
129-
margin-right: 8px !important;
130-
}
131-
132-
.mb-8 {
133-
margin-bottom: 8px !important;
134-
}
135-
136-
.ml-8 {
137-
margin-left: 8px !important;
138-
}
139-
140-
.ml-auto {
141-
margin-left: auto !important;
142-
}
143-
144-
.mr-auto {
145-
margin-right: auto !important;
146-
}
147-
148-
.w-full {
149-
width: 100% !important;
150-
}
151-
152-
.rounded-8 {
153-
border-radius: 8px;
154-
}
155-
156-
.flex-1 {
157-
flex: 1;
158-
}
159-
160-
.justify-between {
161-
justify-content: space-between;
162-
}
163-
164-
.font-bold {
165-
font-weight: bold;
166-
}
167-
168-
.select-text {
169-
user-select: text;
170-
-webkit-user-select: text;
171-
}
172-
173-
.text-white {
174-
color: #fff;
175-
}
176-
177-
.text-nowrap {
178-
text-wrap: nowrap;
179-
}
180-
181-
@keyframes rotate {
182-
from {
183-
transform: rotate(0deg);
184-
}
185-
to {
186-
transform: rotate(360deg);
187-
}
188-
}
189-
190-
.grid-list-grid {
191-
flex: 1;
192-
margin-top: 8px;
193-
overflow-y: auto;
194-
font-size: 12px;
195-
line-height: 1.6;
196-
.item {
197-
display: inline-block;
198-
width: calc(33.333333% - 16px);
199-
margin: 8px;
200-
}
201-
}
202-
203-
.grid-list-list {
204-
flex: 1;
205-
margin-top: 8px;
206-
overflow-y: auto;
207-
font-size: 12px;
208-
line-height: 1.6;
209-
.item {
210-
margin: 8px;
211-
margin-bottom: 16px;
212-
}
213-
}
214-
215-
.grid-list-header {
216-
display: flex;
217-
align-items: center;
218-
padding: 0 8px;
219-
z-index: 9;
220-
}
221-
222-
.grid-list-empty {
223-
text-align: center;
224-
height: 70vh;
225-
display: flex;
226-
align-items: center;
227-
justify-content: center;
228-
}
229-
230-
::-webkit-scrollbar {
231-
width: 6px;
232-
height: 6px;
233-
}
234-
::-webkit-scrollbar-track {
235-
border-radius: 6px;
236-
background: var(--scrollbar-track-bg);
237-
}
238-
::-webkit-scrollbar-thumb {
239-
border-radius: 6px;
240-
background: var(--scrollbar-thumb-bg);
241-
}
1+
@import 'styles/variables.less';
2+
@import 'styles/theme.less';
3+
@import 'styles/reset.less';
4+
@import 'styles/custom.less';
5+
@import 'styles/utilities/index.less';

0 commit comments

Comments
 (0)