Skip to content

Commit 0c8b94f

Browse files
authored
Merge pull request #3 from kongying-tavern/feat/next
add config bar & simplify ui
2 parents 088fe12 + 3a9c665 commit 0c8b94f

29 files changed

+732
-39
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<link rel="icon" href="/favicon.ico">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<title>Vite App</title>
7+
<title>Elysia Typewriter</title>
88
</head>
99
<body>
1010
<div id="app"></div>

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"lint": "pnpm lint-eslint && pnpm lint-stylelint",
1313
"lint-eslint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
1414
"lint-stylelint": "stylelint ./**/*.{css,sass,scss} --fix --ignore-path .gitignore",
15-
"release": "semantic-release"
15+
"release": "semantic-release",
16+
"svgo": "svgo -rf src"
1617
},
1718
"dependencies": {
1819
"element-plus": "^2.2.32",
@@ -44,6 +45,8 @@
4445
"stylelint-config-sass-guidelines": "^9.0.1",
4546
"stylelint-config-standard-scss": "^5.0.0",
4647
"stylelint-prettier": "^3.0.0",
48+
"svgo": "^3.0.2",
49+
"ts-keycode-enum": "^1.0.6",
4750
"typescript": "~4.7.4",
4851
"unplugin-auto-import": "^0.15.0",
4952
"vite": "^4.0.0",

pnpm-lock.yaml

Lines changed: 141 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/SvgIcon.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<script setup lang="ts">
2+
import { computed, withDefaults } from "vue";
3+
4+
interface Props {
5+
iconBase?: string;
6+
iconSrc: string;
7+
}
8+
9+
const props = withDefaults(defineProps<Props>(), {
10+
iconBase: import.meta.url,
11+
iconSrc: "",
12+
});
13+
14+
const iconUrl = computed(() => new URL(props.iconSrc, props.iconBase).href);
15+
</script>
16+
17+
<template>
18+
<img :src="iconUrl" />
19+
</template>

src/shared/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./keyboardLayout";

src/shared/keyboardLayout.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
export interface KeyboardLayoutOptions {
2+
framework: KeyboardFrameworkOptions;
3+
layout: KeyboardWidgetOption[];
4+
}
5+
6+
export interface KeyboardFrameworkOptions {
7+
// TODO
8+
}
9+
10+
export type KeyboardKeyType = "key" | "span" | "nl";
11+
12+
export interface KeyboardKeyOption {
13+
width?: string | number;
14+
keyTextMain: string;
15+
keyCode: number;
16+
}
17+
18+
export interface KeyboardSpanOption {
19+
width: string | number;
20+
}
21+
22+
export interface KeyboardNlOption {}
23+
24+
export type KeyboardWidgetOptions =
25+
| KeyboardKeyOption
26+
| KeyboardSpanOption
27+
| KeyboardNlOption;
28+
29+
export interface KeyboardWidgetOption {
30+
type: KeyboardKeyType;
31+
options?: KeyboardWidgetOptions;
32+
}
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
<script setup lang="ts">
22
import FontPicker from "./components/FontPicker.vue";
33
import TextPreview from "./components/TextPreview.vue";
4-
import TextInput from "./components/TextInput.vue";
4+
import ConfigBar from "./components/ConfigBar.vue";
5+
import InputArea from "./components/InputArea.vue";
56
</script>
67

78
<template>
8-
<main class="fixed top-0 bottom-0 left-0 right-0 flex flex-row">
9+
<main class="flex flex-row fixed top-0 bottom-0 left-0 right-0">
910
<div class="flex-1 p-3">
1011
<FontPicker></FontPicker>
1112
</div>
12-
<div class="flex-3 flex flex-col p-3 pl-0 space-y-3">
13-
<div class="flex-auto">
14-
<TextPreview></TextPreview>
15-
</div>
16-
<div class="flex-none">
17-
<TextInput></TextInput>
18-
</div>
13+
<div class="flex flex-col flex-3 p-3 pl-0 space-y-3">
14+
<TextPreview class="flex-auto"></TextPreview>
15+
<InputArea class="flex-none"></InputArea>
16+
<ConfigBar class="flex-none"></ConfigBar>
1917
</div>
2018
</main>
2119
</template>
2220

23-
<style lang="scss" scoped>
21+
<style scoped lang="scss">
2422
@use "@/assets/style/font.scss";
2523
@include font.fonts(true);
2624
</style>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<script setup lang="ts">
2+
import ButtonClean from "./ConfigBar/ButtonClean.vue";
3+
import ButtonInputMethod from "./ConfigBar/ButtonInputMethod.vue";
4+
import ButtonKeyTransform from "./ConfigBar/ButtonKeyTransform.vue";
5+
</script>
6+
7+
<template>
8+
<div class="flex flex-row space-x-1">
9+
<ButtonClean></ButtonClean>
10+
<ButtonInputMethod></ButtonInputMethod>
11+
<ButtonKeyTransform></ButtonKeyTransform>
12+
</div>
13+
</template>

0 commit comments

Comments
 (0)