parent
96160898a5
commit
cf32370b6d
12 changed files with 423 additions and 271 deletions
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 597 B |
@ -0,0 +1,14 @@ |
|||||||
|
import $ from 'jquery'; |
||||||
|
import '../../sass/components/notification.scss'; |
||||||
|
|
||||||
|
export function showNotification(style, text) { |
||||||
|
let htmlNode = document.createElement('div'); |
||||||
|
let htmlElement = $(htmlNode).addClass('notification').addClass(`notification--${style}`).text(text).appendTo($('body')); |
||||||
|
|
||||||
|
setTimeout(() => { |
||||||
|
htmlElement.fadeOut(400, () => { |
||||||
|
htmlElement.remove(); |
||||||
|
}) |
||||||
|
}, 3500); |
||||||
|
} |
||||||
|
|
||||||
@ -0,0 +1,33 @@ |
|||||||
|
.notification { |
||||||
|
min-width: 380px; |
||||||
|
box-sizing: border-box; |
||||||
|
border-radius: 4px; |
||||||
|
border-width: 1px; |
||||||
|
border-style: solid; |
||||||
|
border-color: #ebeef5; |
||||||
|
position: fixed; |
||||||
|
left: 50%; |
||||||
|
top: 20px; |
||||||
|
transform: translateX(-50%); |
||||||
|
background-color: #edf2fc; |
||||||
|
transition: opacity 0.3s, transform .4s; |
||||||
|
overflow: hidden; |
||||||
|
padding: 15px 15px 15px 20px; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
z-index: 1000; |
||||||
|
|
||||||
|
&--success { |
||||||
|
background: #53CF86; |
||||||
|
color: #fff; |
||||||
|
border: none; |
||||||
|
box-shadow: 0 4px 15px rgba(0, 196, 83, 0.31); |
||||||
|
} |
||||||
|
|
||||||
|
&--error { |
||||||
|
background: #D12424; |
||||||
|
color: #fff; |
||||||
|
border: none; |
||||||
|
box-shadow: 0 4px 15px rgba(255, 36, 36, 0.51); |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue