diff options
Diffstat (limited to 'layouts/shortcodes/alert.html')
| -rw-r--r-- | layouts/shortcodes/alert.html | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/layouts/shortcodes/alert.html b/layouts/shortcodes/alert.html new file mode 100644 index 0000000..3a55964 --- /dev/null +++ b/layouts/shortcodes/alert.html @@ -0,0 +1,73 @@ +{{ $severity := .Get 0 }} +{{ $title := .Get 1 }} + +<div class="alert-box {{ $severity }}"> + {{ if $title }} + <h3 class="alert-title">{{ $title }}</h3> + {{ end }} + <p class="flex flex-row items-center gap-2"> + {{ if eq $severity "info" }} + <svg + xmlns="http://www.w3.org/2000/svg" + fill="none" + viewBox="0 0 24 24" + stroke-width="1.5" + stroke="currentColor" + class="alert-icon" + > + <path + stroke-linecap="round" + stroke-linejoin="round" + d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" + /> + </svg> + {{ else if eq $severity "warning" }} + <svg + xmlns="http://www.w3.org/2000/svg" + fill="none" + viewBox="0 0 24 24" + stroke-width="1.5" + stroke="currentColor" + class="alert-icon" + > + <path + stroke-linecap="round" + stroke-linejoin="round" + d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" + /> + </svg> + {{ else if eq $severity "error" }} + <svg + xmlns="http://www.w3.org/2000/svg" + fill="none" + viewBox="0 0 24 24" + stroke-width="1.5" + stroke="currentColor" + class="alert-icon" + > + <path + stroke-linecap="round" + stroke-linejoin="round" + d="M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" + /> + </svg> + {{ else if eq $severity "success" }} + <svg + xmlns="http://www.w3.org/2000/svg" + fill="none" + viewBox="0 0 24 24" + stroke-width="1.5" + stroke="currentColor" + class="alert-icon" + > + <path + stroke-linecap="round" + stroke-linejoin="round" + d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" + /> + </svg> + + {{ end }} + {{.Inner}} + </p> +</div> |
