@wokki20/jspt 2.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.
- package/LICENSE +21 -0
- package/README.md +586 -0
- package/dist/jspt.css +264 -0
- package/dist/jspt.d.ts +49 -0
- package/dist/jspt.js +626 -0
- package/dist/jspt.min.js +1 -0
- package/dist/jspt.module.js +611 -0
- package/package.json +38 -0
- package/src/jspt.css +264 -0
- package/src/jspt.d.ts +49 -0
- package/src/jspt.js +626 -0
- package/src/jspt.module.js +611 -0
package/dist/jspt.css
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
.toast-container {
|
|
2
|
+
position: fixed;
|
|
3
|
+
bottom: 10px;
|
|
4
|
+
right: 10px;
|
|
5
|
+
z-index: 9999;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: 5px;
|
|
9
|
+
transition: all 0.3s ease;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.toast-container .toast {
|
|
13
|
+
transform: translateY(var(--translate, 0px)) scale(var(--scale, 1));
|
|
14
|
+
transition: transform 0.25s ease, opacity 0.25s ease, height 0.25s ease;
|
|
15
|
+
pointer-events: auto;
|
|
16
|
+
z-index: 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.toast-container .toast.stacked {
|
|
20
|
+
box-shadow: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.toast-container:hover .toast {
|
|
24
|
+
transform: translateY(0);
|
|
25
|
+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.toast-container .toast {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
flex-direction: row;
|
|
32
|
+
justify-content: space-between;
|
|
33
|
+
background-color: #333;
|
|
34
|
+
border: 1px solid #555;
|
|
35
|
+
color: #fff;
|
|
36
|
+
padding: 10px 15px;
|
|
37
|
+
border-radius: 10px;
|
|
38
|
+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
|
39
|
+
gap: 10px;
|
|
40
|
+
height: 20px;
|
|
41
|
+
max-width: 350px;
|
|
42
|
+
transition: height 0.3s ease, transform 0.25s ease;
|
|
43
|
+
animation: toast-slide-in 0.25s ease;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@keyframes toast-slide-in {
|
|
48
|
+
from {
|
|
49
|
+
transform: translateX(100%);
|
|
50
|
+
}
|
|
51
|
+
to {
|
|
52
|
+
transform: translateX(0);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@keyframes toast-slide-out {
|
|
57
|
+
from {
|
|
58
|
+
transform: translateX(0);
|
|
59
|
+
}
|
|
60
|
+
to {
|
|
61
|
+
transform: translateX(100%);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.toast-container .toast.toast-default-error {
|
|
66
|
+
background-color: #9e251d;
|
|
67
|
+
border-color: #f44336;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.toast-container .toast .toast-icon {
|
|
71
|
+
cursor: var(--cursor, default);
|
|
72
|
+
transition: all 0.3s ease;
|
|
73
|
+
color: #fff;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.toast-container .toast .toast-icon.toast-icon-image {
|
|
77
|
+
width: 20px;
|
|
78
|
+
height: 20px;
|
|
79
|
+
filter: brightness(1);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.toast-container .toast .toast-icon.action:hover{
|
|
83
|
+
color: #ccc;
|
|
84
|
+
transform: scale(1.2);
|
|
85
|
+
pointer-events: all;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.toast-container .toast .toast-icon.toast-icon-image.action:hover {
|
|
89
|
+
filter: brightness(0.8);
|
|
90
|
+
transform: scale(1.2);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.toast-container .toast .toast-text {
|
|
94
|
+
flex: 1;
|
|
95
|
+
overflow: hidden;
|
|
96
|
+
text-overflow: ellipsis;
|
|
97
|
+
white-space: nowrap;
|
|
98
|
+
user-select: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.toast-container:hover .toast .toast-text {
|
|
102
|
+
white-space: normal;
|
|
103
|
+
overflow: visible;
|
|
104
|
+
text-overflow: unset;
|
|
105
|
+
word-break: break-word;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.toast-container .toast .toast-duration-bar {
|
|
109
|
+
position: fixed;
|
|
110
|
+
bottom: -1px;
|
|
111
|
+
left: 0;
|
|
112
|
+
width: 0;
|
|
113
|
+
height: 3px;
|
|
114
|
+
background-color: #ffffff;
|
|
115
|
+
transition: width 0.3s linear;
|
|
116
|
+
border-radius: 3px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.toast-link {
|
|
120
|
+
color: #ffffff;
|
|
121
|
+
text-decoration: underline;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.popup-container {
|
|
125
|
+
position: fixed;
|
|
126
|
+
top: 0;
|
|
127
|
+
left: 0;
|
|
128
|
+
width: 100%;
|
|
129
|
+
height: 100%;
|
|
130
|
+
z-index: 9999;
|
|
131
|
+
display: flex;
|
|
132
|
+
justify-content: center;
|
|
133
|
+
align-items: center;
|
|
134
|
+
transition: all 0.3s ease;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.popup-container .popup {
|
|
138
|
+
background-color: #333;
|
|
139
|
+
border: 1px solid #555;
|
|
140
|
+
color: #fff;
|
|
141
|
+
padding: 0px;
|
|
142
|
+
border-radius: 20px;
|
|
143
|
+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
|
144
|
+
gap: 10px;
|
|
145
|
+
min-width: 350px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.popup-container .popup .popup-header {
|
|
149
|
+
display: flex;
|
|
150
|
+
align-items: center;
|
|
151
|
+
justify-content: space-between;
|
|
152
|
+
margin-bottom: 10px;
|
|
153
|
+
gap: 10px;
|
|
154
|
+
border-bottom: 1px solid #555;
|
|
155
|
+
padding: 15px;
|
|
156
|
+
padding-bottom: 10px;
|
|
157
|
+
padding-top: 10px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.popup-container .popup .popup-header p {
|
|
161
|
+
margin: 0px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.popup-container .popup .popup-header .popup-header-close {
|
|
165
|
+
cursor: pointer;
|
|
166
|
+
transition: all 0.3s ease;
|
|
167
|
+
color: #fff;
|
|
168
|
+
font-size: 25px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.popup-container .popup .popup-header .popup-header-close:hover {
|
|
172
|
+
color: #ccc;
|
|
173
|
+
transform: scale(1.1);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.popup-container .popup .popup-content {
|
|
177
|
+
padding: 0px 15px 15px 15px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.popup-error-code {
|
|
181
|
+
display: flex;
|
|
182
|
+
flex-direction: column;
|
|
183
|
+
border-radius: 10px;
|
|
184
|
+
overflow: hidden;
|
|
185
|
+
border: 1px solid #555;
|
|
186
|
+
margin-bottom: 0px;
|
|
187
|
+
user-select: none;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.popup-error-code code {
|
|
191
|
+
background-color: #333;
|
|
192
|
+
padding: 0px !important;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.popup-error-code-header {
|
|
196
|
+
display: flex;
|
|
197
|
+
align-items: center;
|
|
198
|
+
justify-content: space-between;
|
|
199
|
+
background-color: #161616;
|
|
200
|
+
border-bottom: 1px solid #555;
|
|
201
|
+
padding: 10px 15px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.popup-error-code-header-file {
|
|
205
|
+
margin: 0px;
|
|
206
|
+
font-size: 15px;
|
|
207
|
+
user-select: none;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.popup-error-code-line:nth-child(2n) {
|
|
211
|
+
background-color: transparent;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.popup-error-code-line:nth-child(2n+1) {
|
|
215
|
+
background-color: #1f1f1f;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.popup-error-code-line {
|
|
219
|
+
white-space: pre;
|
|
220
|
+
display: flex;
|
|
221
|
+
width: 100%;
|
|
222
|
+
font-size: 15px;
|
|
223
|
+
user-select: text;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.popup-error-code-line-number {
|
|
227
|
+
user-select: none;
|
|
228
|
+
margin-right: 5px;
|
|
229
|
+
margin-left: 5px;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.popup-error-code-line:nth-child(2n).popup-error-code-line-highlight {
|
|
233
|
+
background-color: #47430b;
|
|
234
|
+
animation: popup-error-code-line-highlight 1s ease alternate infinite;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
@keyframes popup-error-code-line-highlight {
|
|
238
|
+
from {
|
|
239
|
+
background-color: #47430b;
|
|
240
|
+
}
|
|
241
|
+
to {
|
|
242
|
+
background-color: transparent;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.popup-error-code-line:nth-child(2n+1).popup-error-code-line-highlight {
|
|
247
|
+
background-color: #47430b;
|
|
248
|
+
animation: popup-error-code-line-highlight-dark 1s ease alternate infinite;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
@keyframes popup-error-code-line-highlight-dark {
|
|
252
|
+
from {
|
|
253
|
+
background-color: #47430b;
|
|
254
|
+
}
|
|
255
|
+
to {
|
|
256
|
+
background-color: #1f1f1f;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.input#onclick,
|
|
261
|
+
.input#icon_left_action,
|
|
262
|
+
.input#icon_right_action {
|
|
263
|
+
resize: vertical;
|
|
264
|
+
}
|
package/dist/jspt.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface PopupOptions {
|
|
2
|
+
style?: 'default';
|
|
3
|
+
content_type?: 'text' | 'html';
|
|
4
|
+
header?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
message?: string;
|
|
7
|
+
content?: string;
|
|
8
|
+
close_on_blur?: boolean;
|
|
9
|
+
custom_id?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface ToastOptions {
|
|
13
|
+
style?: 'default' | 'default-error' | string;
|
|
14
|
+
message: string;
|
|
15
|
+
custom_id?: string;
|
|
16
|
+
icon_left?: string;
|
|
17
|
+
icon_left_type?: 'google_material_rounded' | 'google_material_outlined' | 'svg' | 'image' | 'text' | 'emoji';
|
|
18
|
+
icon_left_action?: () => void;
|
|
19
|
+
icon_right?: string;
|
|
20
|
+
icon_right_type?: 'google_material_rounded' | 'google_material_outlined' | 'svg' | 'image' | 'text' | 'emoji';
|
|
21
|
+
icon_right_action?: () => void;
|
|
22
|
+
duration?: number;
|
|
23
|
+
close_on_click?: boolean;
|
|
24
|
+
onclick?: () => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface ClosePopupOptions {
|
|
28
|
+
custom_id: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function makePopup(options: PopupOptions): void;
|
|
32
|
+
|
|
33
|
+
export function makeToast(options: ToastOptions): void;
|
|
34
|
+
|
|
35
|
+
export function closePopup(options: ClosePopupOptions): void;
|
|
36
|
+
|
|
37
|
+
declare const jspt: {
|
|
38
|
+
makePopup: typeof makePopup;
|
|
39
|
+
makeToast: typeof makeToast;
|
|
40
|
+
closePopup: typeof closePopup;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default jspt;
|
|
44
|
+
|
|
45
|
+
declare global {
|
|
46
|
+
interface Window {
|
|
47
|
+
jspt: typeof jspt;
|
|
48
|
+
}
|
|
49
|
+
}
|