Skip to content

Commit 7289e78

Browse files
author
Kyle Andrews
committed
Updates example page
1 parent 3640f62 commit 7289e78

File tree

1 file changed

+65
-15
lines changed

1 file changed

+65
-15
lines changed

docs/index.html

Lines changed: 65 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
}
7575

7676
p{
77-
padding: 0;
77+
padding: 0 16px;
7878
margin: 0;
7979
}
8080

@@ -85,7 +85,7 @@
8585
transform: translateX(-50%) scale(0.87);
8686
opacity: 0;
8787
transform-origin: center bottom;
88-
padding: 0 16px;
88+
padding: 0;
8989
border-radius: 4px;
9090
min-width: 340px;
9191
max-width: calc(100vw - 64px);
@@ -97,33 +97,56 @@
9797
line-height: 48px;
9898
height: 48px;
9999
z-index: 9999;
100+
display: inline-flex;
101+
justify-content: space-between;
102+
flex-flow: row nowrap;
100103
}
101104

102105
user-notification.is-infinite{
103106
animation: popInNotification 150ms cubic-bezier(0.0, 0.0, 0.2, 1) forwards;
104107
}
105108

109+
user-notification user-actions{
110+
display: inline-flex;
111+
align-items: center;
112+
padding: 0 8px;
113+
}
114+
106115
user-notification button{
107-
display: inline-block;
116+
margin: 0;
117+
margin-left: 8px;
108118
height: 36px;
109119
line-height: 34px;
110-
margin: 0;
111-
padding: 0 16px;
120+
padding: 0 8px;
112121
border: none;
113122
outline: none;
114123
box-shadow: none;
115124
border-radius: 2px;
116-
position: absolute;
117125
font-size: 14px;
118126
text-transform: uppercase;
119127
user-select: none;
120-
top: 6px;
121-
right: 6px;
128+
background-color: transparent;
129+
color: rgb(112, 91, 255);
122130
transition: all 150ms cubic-bezier(0.4, 0.0, 0.2, 1);
123131
}
124132

133+
user-notification button:only-child{
134+
margin-left: 0;
135+
}
136+
137+
user-actions button:first-child{
138+
margin-left: 0;
139+
}
140+
141+
user-notification button:hover{
142+
background-color: rgba(112, 91, 255, 0.25);
143+
color: rgb(112, 91, 255);
144+
}
145+
125146
user-notification button:active{
126147
transform: none;
148+
background-color: rgba(112, 91, 255, 0.4);
149+
color: rgb(112, 91, 255);
127150
}
128151

129152
user-notification close-button{
@@ -134,20 +157,24 @@
134157
justify-content: center;
135158
align-items: center;
136159
flex-flow: column wrap;
137-
position: absolute;
138-
top: 6px;
139-
right: 6px;
140-
background-color: rgb(106, 90, 205);
141-
color: #ffffff;
160+
background-color: transparent;
161+
color: rgb(112, 91, 255);
142162
cursor: pointer;
163+
margin-left: 8px;
164+
}
165+
166+
user-notification close-button:only-child{
167+
margin-left: 0;
143168
}
144169

145170
user-notification close-button:hover{
146-
background-color: hsl(248, 53%, 61%);
171+
background-color: rgba(112, 91, 255, 0.25);
172+
color: rgb(112, 91, 255);
147173
}
148174

149175
user-notification close-button:active{
150-
background-color: hsl(248, 53%, 55%);
176+
background-color: rgba(112, 91, 255, 0.4);
177+
color: rgb(112, 91, 255);
151178
}
152179

153180
user-notification close-button svg{
@@ -192,13 +219,15 @@
192219
<button class="js-sample-1">Default Notification</button>
193220
<button class="js-sample-2">Interactive Notification</button>
194221
<button class="js-sample-3">Closeable Notification</button>
222+
<button class="js-sample-4">Fully Loaded Notification</button>
195223
</div>
196224
</main>
197225
<script src="assets/Notify.js" defer="defer"></script>
198226
<script defer="defer">
199227
const sample1 = document.body.querySelector('.js-sample-1');
200228
const sample2 = document.body.querySelector('.js-sample-2');
201229
const sample3 = document.body.querySelector('.js-sample-3');
230+
const sample4 = document.body.querySelector('.js-sample-4');
202231

203232
sample1.addEventListener('click', ()=>{
204233
new exports['Notify'].prototype.constructor({
@@ -226,6 +255,27 @@
226255
closeable: true
227256
});
228257
});
258+
259+
sample4.addEventListener('click', ()=>{
260+
new exports['Notify'].prototype.constructor({
261+
message: 'Fully interactive snackbar notification message',
262+
duration: Infinity,
263+
actions: [
264+
{
265+
label: 'Close',
266+
value: 'close'
267+
},
268+
{
269+
label: 'Reload',
270+
value: 'reload'
271+
}
272+
],
273+
closeable: true,
274+
callback: function(value){
275+
console.log(value);
276+
}
277+
});
278+
});
229279
</script>
230280
</body>
231281
</html>

0 commit comments

Comments
 (0)