vue-nt-toast 0.1.3 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-nt-toast",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Toast system plugin with vue3",
5
5
  "author": "Minyoung Tommy Kim",
6
6
  "private": false,
package/src/index.js CHANGED
@@ -12,7 +12,8 @@ const defaultOptions = {
12
12
  clickToClose: true,
13
13
  displayOnTop: false,
14
14
  snackbar: false,
15
- freeze: true
15
+ freeze: true,
16
+ transition: 'swing'
16
17
  }
17
18
 
18
19
  let extendOptions = {}
package/src/toast.js CHANGED
@@ -56,7 +56,7 @@ class Toast {
56
56
  if (!this.options.useIcon || this.options.theme === 'line') return
57
57
  this.icon = document.createElement('div')
58
58
  this.icon.classList.add('toast-icon')
59
- const iconClass = statusIcon[this.type] || 'hexagon-exclamation'
59
+ const iconClass = statusIcon[this.type] || 'exclamation-circle'
60
60
  this.icon.innerHTML = `<i class="fa fa-${iconClass}" />`
61
61
  // this.icon.innerHTML = `<img src="./icons/success.svg" />`
62
62
  // this.toast.appendChild(this.icon)
package/src/toast.scss CHANGED
@@ -228,6 +228,24 @@ $colors: (
228
228
  }
229
229
  }
230
230
  }
231
+ &:is(.top-left, .bottom-left) .toast {
232
+ animation-name: swing-reverse-off;
233
+ &.swing {
234
+ animation-name: swing-reverse;
235
+ }
236
+ }
237
+ &:is(.top-center, .top-full-width) .toast {
238
+ animation-name: pull-up-off;
239
+ &.swing {
240
+ animation-name: pull-up;
241
+ }
242
+ }
243
+ &:is(.bottom-center, .bottom-full-width) .toast {
244
+ animation-name: pull-down-off;
245
+ &.swing {
246
+ animation-name: pull-down;
247
+ }
248
+ }
231
249
  // .ga-primary {
232
250
  // background-color: $primary;
233
251
  // color: $white;
@@ -273,4 +291,106 @@ $colors: (
273
291
  //opacity: 0;
274
292
  }
275
293
 
294
+ }
295
+ @keyframes swing-reverse {
296
+ 0% {
297
+ transform: translateX(-300px);
298
+ opacity: 0;
299
+ }
300
+ 25% {
301
+ transform: translateX(-20px);
302
+ }
303
+ 75% {
304
+ transform: translateX(10px);
305
+ opacity: .95;
306
+ }
307
+ 100% {
308
+ transform: translateX(0px);
309
+ }
310
+
311
+ }
312
+ @keyframes swing-reverse-off {
313
+ 0% {
314
+ transform: translateX(0px);
315
+ }
316
+ 25% {
317
+ transform: translateX(10px);
318
+ //opacity: 0.95;
319
+ }
320
+ 75% {
321
+ transform: translateX(-20px);
322
+ }
323
+ 100% {
324
+ transform: translateX(-300px);
325
+ //opacity: 0;
326
+ }
327
+
328
+ }
329
+ @keyframes pull-up {
330
+ 0% {
331
+ transform: translateY(30px);
332
+ opacity: 0;
333
+ }
334
+ 25% {
335
+ transform: translateY(10px);
336
+ }
337
+ 75% {
338
+ transform: translateY(-5px);
339
+ opacity: .95;
340
+ }
341
+ 100% {
342
+ transform: translateY(0px);
343
+ }
344
+
345
+ }
346
+ @keyframes pull-up-off {
347
+ 0% {
348
+ transform: translateY(0px);
349
+ }
350
+ 25% {
351
+ transform: translateY(5px);
352
+ //opacity: 0.95;
353
+ }
354
+ 75% {
355
+ transform: translateY(-10px);
356
+ }
357
+ 100% {
358
+ transform: translateY(-30px);
359
+ //opacity: 0;
360
+ }
361
+
362
+ }
363
+ @keyframes pull-down {
364
+ 0% {
365
+ transform: translateY(-30px);
366
+ opacity: 0;
367
+ }
368
+ 25% {
369
+ transform: translateY(-10px);
370
+ }
371
+ 75% {
372
+ transform: translateY(5px);
373
+ opacity: .95;
374
+ }
375
+ 100% {
376
+ transform: translateY(0px);
377
+ }
378
+
379
+ }
380
+ @keyframes pull-down-off {
381
+ 0% {
382
+ transform: translateY(0px);
383
+ }
384
+ 25% {
385
+ transform: translateY(-5px);
386
+ //opacity: 0.95;
387
+ }
388
+ 75% {
389
+ transform: translateY(10px);
390
+ }
391
+ 100% {
392
+ transform: translateY(30px);
393
+ //opacity: 0;
394
+ }
395
+
276
396
  }