index.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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"></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. }
  20. .toast {
  21. user-select: none;
  22. z-index: 10000 !important;
  23. animation-duration: 0.60s;
  24. animation-fill-mode: both;
  25. border-radius: 2px;
  26. cursor: pointer;
  27. overflow-x: hidden !important;
  28. clear: both;
  29. position: absolute;
  30. transform: translateX(20px);
  31. top: 0;
  32. height: auto;
  33. background-color: #323232;
  34. color: #fff;
  35. padding: 10px 25px;
  36. font-size: 1rem;
  37. font-weight: 300;
  38. width: var(--max-width);
  39. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  40. }
  41. .toast-right {
  42. transform: translateX(calc(100vw - (var(--max-width) + 50px) - 20px));
  43. }
  44. .toast-left {
  45. transform: translateX(20px);
  46. }
  47. .toast-top {
  48. margin-top: 5px;
  49. bottom: unset;
  50. top: 0;
  51. }
  52. .toast-bottom {
  53. margin-bottom: 5px;
  54. top: unset;
  55. bottom: 0;
  56. }
  57. </style>
  58. </body>
  59. </html>