diff options
Diffstat (limited to 'views/includes/notification.html')
| -rw-r--r-- | views/includes/notification.html | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/views/includes/notification.html b/views/includes/notification.html new file mode 100644 index 0000000..d8323b7 --- /dev/null +++ b/views/includes/notification.html | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | {{ define "notification" }} | ||
| 2 | <style scoped> | ||
| 3 | #notification { | ||
| 4 | transition: opacity .5s; | ||
| 5 | opacity: 1.0; | ||
| 6 | padding: 8px; | ||
| 7 | } | ||
| 8 | |||
| 9 | #notification div { | ||
| 10 | padding: 8px; | ||
| 11 | border-radius: 4px; | ||
| 12 | } | ||
| 13 | </style> | ||
| 14 | <div class="row" id="notification"> | ||
| 15 | <div class="col s12 center-align white-text {{ if eq .Type "error" }}red darken-2 {{ else }}green lighten-2{{ end }}"> | ||
| 16 | {{ .Message }} | ||
| 17 | </div> | ||
| 18 | </div> | ||
| 19 | <script>'use strict'; | ||
| 20 | const el = document.getElementById('notification'); | ||
| 21 | setTimeout(() => el.style.opacity = 0.0, 3000); | ||
| 22 | </script> | ||
| 23 | {{ end }} | ||
