vue-nt-toast 0.1.4 → 0.2.0
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 +8 -6
- package/dist/nt-toast.es.js +4486 -0
- package/dist/nt-toast.umd.js +12 -0
- package/dist/toast.css +1 -0
- package/package.json +1 -1
- package/src/index.js +3 -1
- package/src/toast.js +3 -0
- package/src/toast.scss +9 -26
package/dist/toast.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
button{border:0 none;background-color:transparent;cursor:pointer}.toast.success,.toast .success{background-color:#528e64!important;color:#fff!important;border-color:#3f6e4d!important}.toast.success:hover,.toast .success:hover{background-color:#3f6e4d}.toast.success-text,.toast .success-text{color:#528e64!important}.toast.success-bg,.toast .success-bg{background-color:#528e64!important}.toast.success-border,.toast .success-border{border-color:#3f6e4d!important}.toast.success.light,.toast .success.light{background-color:#cbe1d2!important;color:#528e64!important;border-color:#3f6e4d!important}.toast.info,.toast .info{background-color:#62b0bc!important;color:#fff!important;border-color:#4698a5!important}.toast.info:hover,.toast .info:hover{background-color:#4698a5}.toast.info-text,.toast .info-text{color:#62b0bc!important}.toast.info-bg,.toast .info-bg{background-color:#62b0bc!important}.toast.info-border,.toast .info-border{border-color:#4698a5!important}.toast.info.light,.toast .info.light{background-color:#d4e9ed!important;color:#62b0bc!important;border-color:#4698a5!important}.toast.danger,.toast .danger{background-color:#d53012!important;color:#fff!important;border-color:#a6250e!important}.toast.danger:hover,.toast .danger:hover{background-color:#a6250e}.toast.danger-text,.toast .danger-text{color:#d53012!important}.toast.danger-bg,.toast .danger-bg{background-color:#d53012!important}.toast.danger-border,.toast .danger-border{border-color:#a6250e!important}.toast.danger.light,.toast .danger.light{background-color:#fbe0da!important;color:#d53012!important;border-color:#a6250e!important}.toast.attention,.toast .attention{background-color:#ec6e00!important;color:#fff!important;border-color:#b95600!important}.toast.attention:hover,.toast .attention:hover{background-color:#b95600}.toast.attention-text,.toast .attention-text{color:#ec6e00!important}.toast.attention-bg,.toast .attention-bg{background-color:#ec6e00!important}.toast.attention-border,.toast .attention-border{border-color:#b95600!important}.toast.attention.light,.toast .attention.light{background-color:#ffe9d6!important;color:#ec6e00!important;border-color:#b95600!important}.toast.importance,.toast .importance{background-color:#fdc036!important;color:#fff!important;border-color:#fcb004!important}.toast.importance:hover,.toast .importance:hover{background-color:#fcb004}.toast.importance-text,.toast .importance-text{color:#fdc036!important}.toast.importance-bg,.toast .importance-bg{background-color:#fdc036!important}.toast.importance-border,.toast .importance-border{border-color:#fcb004!important}.toast.importance.light,.toast .importance.light{background-color:#fff3d7!important;color:#fdc036!important;border-color:#fcb004!important}.toast.red,.toast .red{background-color:#d93b3b!important;color:#fff!important;border-color:#bc2525!important}.toast.red:hover,.toast .red:hover{background-color:#bc2525}.toast.red-text,.toast .red-text{color:#d93b3b!important}.toast.red-bg,.toast .red-bg{background-color:#d93b3b!important}.toast.red-border,.toast .red-border{border-color:#d93b3b!important}.toast.red.light,.toast .red.light{background-color:#f6d1d1!important;color:#d93b3b!important;border-color:#bc2525!important}.toast.sunset,.toast .sunset{background-color:#d44d32!important;color:#fff!important;border-color:#ae3c25!important}.toast.sunset:hover,.toast .sunset:hover{background-color:#ae3c25}.toast.sunset-text,.toast .sunset-text{color:#d44d32!important}.toast.sunset-bg,.toast .sunset-bg{background-color:#d44d32!important}.toast.sunset-border,.toast .sunset-border{border-color:#d44d32!important}.toast.sunset.light,.toast .sunset.light{background-color:#f3cdc6!important;color:#d44d32!important;border-color:#ae3c25!important}.toast.orange,.toast .orange{background-color:#d95b2c!important;color:#fff!important;border-color:#b24820!important}.toast.orange:hover,.toast .orange:hover{background-color:#b24820}.toast.orange-text,.toast .orange-text{color:#d95b2c!important}.toast.orange-bg,.toast .orange-bg{background-color:#d95b2c!important}.toast.orange-border,.toast .orange-border{border-color:#d95b2c!important}.toast.orange.light,.toast .orange.light{background-color:#f4d1c3!important;color:#d95b2c!important;border-color:#b24820!important}.toast.amber,.toast .amber{background-color:#d3873f!important;color:#fff!important;border-color:#b56e2a!important}.toast.amber:hover,.toast .amber:hover{background-color:#b56e2a}.toast.amber-text,.toast .amber-text{color:#d3873f!important}.toast.amber-bg,.toast .amber-bg{background-color:#d3873f!important}.toast.amber-border,.toast .amber-border{border-color:#d3873f!important}.toast.amber.light,.toast .amber.light{background-color:#f4e2d0!important;color:#d3873f!important;border-color:#b56e2a!important}.toast.yellow,.toast .yellow{background-color:#f5b54d!important;color:#fff!important;border-color:#f2a11d!important}.toast.yellow:hover,.toast .yellow:hover{background-color:#f2a11d}.toast.yellow-text,.toast .yellow-text{color:#f5b54d!important}.toast.yellow-bg,.toast .yellow-bg{background-color:#f5b54d!important}.toast.yellow-border,.toast .yellow-border{border-color:#f5b54d!important}.toast.yellow.light,.toast .yellow.light{background-color:#fefbf6!important;color:#f5b54d!important;border-color:#f2a11d!important}.toast.citron,.toast .citron{background-color:#cac747!important;color:#fff!important;border-color:#acaa32!important}.toast.citron:hover,.toast .citron:hover{background-color:#acaa32}.toast.citron-text,.toast .citron-text{color:#cac747!important}.toast.citron-bg,.toast .citron-bg{background-color:#cac747!important}.toast.citron-border,.toast .citron-border{border-color:#cac747!important}.toast.citron.light,.toast .citron.light{background-color:#f2f1d2!important;color:#cac747!important;border-color:#acaa32!important}.toast.lime,.toast .lime{background-color:#85ab39!important;color:#fff!important;border-color:#67852c!important}.toast.lime:hover,.toast .lime:hover{background-color:#67852c}.toast.lime-text,.toast .lime-text{color:#85ab39!important}.toast.lime-bg,.toast .lime-bg{background-color:#85ab39!important}.toast.lime-border,.toast .lime-border{border-color:#85ab39!important}.toast.lime.light,.toast .lime.light{background-color:#d4e5b1!important;color:#85ab39!important;border-color:#67852c!important}.toast.green,.toast .green{background-color:#48992f!important;color:#fff!important;border-color:#367223!important}.toast.green:hover,.toast .green:hover{background-color:#367223}.toast.green-text,.toast .green-text{color:#48992f!important}.toast.green-bg,.toast .green-bg{background-color:#48992f!important}.toast.green-border,.toast .green-border{border-color:#48992f!important}.toast.green.light,.toast .green.light{background-color:#abe09a!important;color:#48992f!important;border-color:#367223!important}.toast.mint,.toast .mint{background-color:#3a874f!important;color:#fff!important;border-color:#2b633a!important}.toast.mint:hover,.toast .mint:hover{background-color:#2b633a}.toast.mint-text,.toast .mint-text{color:#3a874f!important}.toast.mint-bg,.toast .mint-bg{background-color:#3a874f!important}.toast.mint-border,.toast .mint-border{border-color:#3a874f!important}.toast.mint.light,.toast .mint.light{background-color:#9ed5ad!important;color:#3a874f!important;border-color:#2b633a!important}.toast.teal,.toast .teal{background-color:#449698!important;color:#fff!important;border-color:#347375!important}.toast.teal:hover,.toast .teal:hover{background-color:#347375}.toast.teal-text,.toast .teal-text{color:#449698!important}.toast.teal-bg,.toast .teal-bg{background-color:#449698!important}.toast.teal-border,.toast .teal-border{border-color:#449698!important}.toast.teal.light,.toast .teal.light{background-color:#b2dcdd!important;color:#449698!important;border-color:#347375!important}.toast.cyan,.toast .cyan{background-color:#4d9bcc!important;color:#fff!important;border-color:#3382b3!important}.toast.cyan:hover,.toast .cyan:hover{background-color:#3382b3}.toast.cyan-text,.toast .cyan-text{color:#4d9bcc!important}.toast.cyan-bg,.toast .cyan-bg{background-color:#4d9bcc!important}.toast.cyan-border,.toast .cyan-border{border-color:#4d9bcc!important}.toast.cyan.light,.toast .cyan.light{background-color:#d8e9f4!important;color:#4d9bcc!important;border-color:#3382b3!important}.toast.blue,.toast .blue{background-color:#4e7af8!important;color:#fff!important;border-color:#1d55f6!important}.toast.blue:hover,.toast .blue:hover{background-color:#1d55f6}.toast.blue-text,.toast .blue-text{color:#4e7af8!important}.toast.blue-bg,.toast .blue-bg{background-color:#4e7af8!important}.toast.blue-border,.toast .blue-border{border-color:#4e7af8!important}.toast.blue.light,.toast .blue.light{background-color:#fafbff!important;color:#4e7af8!important;border-color:#1d55f6!important}.toast.indigo,.toast .indigo{background-color:#5642ed!important;color:#fff!important;border-color:#2e16e6!important}.toast.indigo:hover,.toast .indigo:hover{background-color:#2e16e6}.toast.indigo-text,.toast .indigo-text{color:#5642ed!important}.toast.indigo-bg,.toast .indigo-bg{background-color:#5642ed!important}.toast.indigo-border,.toast .indigo-border{border-color:#5642ed!important}.toast.indigo.light,.toast .indigo.light{background-color:#e8e5fd!important;color:#5642ed!important;border-color:#2e16e6!important}.toast.purple,.toast .purple{background-color:#8756f3!important;color:#fff!important;border-color:#6526f0!important}.toast.purple:hover,.toast .purple:hover{background-color:#6526f0}.toast.purple-text,.toast .purple-text{color:#8756f3!important}.toast.purple-bg,.toast .purple-bg{background-color:#8756f3!important}.toast.purple-border,.toast .purple-border{border-color:#8756f3!important}.toast.purple.light,.toast .purple.light{background-color:#fdfdff!important;color:#8756f3!important;border-color:#6526f0!important}.toast.pink,.toast .pink{background-color:#bf3da0!important;color:#fff!important;border-color:#983180!important}.toast.pink:hover,.toast .pink:hover{background-color:#983180}.toast.pink-text,.toast .pink-text{color:#bf3da0!important}.toast.pink-bg,.toast .pink-bg{background-color:#bf3da0!important}.toast.pink-border,.toast .pink-border{border-color:#bf3da0!important}.toast.pink.light,.toast .pink.light{background-color:#ecc3e2!important;color:#bf3da0!important;border-color:#983180!important}.toast.rose,.toast .rose{background-color:#bb3a62!important;color:#fff!important;border-color:#942e4e!important}.toast.rose:hover,.toast .rose:hover{background-color:#942e4e}.toast.rose-text,.toast .rose-text{color:#bb3a62!important}.toast.rose-bg,.toast .rose-bg{background-color:#bb3a62!important}.toast.rose-border,.toast .rose-border{border-color:#bb3a62!important}.toast.rose.light,.toast .rose.light{background-color:#ebbdcb!important;color:#bb3a62!important;border-color:#942e4e!important}.toast-board{position:fixed;display:flex;flex-direction:column;z-index:9999}.toast-board.on-top{flex-direction:column-reverse}.toast-board.top-left{top:0;left:0}.toast-board.top-center{top:0;left:50%;transform:translate(-50%)}.toast-board.top-right{top:0;right:0}.toast-board.top-full-width{top:0;left:50%;transform:translate(-50%);width:80%}.toast-board.top-full-width .toast{width:100%}.toast-board.bottom-left{bottom:0;left:0}.toast-board.bottom-center{bottom:0;left:50%;transform:translate(-50%)}.toast-board.bottom-right{bottom:0;right:0}.toast-board.bottom-full-width{bottom:0;left:50%;transform:translate(-50%);width:80%}.toast-board.bottom-full-width .toast{width:100%}.toast-board .toast{position:relative;display:flex;justify-content:flex-start;width:400px;margin:5px;color:#333;border-radius:4px;box-shadow:2px 5px 5px #00000029;background-color:#fff;transition-property:opacity,transform;transition-duration:.5s,1s;line-height:1em;vertical-align:baseline;opacity:0;font-size:1.2em;overflow:hidden;animation:swing-off .5s ease}.toast-board .toast.fade{opacity:.95;transform:translate(0)}.toast-board .toast.swing{animation:swing .5s ease;opacity:.95}.toast-board .toast.round{border-radius:2em}.toast-board .toast .toast-contents{flex-grow:1;padding:10px 25px 10px 10px;max-width:calc(100% - 50px);font-size:.8em;overflow-wrap:break-word}.toast-board .toast .toast-contents h5{font-weight:700;font-size:1.2em;margin-bottom:10px}.toast-board .toast .toast-close{flex-shrink:1;cursor:pointer;padding:20px;line-height:1em;position:absolute;top:50%;right:0;transform:translateY(-50%);font-size:1em;color:inherit}.toast-board .toast .toast-icon{flex-shrink:1;padding:10px}.toast-board .toast.line-left .toast-contents{border-left:5px solid}.toast-board .toast.line-top .toast-contents{border-top:5px solid}@keyframes swing{0%{transform:translate(300px);opacity:0}25%{transform:translate(20px)}75%{transform:translate(-10px);opacity:.95}to{transform:translate(0)}}@keyframes swing-off{0%{transform:translate(0)}25%{transform:translate(-10px)}75%{transform:translate(20px)}to{transform:translate(300px)}}
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -24,6 +24,8 @@ const setOption = option => {
|
|
|
24
24
|
export default {
|
|
25
25
|
install(app, options = {}) {
|
|
26
26
|
extendOptions = setOption(options)
|
|
27
|
-
app.config.globalProperties.$
|
|
27
|
+
app.config.globalProperties.$ntToast = new ToastBoard(extendOptions)
|
|
28
|
+
|
|
29
|
+
app.provide('$ntToast', new ToastBoard(extendOptions))
|
|
28
30
|
}
|
|
29
31
|
}
|
package/src/toast.js
CHANGED
|
@@ -22,6 +22,7 @@ class Toast {
|
|
|
22
22
|
this.toast = document.createElement('div')
|
|
23
23
|
this.toast.classList.add('toast', 'swing')
|
|
24
24
|
// const contents = document.createElement('div')
|
|
25
|
+
|
|
25
26
|
const contents = this.setContents()
|
|
26
27
|
this.setIcon()
|
|
27
28
|
if (this.options.round) {
|
|
@@ -52,6 +53,8 @@ class Toast {
|
|
|
52
53
|
// clearTimeout(this.interval)
|
|
53
54
|
// })
|
|
54
55
|
// }
|
|
56
|
+
|
|
57
|
+
|
|
55
58
|
setIcon() {
|
|
56
59
|
if (!this.options.useIcon || this.options.theme === 'line') return
|
|
57
60
|
this.icon = document.createElement('div')
|
package/src/toast.scss
CHANGED
|
@@ -234,29 +234,18 @@ $colors: (
|
|
|
234
234
|
animation-name: swing-reverse;
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
|
-
&:is(.top-center, .top-full
|
|
238
|
-
animation-name: pull-
|
|
237
|
+
&:is(.top-center, .top-full) .toast {
|
|
238
|
+
animation-name: pull-down-off;
|
|
239
239
|
&.swing {
|
|
240
|
-
animation-name: pull-
|
|
240
|
+
animation-name: pull-down;
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
&:is(.bottom-center, .bottom-full
|
|
244
|
-
animation-name: pull-
|
|
243
|
+
&:is(.bottom-center, .bottom-full) .toast {
|
|
244
|
+
animation-name: pull-up-off;
|
|
245
245
|
&.swing {
|
|
246
|
-
animation-name: pull-
|
|
246
|
+
animation-name: pull-up;
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
// .ga-primary {
|
|
250
|
-
// background-color: $primary;
|
|
251
|
-
// color: $white;
|
|
252
|
-
// &-text {
|
|
253
|
-
// color: $primary;
|
|
254
|
-
// }
|
|
255
|
-
// }
|
|
256
|
-
// .ga-secondary {
|
|
257
|
-
// background-color: $secondary;
|
|
258
|
-
// color: $white;
|
|
259
|
-
// }
|
|
260
249
|
}
|
|
261
250
|
@keyframes swing {
|
|
262
251
|
0% {
|
|
@@ -302,12 +291,11 @@ $colors: (
|
|
|
302
291
|
}
|
|
303
292
|
75% {
|
|
304
293
|
transform: translateX(10px);
|
|
305
|
-
opacity: .95;
|
|
294
|
+
opacity: 0.95;
|
|
306
295
|
}
|
|
307
296
|
100% {
|
|
308
297
|
transform: translateX(0px);
|
|
309
298
|
}
|
|
310
|
-
|
|
311
299
|
}
|
|
312
300
|
@keyframes swing-reverse-off {
|
|
313
301
|
0% {
|
|
@@ -324,7 +312,6 @@ $colors: (
|
|
|
324
312
|
transform: translateX(-300px);
|
|
325
313
|
//opacity: 0;
|
|
326
314
|
}
|
|
327
|
-
|
|
328
315
|
}
|
|
329
316
|
@keyframes pull-up {
|
|
330
317
|
0% {
|
|
@@ -336,12 +323,11 @@ $colors: (
|
|
|
336
323
|
}
|
|
337
324
|
75% {
|
|
338
325
|
transform: translateY(-5px);
|
|
339
|
-
opacity: .95;
|
|
326
|
+
opacity: 0.95;
|
|
340
327
|
}
|
|
341
328
|
100% {
|
|
342
329
|
transform: translateY(0px);
|
|
343
330
|
}
|
|
344
|
-
|
|
345
331
|
}
|
|
346
332
|
@keyframes pull-up-off {
|
|
347
333
|
0% {
|
|
@@ -358,7 +344,6 @@ $colors: (
|
|
|
358
344
|
transform: translateY(-30px);
|
|
359
345
|
//opacity: 0;
|
|
360
346
|
}
|
|
361
|
-
|
|
362
347
|
}
|
|
363
348
|
@keyframes pull-down {
|
|
364
349
|
0% {
|
|
@@ -370,12 +355,11 @@ $colors: (
|
|
|
370
355
|
}
|
|
371
356
|
75% {
|
|
372
357
|
transform: translateY(5px);
|
|
373
|
-
opacity: .95;
|
|
358
|
+
opacity: 0.95;
|
|
374
359
|
}
|
|
375
360
|
100% {
|
|
376
361
|
transform: translateY(0px);
|
|
377
362
|
}
|
|
378
|
-
|
|
379
363
|
}
|
|
380
364
|
@keyframes pull-down-off {
|
|
381
365
|
0% {
|
|
@@ -392,5 +376,4 @@ $colors: (
|
|
|
392
376
|
transform: translateY(30px);
|
|
393
377
|
//opacity: 0;
|
|
394
378
|
}
|
|
395
|
-
|
|
396
379
|
}
|