Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

authloader.js 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. const template = document.createElement('template');
  2. template.innerHTML = `
  3. <style>
  4. .authloaderanwi {
  5. display: flex;
  6. justify-content: center;
  7. align-items: center;
  8. }
  9. .wrap{
  10. position:absolute;
  11. left:50%;
  12. width:5em;
  13. height:5em;
  14. top:20%;
  15. transform: translate(-50%,-50%);
  16. }
  17. .loader{
  18. transition: all 0.7s ease-in-out;
  19. border:5px solid #ebebeb;
  20. border-bottom-color:black;
  21. width: 20px;
  22. height: 20px;
  23. border-radius:50%;
  24. -webkit-font-smoothing: antialiased !important;
  25. margin:30px 0px;
  26. }
  27. #lrd1{
  28. -webkit-animation: spin1 0.5s linear infinite;
  29. }
  30. #lrd2{
  31. -webkit-animation: spin2 3s ease-in-out infinite;
  32. }
  33. #lrd3{
  34. -webkit-animation: spin3 15s ease-in-out infinite;
  35. }
  36. @keyframes spin1{
  37. 0% {
  38. transform: rotate(0deg);
  39. }
  40. 100% {
  41. transform: rotate(360deg);
  42. }
  43. }
  44. @keyframes spin2{
  45. 0% {
  46. transform: rotate(0deg);
  47. }
  48. 50% {
  49. transform: rotate(1020deg);
  50. }
  51. 100% {
  52. transform: rotate(720deg);
  53. }
  54. }
  55. @keyframes spin3{
  56. 0% {
  57. transform: rotate(0deg);
  58. }
  59. 40% {
  60. transform: rotate(1070deg);
  61. }
  62. 100% {
  63. transform: rotate(6119deg);
  64. border-bottom-color:#072426 !important;
  65. }
  66. }
  67. .authloaderanwi {
  68. height: 100vh;
  69. }
  70. .overlayanwiAuth{
  71. width:100vw;
  72. height:100vh;
  73. background:white;
  74. position:fixed;
  75. top:0;
  76. right:0;
  77. z-index:99999;
  78. display:none;
  79. }
  80. </style>
  81. <div class="overlayanwiAuth ">
  82. <div style="
  83. position: absolute;
  84. top: 50%;
  85. left: 50%;
  86. transform: translate(-50%, -50%);
  87. width:40px;
  88. display:none;
  89. ">
  90. <span>
  91. <?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 122.88 116.31" style="enable-background:new 0 0 122.88 116.31" xml:space="preserve"><g><path d="M4.06,12.67C1.87,12.67,0,10.8,0,8.51c0-2.19,1.87-4.06,4.06-4.06h5.62c0.1,0,0.31,0,0.42,0c3.75,0.1,7.08,0.83,9.88,2.6 c3.12,1.98,5.41,4.99,6.66,9.47c0,0.1,0,0.21,0.1,0.31L27.78,21h2.34V4.12c0-2.27,1.85-4.12,4.12-4.12h21.67 c2.27,0,4.12,1.85,4.12,4.12v10.02c3.42-3.41,8.06-5.5,13.18-5.5c2.22,0,4.36,0.4,6.34,1.12c4.08-4.33,9.87-7.04,16.29-7.04 c10.96,0,20.07,7.88,21.99,18.28h0.99c2.29,0,4.06,1.87,4.06,4.06c0,0.42-0.11,0.83-0.21,1.25l-10.61,42.76 c-0.42,1.87-2.08,3.12-3.95,3.12l0,0H41.51c1.46,5.41,2.91,8.32,4.89,9.68c2.39,1.56,6.56,1.66,13.53,1.56h0.1l0,0h47.03 c2.29,0,4.06,1.87,4.06,4.06c0,2.29-1.87,4.06-4.06,4.06H60.04l0,0c-8.64,0.1-13.94-0.1-18.21-2.91 c-4.37-2.91-6.66-7.91-8.95-16.96l0,0L18.94,18.92c0-0.1,0-0.1-0.1-0.21c-0.62-2.29-1.66-3.85-3.12-4.68 c-1.46-0.94-3.43-1.35-5.72-1.35c-0.1,0-0.21,0-0.31,0H4.06L4.06,12.67L4.06,12.67z M84.38,37.69c0-1.28,1.27-2.32,2.83-2.32 c1.56,0,2.83,1.04,2.83,2.32v15.69c0,1.28-1.27,2.32-2.83,2.32c-1.56,0-2.83-1.04-2.83-2.32V37.69L84.38,37.69z M67.43,37.69 c0-1.28,1.27-2.32,2.83-2.32c1.56,0,2.83,1.04,2.83,2.32v15.69c0,1.28-1.27,2.32-2.83,2.32c-1.56,0-2.83-1.04-2.83-2.32V37.69 L67.43,37.69z M50.49,37.69c0-1.28,1.27-2.32,2.83-2.32c1.56,0,2.83,1.04,2.83,2.32v15.69c0,1.28-1.27,2.32-2.83,2.32 c-1.56,0-2.83-1.04-2.83-2.32V37.69L50.49,37.69z M85.57,13.37c2.31,2.05,4.14,4.66,5.29,7.63h19.85 c-1.68-6.65-7.7-11.58-14.87-11.58C91.89,9.42,88.29,10.91,85.57,13.37L85.57,13.37z M92.21,29.11L92.21,29.11l-38.01,0l0,0H30.07 l0,0l9.26,34.86h65.65l8.63-34.86H92.21L92.21,29.11z M55.31,21c0.11-0.29,0.23-0.57,0.35-0.85V7.2c0-1.64-1.35-2.99-2.99-2.99 H37.71c-1.64,0-2.99,1.34-2.99,2.99V21H55.31L55.31,21z M94.89,96.33c5.52,0,9.99,4.47,9.99,9.99s-4.47,9.99-9.99,9.99 c-5.51,0-9.99-4.47-9.99-9.99S89.38,96.33,94.89,96.33L94.89,96.33L94.89,96.33z M51.09,96.33c5.51,0,9.99,4.47,9.99,9.99 s-4.47,9.99-9.99,9.99s-9.99-4.47-9.99-9.99S45.57,96.33,51.09,96.33L51.09,96.33L51.09,96.33z"/></g>
  92. </svg>
  93. </span>
  94. </div>
  95. <div class="authloaderanwi">
  96. <div class='loader' id='lrd1'></div>
  97. </div>
  98. </div>
  99. `
  100. class AuthLoader extends HTMLElement {
  101. constructor() {
  102. super();
  103. console.log(this.payment);
  104. this._shadowRoot = this.attachShadow({ 'mode': 'open' });
  105. this._shadowRoot.appendChild(template.content.cloneNode(true));
  106. this.show();
  107. }
  108. static get observedAttributes() {
  109. return ['payment'];
  110. }
  111. // define getters and setters for attributes
  112. get payment() {
  113. return this.getAttribute('payment');
  114. }
  115. set payment(val) {
  116. if (val) {
  117. this.setAttribute('payment', val);
  118. } else {
  119. this.removeAttribute('payment');
  120. }
  121. }
  122. show(){
  123. // $('.overlayanwiAuth').css('display','block');
  124. this._shadowRoot.querySelector('.overlayanwiAuth').style.display = "block";
  125. }
  126. hide(){
  127. //$('.overlayanwiAuth').addClass('display','none');
  128. this._shadowRoot.querySelector('.overlayanwiAuth').style.display = "none";
  129. }
  130. }
  131. window.customElements.define('auth-loader', AuthLoader);