-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
228 lines (223 loc) · 6.34 KB
/
index.html
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Notificador</title>
<meta name="description" content="componente hecho en JS para mostrar notificaciones. Generalmente usado para indicar errores, éxito, información o advertencias">
<meta name="author" content="https://github.com/JoseJuan81">
<style>
:root {
--button-color: #3772FF;
--background-page: rgba(245, 245, 245, 0.25);
}
body {
margin: 0;
background-color: var(--background-page);
}
.notification-btn {
background-color: var(--button-color);
border: none;
border-radius: 5px;
color: white;
cursor: pointer;
padding: 0.75rem 1rem;
transition-duration: 120ms;
}
.notification-btn:focus {
outline: none;
}
.notification-btn:hover {
transform: scale(1.025);
}
.notification-example {
align-items: center;
display: flex;
flex-direction: column;
justify-content: start;
margin-bottom: 2rem
}
.container {
align-items: center;
display: flex;
flex-direction: column;
justify-content: start;
margin: auto;
max-width: 300px;
padding-top: 3rem;
}
.code-container {
background-color: rgba(0, 0, 0, 0.8);
color: white;
padding: 1rem;
border-radius: 3px;
margin-top: 1rem;
}
pre {
margin: 0;
}
.indent-1 {
margin-left: 1rem;
}
.instance {
color: cyan;
}
.variable {
color: greenyellow;
}
.object-prop {
color: peru;
}
@media (min-width: 640px) {
.container {
max-width: 540px;
}
}
@media (min-width: 768px) {
.container {
max-width: 668px;
}
}
@media (min-width: 1024px) {
.container {
max-width: 924px;
}
}
@media (min-width: 1280px) {
.container {
max-width: 1180px;
}
}
</style>
</head>
<body>
<div class="container">
<section class="notification-example">
<div class="">
<button
class="notification-btn"
style="background-color: #2EDC76"
id="success-right-default"
type="button"
>
Êxito 1 ->
</button>
</div>
<div class="code-container">
<code>
<pre><span class="instance">notification</span>.<span class="variable">success</span>({</pre>
<pre class="indent-1"><span class="object-prop">message</span>: 'Notificación de éxito con tiempo y color por defecto (4 segundos)'</pre>
<pre class="indent-1"><span class="object-prop">closeBtn</span>: true</pre>
<pre>}, () => {</pre>
<pre class="indent-1">console.log('fin de: successRightDefault');</pre>
<pre>})</pre>
</code>
</div>
</section>
<section class="notification-example">
<div class="">
<button
class="notification-btn"
style="background-color: #5FAD56"
id="success-right-time-color"
type="button"
>
Éxito 2 ->
</button>
</div>
<div class="code-container">
<code>
<pre><span class="instance">notification</span>.<span class="variable">success</span>({</pre>
<pre class="indent-1"><span class="object-prop">message</span>: 'Notificación de éxito con tiempo de 2 segundos y color personalizado',</pre>
<pre class="indent-1"><span class="object-prop">duration</span>: 2000,</pre>
<pre class="indent-1"><span class="object-prop">backgroundColor:</span>: '#5FAD56',</pre>
<pre>})</pre>
</code>
</div>
</section>
<section class="notification-example">
<div>
<button
class="notification-btn"
style="background-color: #06f"
id="info-right-color"
type="button"
>
Información ->
</button>
</div>
<div class="code-container">
<code>
<pre><span class="instance">notification</span>.<span class="variable">info</span>({</pre>
<pre class="indent-1"><span class="object-prop">message</span>: 'Notificación de información con tiempo por defecto y otro color',</pre>
<pre class="indent-1"><span class="object-prop">color:</span>: '#F5EE9E',</pre>
<pre>})</pre>
</code>
</div>
</section>
<section class="notification-example">
<div>
<button
class="notification-btn"
style="background-color: #EC0B43"
id="error-left-time-color"
type="button"
>
<- Error
</button>
</div>
<div class="code-container">
<code>
<pre><span class="instance">notification</span>.<span class="variable">error</span>({</pre>
<pre class="indent-1"><span class="object-prop">backgroundColor</span>: '#D00000',</pre>
<pre class="indent-1"><span class="object-prop">message:</span>: 'Notificación de error con tiempo de 2.6 seg y otro color',</pre>
<pre class="indent-1"><span class="object-prop">duration:</span>: 2600,</pre>
<pre>})</pre>
</code>
</div>
</section>
<section class="notification-example">
<div>
<button
class="notification-btn"
style="background-color: #FFBC42"
id="warning-left-time-color"
type="button"
>
<- advertencia
</button>
</div>
<div class="code-container">
<code>
<pre><span class="instance">notification</span>.<span class="variable">warning</span>('Notificación de advertencia')</pre>
</code>
</div>
</section>
<section class="notification-example">
<div>
<button
class="notification-btn"
style="color: #FF6542;background-color:#D7D9D7"
id="info-config"
type="button"
>
<- info
</button>
</div>
<div class="code-container">
<code>
<pre><span class="instance">notification</span>.<span class="variable">info</span>({</pre>
<pre class="indent-1"><span class="object-prop">backgroundColor</span>: '#D7D9D7',</pre>
<pre class="indent-1"><span class="object-prop">closeBtn:</span>: true,</pre>
<pre class="indent-1"><span class="object-prop">color:</span>: '#FF6542',</pre>
<pre class="indent-1"><span class="object-prop">message:</span>: 'Notificación con colores personalizado',</pre>
<pre class="indent-1"><span class="object-prop">duration:</span>: 7500,</pre>
<pre>})</pre>
</code>
</div>
</section>
</div>
<script src="public/js/main.bundle.js"></script>
</body>
</html>