@scx-js/scx-ui 0.0.1 → 0.0.3

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.
@@ -1,204 +1,204 @@
1
- /* 主区域 */
2
- .scx-upload {
3
- background: var(--scx-overlay-bg);
4
- border: 3px dashed var(--scx-text-placeholder-color);
5
- border-radius: 6px;
6
- position: relative;
7
- overflow: hidden;
8
- width: 150px;
9
- height: 150px;
10
- transition: border 200ms;
11
- }
12
-
13
- /* border 变化 */
14
- .scx-upload:hover {
15
- border-color: var(--scx-theme);
16
- }
17
-
18
- /* 预览区域 */
19
- .scx-upload > .preview {
20
- height: 100%;
21
- width: 100%;
22
- display: flex;
23
- justify-content: center;
24
- align-items: center;
25
- }
26
-
27
- /* 预览图片 */
28
- .scx-upload .preview-image {
29
- min-height: 50%;
30
- min-width: 50%;
31
- height: 100%;
32
- width: 100%;
33
- }
34
-
35
- /* 预览文字 */
36
- .scx-upload .preview-text {
37
- font-size: 15px;
38
- width: 100%;
39
- height: 100%;
40
- display: flex;
41
- overflow: auto;
42
- }
43
-
44
- .scx-upload .preview-text > div {
45
- /**
46
- 这里并没有在 .scx-upload .preview-text 中使用
47
- justify-content: center;
48
- align-items: center;
49
- 来进行居中 而是在子元素(也就是当前注释)中使用
50
- margin: auto;
51
- 请参阅
52
- https://stackoverflow.com/questions/33454533/cant-scroll-to-top-of-flex-item-that-is-overflowing-container
53
- */
54
- margin: auto;
55
- word-break: break-all;
56
- }
57
-
58
- /* 预览中操作 */
59
- .scx-upload .operation {
60
- position: absolute;
61
- bottom: 0;
62
- width: 100%;
63
- height: 30px;
64
- display: flex;
65
- }
66
-
67
- /*操作项子元素*/
68
- .scx-upload .operation > div,
69
- .scx-upload .operation > a {
70
- display: flex;
71
- justify-content: center;
72
- align-items: center;
73
- height: 100%;
74
- flex-grow: 1;
75
- flex-shrink: 1;
76
- flex-basis: 0;
77
- opacity: 50%;
78
- transition: 200ms ease-in-out opacity;
79
- cursor: pointer;
80
- color: white;
81
- font-weight: 600;
82
- text-decoration: unset;
83
- }
84
-
85
- .scx-upload .operation > div:hover,
86
- .scx-upload .operation > a:hover {
87
- opacity: 100%;
88
- }
89
-
90
- .scx-upload .item-download {
91
- background: #44be16;
92
- }
93
-
94
- .scx-upload .item-replace {
95
- background: #29aaf5;
96
- }
97
-
98
- .scx-upload .item-delete {
99
- background: #f44336;
100
- }
101
-
102
- /* 没有预览时 */
103
- .scx-upload > .no-preview {
104
- height: 100%;
105
- width: 100%;
106
- display: flex;
107
- justify-content: center;
108
- align-items: center;
109
- cursor: pointer;
110
- flex-direction: column;
111
- row-gap: 10px;
112
- }
113
-
114
- /* 图标 */
115
- .scx-upload > .no-preview > .scx-icon {
116
- fill: var(--scx-text-placeholder-color);
117
- height: 40px;
118
- width: 40px;
119
- pointer-events: none;
120
- flex-shrink: 0;
121
- }
122
-
123
- /* 提示拖拽文字 */
124
- .scx-upload > .no-preview > span {
125
- font-weight: 600;
126
- font-size: 20px;
127
- color: var(--scx-text-placeholder-color);
128
- pointer-events: none;
129
- flex-shrink: 0;
130
- }
131
-
132
- /* 拖动时蓝色背景 */
133
- .scx-upload > .no-preview.dragover::after {
134
- content: " ";
135
- width: 100%;
136
- height: 100%;
137
- background: var(--scx-theme-bg);
138
- position: absolute;
139
- top: 0;
140
- left: 0;
141
- pointer-events: none;
142
- }
143
-
144
- .scx-upload > .progress-preview {
145
- position: absolute;
146
- top: 0;
147
- left: 0;
148
- height: 100%;
149
- width: 100%;
150
- }
151
-
152
- /* 进度条 */
153
- .scx-upload > .progress {
154
- height: 100%;
155
- width: 100%;
156
- position: absolute;
157
- top: 0;
158
- left: 0;
159
- background: rgba(50, 50, 50, 40%);
160
- backdrop-filter: blur(2px);
161
- color: white;
162
- display: flex;
163
- flex-direction: column;
164
- justify-content: space-between;
165
- }
166
-
167
- .scx-upload .temp-file-name {
168
- height: 100%;
169
- width: 100%;
170
- display: flex;
171
- overflow: auto;
172
- }
173
-
174
- .scx-upload .temp-file-name > div {
175
- /**
176
- 参照 44 行
177
- */
178
- margin: auto;
179
- word-break: break-all;
180
- }
181
-
182
- .scx-upload .progress-state {
183
- width: 100%;
184
- display: flex;
185
- justify-content: center;
186
- align-items: center;
187
- flex-direction: column;
188
- font-weight: 600;
189
- flex-shrink: 0;
190
- padding: 5px;
191
- box-sizing: border-box;
192
- row-gap: 5px;
193
- }
194
-
195
- .scx-upload .progress-state > .progress-state-text {
196
- flex-shrink: 0;
197
- font-weight: 600;
198
- font-size: 14px;
199
- }
200
-
201
- .scx-upload .progress-state > .scx-progress {
202
- width: 100%;
203
- }
204
-
1
+ /* 主区域 */
2
+ .scx-upload {
3
+ background: var(--scx-overlay-bg);
4
+ border: 3px dashed var(--scx-text-placeholder-color);
5
+ border-radius: 6px;
6
+ position: relative;
7
+ overflow: hidden;
8
+ width: 150px;
9
+ height: 150px;
10
+ transition: border 200ms;
11
+ }
12
+
13
+ /* border 变化 */
14
+ .scx-upload:hover {
15
+ border-color: var(--scx-theme);
16
+ }
17
+
18
+ /* 预览区域 */
19
+ .scx-upload > .preview {
20
+ height: 100%;
21
+ width: 100%;
22
+ display: flex;
23
+ justify-content: center;
24
+ align-items: center;
25
+ }
26
+
27
+ /* 预览图片 */
28
+ .scx-upload .preview-image {
29
+ min-height: 50%;
30
+ min-width: 50%;
31
+ height: 100%;
32
+ width: 100%;
33
+ }
34
+
35
+ /* 预览文字 */
36
+ .scx-upload .preview-text {
37
+ font-size: 15px;
38
+ width: 100%;
39
+ height: 100%;
40
+ display: flex;
41
+ overflow: auto;
42
+ }
43
+
44
+ .scx-upload .preview-text > div {
45
+ /**
46
+ 这里并没有在 .scx-upload .preview-text 中使用
47
+ justify-content: center;
48
+ align-items: center;
49
+ 来进行居中 而是在子元素(也就是当前注释)中使用
50
+ margin: auto;
51
+ 请参阅
52
+ https://stackoverflow.com/questions/33454533/cant-scroll-to-top-of-flex-item-that-is-overflowing-container
53
+ */
54
+ margin: auto;
55
+ word-break: break-all;
56
+ }
57
+
58
+ /* 预览中操作 */
59
+ .scx-upload .operation {
60
+ position: absolute;
61
+ bottom: 0;
62
+ width: 100%;
63
+ height: 30px;
64
+ display: flex;
65
+ }
66
+
67
+ /*操作项子元素*/
68
+ .scx-upload .operation > div,
69
+ .scx-upload .operation > a {
70
+ display: flex;
71
+ justify-content: center;
72
+ align-items: center;
73
+ height: 100%;
74
+ flex-grow: 1;
75
+ flex-shrink: 1;
76
+ flex-basis: 0;
77
+ opacity: 50%;
78
+ transition: 200ms ease-in-out opacity;
79
+ cursor: pointer;
80
+ color: white;
81
+ font-weight: 600;
82
+ text-decoration: unset;
83
+ }
84
+
85
+ .scx-upload .operation > div:hover,
86
+ .scx-upload .operation > a:hover {
87
+ opacity: 100%;
88
+ }
89
+
90
+ .scx-upload .item-download {
91
+ background: #44be16;
92
+ }
93
+
94
+ .scx-upload .item-replace {
95
+ background: #29aaf5;
96
+ }
97
+
98
+ .scx-upload .item-delete {
99
+ background: #f44336;
100
+ }
101
+
102
+ /* 没有预览时 */
103
+ .scx-upload > .no-preview {
104
+ height: 100%;
105
+ width: 100%;
106
+ display: flex;
107
+ justify-content: center;
108
+ align-items: center;
109
+ cursor: pointer;
110
+ flex-direction: column;
111
+ row-gap: 10px;
112
+ }
113
+
114
+ /* 图标 */
115
+ .scx-upload > .no-preview > .scx-icon {
116
+ fill: var(--scx-text-placeholder-color);
117
+ height: 40px;
118
+ width: 40px;
119
+ pointer-events: none;
120
+ flex-shrink: 0;
121
+ }
122
+
123
+ /* 提示拖拽文字 */
124
+ .scx-upload > .no-preview > span {
125
+ font-weight: 600;
126
+ font-size: 20px;
127
+ color: var(--scx-text-placeholder-color);
128
+ pointer-events: none;
129
+ flex-shrink: 0;
130
+ }
131
+
132
+ /* 拖动时蓝色背景 */
133
+ .scx-upload > .no-preview.dragover::after {
134
+ content: " ";
135
+ width: 100%;
136
+ height: 100%;
137
+ background: var(--scx-theme-bg);
138
+ position: absolute;
139
+ top: 0;
140
+ left: 0;
141
+ pointer-events: none;
142
+ }
143
+
144
+ .scx-upload > .progress-preview {
145
+ position: absolute;
146
+ top: 0;
147
+ left: 0;
148
+ height: 100%;
149
+ width: 100%;
150
+ }
151
+
152
+ /* 进度条 */
153
+ .scx-upload > .progress {
154
+ height: 100%;
155
+ width: 100%;
156
+ position: absolute;
157
+ top: 0;
158
+ left: 0;
159
+ background: rgba(50, 50, 50, 40%);
160
+ backdrop-filter: blur(2px);
161
+ color: white;
162
+ display: flex;
163
+ flex-direction: column;
164
+ justify-content: space-between;
165
+ }
166
+
167
+ .scx-upload .temp-file-name {
168
+ height: 100%;
169
+ width: 100%;
170
+ display: flex;
171
+ overflow: auto;
172
+ }
173
+
174
+ .scx-upload .temp-file-name > div {
175
+ /**
176
+ 参照 44 行
177
+ */
178
+ margin: auto;
179
+ word-break: break-all;
180
+ }
181
+
182
+ .scx-upload .progress-state {
183
+ width: 100%;
184
+ display: flex;
185
+ justify-content: center;
186
+ align-items: center;
187
+ flex-direction: column;
188
+ font-weight: 600;
189
+ flex-shrink: 0;
190
+ padding: 5px;
191
+ box-sizing: border-box;
192
+ row-gap: 5px;
193
+ }
194
+
195
+ .scx-upload .progress-state > .progress-state-text {
196
+ flex-shrink: 0;
197
+ font-weight: 600;
198
+ font-size: 14px;
199
+ }
200
+
201
+ .scx-upload .progress-state > .scx-progress {
202
+ width: 100%;
203
+ }
204
+