ModalLoading.razor 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <div class="modal @modalClass" tabindex="-1" role="dialog" style="display:@modalDisplay; overflow-y: auto;">
  2. <div class="modal-dialog modal-sm" role="document">
  3. <div class="modal-content">
  4. <div class="modal-body">
  5. <div style="text-align: center;">
  6. <div class="lds-roller"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>
  7. </div>
  8. <p style="text-align:center; margin-top:20px">Пожалуйста, подождите...</p>
  9. </div>
  10. </div>
  11. </div>
  12. </div>
  13. @if (showBackdrop)
  14. {
  15. <div class="modal-backdrop fade show"></div>
  16. }
  17. <style>
  18. .lds-roller {
  19. display: inline-block;
  20. position: relative;
  21. width: 80px;
  22. height: 80px;
  23. }
  24. .lds-roller div {
  25. animation: lds-roller 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  26. transform-origin: 40px 40px;
  27. }
  28. .lds-roller div:after {
  29. content: " ";
  30. display: block;
  31. position: absolute;
  32. width: 7px;
  33. height: 7px;
  34. border-radius: 50%;
  35. background: #000000;
  36. margin: -4px 0 0 -4px;
  37. }
  38. .lds-roller div:nth-child(1) {
  39. animation-delay: -0.036s;
  40. }
  41. .lds-roller div:nth-child(1):after {
  42. top: 63px;
  43. left: 63px;
  44. }
  45. .lds-roller div:nth-child(2) {
  46. animation-delay: -0.072s;
  47. }
  48. .lds-roller div:nth-child(2):after {
  49. top: 68px;
  50. left: 56px;
  51. }
  52. .lds-roller div:nth-child(3) {
  53. animation-delay: -0.108s;
  54. }
  55. .lds-roller div:nth-child(3):after {
  56. top: 71px;
  57. left: 48px;
  58. }
  59. .lds-roller div:nth-child(4) {
  60. animation-delay: -0.144s;
  61. }
  62. .lds-roller div:nth-child(4):after {
  63. top: 72px;
  64. left: 40px;
  65. }
  66. .lds-roller div:nth-child(5) {
  67. animation-delay: -0.18s;
  68. }
  69. .lds-roller div:nth-child(5):after {
  70. top: 71px;
  71. left: 32px;
  72. }
  73. .lds-roller div:nth-child(6) {
  74. animation-delay: -0.216s;
  75. }
  76. .lds-roller div:nth-child(6):after {
  77. top: 68px;
  78. left: 24px;
  79. }
  80. .lds-roller div:nth-child(7) {
  81. animation-delay: -0.252s;
  82. }
  83. .lds-roller div:nth-child(7):after {
  84. top: 63px;
  85. left: 17px;
  86. }
  87. .lds-roller div:nth-child(8) {
  88. animation-delay: -0.288s;
  89. }
  90. .lds-roller div:nth-child(8):after {
  91. top: 56px;
  92. left: 12px;
  93. }
  94. @@keyframes lds-roller {
  95. 0% {
  96. transform: rotate(0deg);
  97. }
  98. 100% {
  99. transform: rotate(360deg);
  100. }
  101. }
  102. </style>
  103. @code {
  104. [Parameter]
  105. public RenderFragment Body { get; set; }
  106. private string modalDisplay = "none;";
  107. private string modalClass = "";
  108. private bool showBackdrop = false;
  109. public void Open()
  110. {
  111. modalDisplay = "block;";
  112. modalClass = "show";
  113. showBackdrop = true;
  114. }
  115. public void Close()
  116. {
  117. modalDisplay = "none";
  118. modalClass = "";
  119. showBackdrop = false;
  120. }
  121. }