sykj 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,68 @@
1
+ <h1 align="center" >SYKJ</h1>
2
+
3
+ - 🤓 SY_UI
4
+ - 💪 Vue 3 Composition API
5
+ - 🔥 Written in TypeScript
6
+
7
+ ## 快速开始
8
+
9
+ ### 安装
10
+
11
+ ```typescript
12
+ # NPM
13
+ $ npm install sykj --save
14
+
15
+ # Yarn
16
+ $ yarn add sykj
17
+
18
+ # pnpm
19
+ $ pnpm install sykj
20
+ ```
21
+
22
+ ### 使用
23
+
24
+ ```typescript
25
+ // main.ts
26
+ import { createApp } from "vue";
27
+ import sykj from "sykj";
28
+ import App from "./App.vue";
29
+
30
+ const app = createApp(App);
31
+
32
+ app.use(sykj);
33
+ app.mount("#app");
34
+ ```
35
+
36
+ ```vue
37
+ // App.vue
38
+ <template>
39
+ <div class="app">
40
+ <input type="text" />
41
+ <SyKeyboard />
42
+ </div>
43
+ </template>
44
+
45
+ <script setup>
46
+ import SyKeyboard from "sykj";
47
+ </script>
48
+
49
+ <style lang="scss" scoped>
50
+ .app {
51
+ height: 100vh;
52
+ display: flex;
53
+ justify-content: center;
54
+ align-items: center;
55
+ }
56
+ </style>
57
+ ```
58
+
59
+ ```vue
60
+ // ***.vue
61
+
62
+ <template>
63
+ <div class="app">
64
+ <input type="text" />
65
+ <!-- 使用input or textarea 聚焦时自动打开键盘-->
66
+ </div>
67
+ </template>
68
+ ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sykj",
3
- "version": "0.0.2",
4
- "description": "",
3
+ "version": "0.0.4",
4
+ "description": "rem adaptation🚀",
5
5
  "main": "lib/common.ts",
6
6
  "files": [
7
7
  "lib",
@@ -11,7 +11,11 @@
11
11
  "scripts": {
12
12
  "test": "echo \"Error: no test specified\" && exit 1"
13
13
  },
14
- "keywords": [],
15
- "author": "IU",
14
+ "keywords": [
15
+ "keyboard",
16
+ "vue",
17
+ "ui"
18
+ ],
19
+ "author": "IUHua",
16
20
  "license": "MIT"
17
21
  }
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <div
3
3
  @click="makeFocus"
4
+ class="keyboardcon defaultCss"
5
+ :class="[!keyStore.keyboardcon ? 'show' : '', toUpKeyCase ? 'upKeyCase' : '']"
4
6
  @contextmenu.prevent="makeFocus"
5
- :class="[keyStore.keyboardcon ? 'show' : '', toUpKeyCase ? 'default' : 'root']"
6
- class="keyboardcon"
7
7
  >
8
8
  <!-- 中文拼音列表 -->
9
9
  <div class="chinese">
@@ -735,23 +735,22 @@ const cancelPress = () => {
735
735
  // 添加和清理事件监听器
736
736
 
737
737
  //#endregion ⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️
738
+
739
+ //
738
740
  </script>
739
741
 
740
742
  <style lang="scss">
741
743
  @import "./theme.scss";
742
744
 
743
- .default {
744
- --h: 45px;
745
- --gap: 8px;
746
- --fontSize: 20px;
747
- --borra: 6px;
745
+ .defaultCss {
746
+ --h: 0.7rem;
747
+ --gap: 0.1rem;
748
+ --fontSize: 0.4rem;
749
+ --borra: 0.2em;
748
750
  }
749
751
 
750
- .root {
751
- --h: 45px;
752
- --gap: 8px;
753
- --fontSize: 24px;
754
- --borra: 6px;
752
+ .upKeyCase {
753
+ --fontSize: 0.35rem;
755
754
  }
756
755
 
757
756
  .keyboardcon {
@@ -760,25 +759,27 @@ const cancelPress = () => {
760
759
  width: 100%;
761
760
  bottom: 0;
762
761
  font-size: var(--fontSize);
763
- padding: 10px 10px 5px;
762
+ padding: 0.25rem 0.25rem 0.125rem;
764
763
  box-sizing: border-box;
765
- box-shadow: 0 0 20px 0px rgb(117, 117, 117);
764
+ box-shadow: 0 0 0.3rem 0 rgb(117, 117, 117);
766
765
  z-index: 10000;
767
766
  // // @include key_background("keyboard_background");
768
767
  background: var(--keyboard_background);
769
- border-radius: 10px 10px 0 0;
768
+ border-radius: 0.25rem 0.25rem 0 0;
770
769
  transition: all 0.2s;
770
+ & * {
771
+ box-sizing: border-box;
772
+ }
771
773
  .btns {
772
774
  color: rgb(0, 123, 255);
773
775
  display: flex;
774
776
  justify-content: space-between;
775
777
  align-items: center;
776
- margin: 10px 0;
777
- font-size: 12px;
778
+ margin: 0.25rem 0;
779
+ font-size: 0.25rem;
778
780
 
779
781
  > div {
780
- height: 20px;
781
-
782
+ height: 0.25rem;
782
783
  span {
783
784
  color: gainsboro;
784
785
  transition: all 0.3s;
@@ -786,7 +787,7 @@ const cancelPress = () => {
786
787
  }
787
788
 
788
789
  .ch {
789
- font-size: 20px;
790
+ font-size: 0.35rem;
790
791
  color: rgb(0, 123, 255);
791
792
  }
792
793
  }
@@ -797,13 +798,16 @@ const cancelPress = () => {
797
798
  .pinyin {
798
799
  padding: 4px;
799
800
  box-sizing: border-box;
801
+ // border: 1px solid red;
800
802
  }
801
803
 
802
804
  .wenzi {
803
805
  position: relative;
804
- height: 40px;
805
- background: var(--keyboard_background);
806
+ height: 0.6rem;
806
807
 
808
+ // border: 1px solid red;
809
+ background: var(--keyboard_background);
810
+ margin-bottom: 0.1rem;
807
811
  .wenzi_box {
808
812
  display: flex;
809
813
  // flex-wrap: wrap;
@@ -818,18 +822,18 @@ const cancelPress = () => {
818
822
  left: 0;
819
823
  top: 0;
820
824
  width: 98%;
821
- // border: 1px solid red;
822
- // @include key_background("keyboard_background");
825
+ height: 100%;
823
826
  background: var(--keyboard_background);
824
827
  z-index: 1;
825
828
  transition: all 0.5s;
826
- height: 40px;
827
829
  box-sizing: border-box;
828
830
 
829
831
  span {
830
832
  flex-shrink: 0;
831
- padding: 0 4px;
833
+ padding: 0.04rem 0.08rem;
832
834
  border-radius: 6px;
835
+ // border: 1px solid red;
836
+ height: fit-content;
833
837
 
834
838
  &:active {
835
839
  // @include key_background("key_active_background");
@@ -842,24 +846,29 @@ const cancelPress = () => {
842
846
 
843
847
  .wenzi_box_more {
844
848
  // flex-wrap: wrap;
845
- padding-right: 34px;
849
+ padding-right: 0.34rem;
846
850
  box-sizing: border-box;
847
851
  width: 102%;
848
- left: -3px;
849
- height: 31vh;
852
+ left: -0.03rem;
853
+ // height: 31vh;
854
+ height: 4.5rem;
855
+
856
+ // border: 1px solid red;
850
857
  }
851
858
 
852
859
  .moreText {
853
860
  position: absolute;
854
- height: 38px;
861
+ height: 0.55rem;
855
862
  top: 0;
856
863
  right: -5px;
857
864
  z-index: 100;
858
- padding: 0 5px;
865
+ padding: 0 0.05rem;
859
866
  display: flex;
860
867
  justify-content: center;
861
868
  align-items: center;
862
- border-radius: 6px;
869
+ border-radius: var(--borra);
870
+ // border: 1px solid red;
871
+
863
872
  // @include key_background("keyboard_background");
864
873
  background: var(--keyboard_background);
865
874
 
@@ -984,7 +993,6 @@ const cancelPress = () => {
984
993
  justify-content: center;
985
994
  align-items: center;
986
995
  height: var(--h);
987
- width: 34px;
988
996
  & span,
989
997
  & img {
990
998
  pointer-events: none;
@@ -998,9 +1006,12 @@ const cancelPress = () => {
998
1006
  width: 100%;
999
1007
  font-size: var(--fontSize);
1000
1008
  box-shadow: inset 0px 0px 2px 0px #8f9eae;
1001
- background: var(--key_background) span {
1009
+
1010
+ background: var(--key_background);
1011
+ span {
1002
1012
  height: fit-content;
1003
- line-height: 18px;
1013
+ line-height: 0.2rem;
1014
+ // border: 1px solid red;
1004
1015
  }
1005
1016
 
1006
1017
  &:active {
@@ -1059,7 +1070,7 @@ const cancelPress = () => {
1059
1070
  display: flex;
1060
1071
  justify-content: center;
1061
1072
  align-items: center;
1062
- font-size: 18px;
1073
+ font-size: 0.3rem;
1063
1074
  img {
1064
1075
  transform: scale(0.7);
1065
1076
  // @include filter("key_filter");
@@ -1115,7 +1126,8 @@ const cancelPress = () => {
1115
1126
  .key {
1116
1127
  padding: 0;
1117
1128
  box-sizing: border-box;
1118
- font-size: 16px;
1129
+ font-size: 0.3rem;
1130
+ font-weight: bold;
1119
1131
 
1120
1132
  img {
1121
1133
  height: 100%;
@@ -1149,7 +1161,6 @@ const cancelPress = () => {
1149
1161
 
1150
1162
  img {
1151
1163
  transform: scale(0.8);
1152
- // @include filter("key_filter");
1153
1164
  filter: var(--key_filter);
1154
1165
  }
1155
1166
  }