forked from HoanghoDev/toast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
97 lines (94 loc) · 1.78 KB
/
style.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');
body {
margin: 0;
font-family: 'Poppins', sans-serif;
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
background: #1C1D22;
}
button{
padding: 10px;
}
.notifications {
position: fixed;
top: 30px;
right: 20px;
}
.toast{
position: relative;
padding: 10px;
margin-bottom: 10px;
color: #fff;
width: 400px;
display: grid;
grid-template-columns: 70px 1fr 70px;
border-radius: 5px;
--color: #0abf30;
background-image: linear-gradient(to right, #0abf3055, #22242F 30%);
animation: show_toast 0.3s ease forwards;
}
.toast i{
color: var(--color);
}
.toast .title{
font-size: x-large;
font-weight: bold;
}
.toast i{
display: flex;
justify-content: center;
align-items: center;
font-size: x-large;
}
.toast span,
.toast .close{
opacity: 0.6;
color: #fff
}
@keyframes show_toast {
0% {
transform: translateX(100%);
}
40% {
transform: translateX(-5%);
}
80% {
transform: translateX(0%);
}
100% {
transform: translateX(-10%);
}
}
.toast::before{
position: absolute;
bottom: 0;
left: 0;
background-color: var(--color);
box-shadow: 0 0 10px var(--color);
content: '';
width: 100%;
height: 3px;
animation: timeOut 5s linear 1 forwards;
}
@keyframes timeOut{
to{
width: 0%;
}
}
/* error */
.toast.error{
--color: #f24d4c;
background-image: linear-gradient(to right, #f24d4c55, #22242F 30%);
}
/* warning */
.toast.warning{
--color: #e9bd0c;
background-image: linear-gradient(to right, #e9bd0c55, #22242F 30%);
}
/* info */
.toast.info{
--color: #3498db;
background-image: linear-gradient(to right, #3498db55, #22242F 30%);
}