Skip to content

Commit 79c881f

Browse files
committed
style: update Prettier config and format scripts to include Vue files
1 parent 3c281c4 commit 79c881f

12 files changed

+775
-778
lines changed

.prettierrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"tabWidth": 2,
66
"trailingComma": "es5",
77
"bracketSpacing": true,
8-
"vueIndentScriptAndStyle": true
8+
"vueIndentScriptAndStyle": false
99
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"preview": "vite preview",
1111
"predeploy": "npm run build",
1212
"deploy": "gh-pages -d dist",
13-
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,scss,md}\"",
14-
"format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,scss,md}\"",
13+
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,scss,md,vue}\"",
14+
"format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,scss,md,vue}\"",
1515
"prepare": "husky",
1616
"lint": "eslint ",
1717
"test": "echo \"No tests specified\" && exit 0"

src/App.vue

Lines changed: 116 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -39,139 +39,139 @@
3939
</template>
4040

4141
<script setup lang="ts">
42-
import { computed, watch } from 'vue';
43-
44-
import { useOpenCV } from './composables/useOpenCV';
45-
import { useChessEngine } from './composables/useChessEngine';
46-
import { useChessStore } from './stores/chess';
47-
import { useImageProcessing } from './composables/useImageProcessing';
48-
49-
import ImageUploader from './components/ImageUploader.vue';
50-
import BoardResult from './components/BoardResult.vue';
51-
import FENDisplay from './components/FENDisplay.vue';
52-
import SolutionDisplay from './components/SolutionDisplay.vue';
53-
import DepthControl from './components/DepthControl.vue';
54-
import WelcomeModal from './components/WelcomeModal.vue';
55-
import Spinner from './components/Spinner.vue';
56-
57-
const { templates } = useOpenCV();
58-
const { fetchBestMove, isEngineReady } = useChessEngine();
59-
const isLoading = computed(() => {
60-
const templatesReady = !!templates.value;
61-
return !isEngineReady.value || !templatesReady;
62-
});
63-
64-
const chessStore = useChessStore();
65-
66-
watch(
67-
() => [chessStore.fenCode, chessStore.depth],
68-
() => {
69-
if (chessStore.fenCode) {
70-
fetchBestMove(chessStore.fenCode, chessStore.depth);
71-
}
42+
import { computed, watch } from 'vue';
43+
44+
import { useOpenCV } from './composables/useOpenCV';
45+
import { useChessEngine } from './composables/useChessEngine';
46+
import { useChessStore } from './stores/chess';
47+
import { useImageProcessing } from './composables/useImageProcessing';
48+
49+
import ImageUploader from './components/ImageUploader.vue';
50+
import BoardResult from './components/BoardResult.vue';
51+
import FENDisplay from './components/FENDisplay.vue';
52+
import SolutionDisplay from './components/SolutionDisplay.vue';
53+
import DepthControl from './components/DepthControl.vue';
54+
import WelcomeModal from './components/WelcomeModal.vue';
55+
import Spinner from './components/Spinner.vue';
56+
57+
const { templates } = useOpenCV();
58+
const { fetchBestMove, isEngineReady } = useChessEngine();
59+
const isLoading = computed(() => {
60+
const templatesReady = !!templates.value;
61+
return !isEngineReady.value || !templatesReady;
62+
});
63+
64+
const chessStore = useChessStore();
65+
66+
watch(
67+
() => [chessStore.fenCode, chessStore.depth],
68+
() => {
69+
if (chessStore.fenCode) {
70+
fetchBestMove(chessStore.fenCode, chessStore.depth);
7271
}
73-
);
72+
}
73+
);
7474
75-
const { processUploadedImage } = useImageProcessing(templates);
75+
const { processUploadedImage } = useImageProcessing(templates);
7676
77-
const handleImageUpload = (img: HTMLImageElement) => {
78-
chessStore.resetHistory();
79-
processUploadedImage(img);
80-
};
77+
const handleImageUpload = (img: HTMLImageElement) => {
78+
chessStore.resetHistory();
79+
processUploadedImage(img);
80+
};
8181
</script>
8282

8383
<style scoped>
84-
.app-container {
85-
flex: 1;
86-
display: flex;
84+
.app-container {
85+
flex: 1;
86+
display: flex;
87+
flex-direction: column;
88+
width: 100%;
89+
margin: 0 auto;
90+
padding: 0;
91+
box-sizing: border-box;
92+
}
93+
94+
.content-wrapper {
95+
display: flex;
96+
flex-wrap: wrap;
97+
gap: 2rem;
98+
width: 100%;
99+
max-width: 1200px;
100+
margin: 0 auto;
101+
padding: 0 1rem;
102+
box-sizing: border-box;
103+
}
104+
105+
.left-column,
106+
.right-column {
107+
width: 100%;
108+
}
109+
110+
.loading-overlay {
111+
position: fixed;
112+
top: 0;
113+
left: 0;
114+
width: 100%;
115+
height: 100%;
116+
background-color: rgba(255, 255, 255, 0.8);
117+
display: flex;
118+
flex-direction: column;
119+
justify-content: center;
120+
align-items: center;
121+
z-index: 9999;
122+
}
123+
124+
.loading-overlay p {
125+
margin-top: 20px;
126+
font-size: 1.2rem;
127+
color: #333;
128+
}
129+
130+
/* 媒体查询 */
131+
@media (max-width: 768px) {
132+
.content-wrapper {
87133
flex-direction: column;
88-
width: 100%;
89-
margin: 0 auto;
90-
padding: 0;
91-
box-sizing: border-box;
134+
gap: 0;
92135
}
93136
94-
.content-wrapper {
95-
display: flex;
96-
flex-wrap: wrap;
97-
gap: 2rem;
98-
width: 100%;
99-
max-width: 1200px;
100-
margin: 0 auto;
101-
padding: 0 1rem;
102-
box-sizing: border-box;
137+
.solution-section {
138+
order: 1;
103139
}
104-
105-
.left-column,
106-
.right-column {
107-
width: 100%;
140+
.upload-section {
141+
order: 0;
108142
}
109-
110-
.loading-overlay {
111-
position: fixed;
112-
top: 0;
113-
left: 0;
114-
width: 100%;
115-
height: 100%;
116-
background-color: rgba(255, 255, 255, 0.8);
117-
display: flex;
118-
flex-direction: column;
119-
justify-content: center;
120-
align-items: center;
121-
z-index: 9999;
143+
.board-result-section {
144+
order: 2;
122145
}
123-
124-
.loading-overlay p {
125-
margin-top: 20px;
126-
font-size: 1.2rem;
127-
color: #333;
146+
.fen-section {
147+
order: 3;
128148
}
129-
130-
/* 媒体查询 */
131-
@media (max-width: 768px) {
132-
.content-wrapper {
133-
flex-direction: column;
134-
gap: 0;
135-
}
136-
137-
.solution-section {
138-
order: 1;
139-
}
140-
.upload-section {
141-
order: 0;
142-
}
143-
.board-result-section {
144-
order: 2;
145-
}
146-
.fen-section {
147-
order: 3;
148-
}
149-
.depth-control-section {
150-
order: 4;
151-
}
149+
.depth-control-section {
150+
order: 4;
152151
}
152+
}
153153
154-
@media (min-width: 769px) {
155-
.content-wrapper {
156-
flex-direction: row;
157-
align-items: flex-start;
158-
}
154+
@media (min-width: 769px) {
155+
.content-wrapper {
156+
flex-direction: row;
157+
align-items: flex-start;
158+
}
159159
160-
.left-column {
161-
width: calc(50% - 1rem);
162-
position: sticky;
163-
top: 1rem;
164-
align-self: flex-start;
165-
}
160+
.left-column {
161+
width: calc(50% - 1rem);
162+
position: sticky;
163+
top: 1rem;
164+
align-self: flex-start;
165+
}
166166
167-
.right-column {
168-
width: calc(50% - 1rem);
169-
}
167+
.right-column {
168+
width: calc(50% - 1rem);
169+
}
170170
171-
.solution-section {
172-
height: calc(100vh - 2rem);
173-
overflow-y: auto;
174-
order: -1;
175-
}
171+
.solution-section {
172+
height: calc(100vh - 2rem);
173+
overflow-y: auto;
174+
order: -1;
176175
}
176+
}
177177
</style>

0 commit comments

Comments
 (0)