index.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Example</title>
  6. </head>
  7. <body>
  8. <div id="toasts-container" class="position-right position-bottom"></div>
  9. <script src="../dist/example.js"></script>
  10. <style>
  11. :root {
  12. --max-width: 250px;
  13. }
  14. body {
  15. padding: 0;
  16. margin: 0;
  17. }
  18. #toasts-container {
  19. position: fixed;
  20. height: 100vh;
  21. display: flex;
  22. flex-direction: column;
  23. top: 20px;
  24. left: 20px;
  25. }
  26. #toasts-container.position-left {
  27. right: 0;
  28. left: 20px;
  29. align-items: flex-start;
  30. }
  31. #toasts-container.position-right {
  32. left: 0;
  33. right: 20px;
  34. align-items: flex-end;
  35. }
  36. #toasts-container.position-top {
  37. bottom: 0;
  38. top: 20px;
  39. justify-content: flex-start;
  40. }
  41. #toasts-container.position-bottom {
  42. top: 0;
  43. margin-top: -20px;
  44. justify-content: flex-end;
  45. }
  46. .toast {
  47. margin-bottom: 5px;
  48. user-select: none;
  49. z-index: 10000 !important;
  50. border-radius: 2px;
  51. cursor: pointer;
  52. position: relative;
  53. top: 0;
  54. height: auto;
  55. background-color: #323232;
  56. color: #fff;
  57. padding: 10px 25px;
  58. font-size: 1rem;
  59. font-weight: 300;
  60. width: var(--max-width);
  61. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  62. }
  63. </style>
  64. </body>
  65. </html>