index.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <!--
  5. If you are serving your web app in a path other than the root, change the
  6. href value below to reflect the base path you are serving from.
  7. The path provided below has to start and end with a slash "/" in order for
  8. it to work correctly.
  9. For more details:
  10. * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
  11. This is a placeholder for base href that will be replaced by the value of
  12. the `--base-href` argument provided to `flutter build`.
  13. -->
  14. <base href="$FLUTTER_BASE_HREF">
  15. <meta charset="UTF-8">
  16. <meta content="IE=Edge" http-equiv="X-UA-Compatible">
  17. <meta name="description" content="Aplikasi Telnow Web">
  18. <!-- iOS meta tags & icons -->
  19. <meta name="mobile-web-app-capable" content="yes">
  20. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  21. <meta name="apple-mobile-web-app-title" content="TelNow Application">
  22. <link rel="apple-touch-icon" href="icons/Icon-192.png">
  23. <!-- Favicon -->
  24. <link rel="icon" type="image/png" href="icons/launcher_icon.png" />
  25. <title>TelNow Application</title>
  26. <link rel="manifest" href="manifest.json">
  27. <style>
  28. .loader {
  29. border: 5px solid #f3f3f3;
  30. border-radius: 50%;
  31. border-top: 5px solid #01beb5;
  32. width: 40px;
  33. height: 40px;
  34. -webkit-animation: spin 2s linear infinite;
  35. /* Safari */
  36. animation: spin 2s linear infinite;
  37. }
  38. .center {
  39. position: absolute;
  40. top: 50%;
  41. left: 50%;
  42. margin-top: -60px;
  43. margin-left: -120px;
  44. width: 240px;
  45. height: 40px;
  46. text-align: center;
  47. font-family: Arial, Helvetica, sans-serif;
  48. }
  49. .center-align {
  50. position: absolute;
  51. top: 50%;
  52. left: 50%;
  53. margin-top: 0px;
  54. margin-left: -60px;
  55. width: 40px;
  56. height: 40px;
  57. }
  58. .center-count {
  59. position: absolute;
  60. top: 50%;
  61. left: 50%;
  62. margin-top: -30px;
  63. margin-left: -120px;
  64. width: 240px;
  65. height: 40px;
  66. font-size: 20px;
  67. font-weight: bold;
  68. text-align: center;
  69. font-family: Arial, Helvetica, sans-serif;
  70. }
  71. /* Safari */
  72. @-webkit-keyframes spin {
  73. 0% {
  74. -webkit-transform: rotate(0deg);
  75. }
  76. 100% {
  77. -webkit-transform: rotate(360deg);
  78. }
  79. }
  80. @keyframes spin {
  81. 0% {
  82. transform: rotate(0deg);
  83. }
  84. 100% {
  85. transform: rotate(360deg);
  86. }
  87. }
  88. .countdown {
  89. display: inline-block;
  90. text-indent: -100vw;
  91. position: relative;
  92. width: 1ch;
  93. }
  94. .countdown::after {
  95. content: '10';
  96. position: absolute;
  97. top: 0;
  98. left: 0;
  99. text-indent: 0;
  100. animation: 18s countdown 1s forwards;
  101. }
  102. @keyframes countdown {
  103. 0% {
  104. content: '10';
  105. }
  106. 10% {
  107. content: '9';
  108. }
  109. 20% {
  110. content: '8';
  111. }
  112. 30% {
  113. content: '7';
  114. }
  115. 35% {
  116. content: '7';
  117. }
  118. 40% {
  119. content: '6';
  120. }
  121. 45% {
  122. content: '6';
  123. }
  124. 50% {
  125. content: '5';
  126. }
  127. 55% {
  128. content: '5';
  129. }
  130. 60% {
  131. content: '4';
  132. }
  133. 65% {
  134. content: '4';
  135. }
  136. 70% {
  137. content: '3';
  138. }
  139. 75% {
  140. content: '2';
  141. }
  142. 80% {
  143. content: '2';
  144. }
  145. 85% {
  146. content: '2';
  147. }
  148. 90% {
  149. content: '1';
  150. }
  151. 95% {
  152. content: '1';
  153. }
  154. 100% {
  155. content: '0';
  156. }
  157. }
  158. </style>
  159. </head>
  160. <body>
  161. <div class="center">
  162. <h4 id="label">Loading TelNow page</h4>
  163. </div>
  164. <div class="center-align">
  165. <!--<div class="loader"></div>-->
  166. <img src="cat.gif" width="120" height="120">
  167. </div>
  168. <div class="center-count">
  169. <span class="countdown"></span>
  170. </div>
  171. <script src="https://www.gstatic.com/firebasejs/8.10.1/firebase-app.js"></script>
  172. <!-- <script src="https://www.gstatic.com/firebasejs/8.10.1/firebase-auth.js"></script>-->
  173. <script src="https://www.gstatic.com/firebasejs/8.10.1/firebase-messaging.js"></script>
  174. <!-- <script src="https://www.gstatic.com/firebasejs/8.10.1/firebase-firestore.js"></script>-->
  175. <script>
  176. {{flutter_js}}
  177. {{flutter_build_config}}
  178. var jsPathVersion = "2517.01";
  179. _flutter.buildConfig.builds[0].mainJsPath += "?v=" + jsPathVersion;
  180. var serviceWorkerVersion = jsPathVersion;
  181. _flutter.loader.load({
  182. onEntrypointLoaded: async function (engineInitializer) {
  183. let appRunner = await engineInitializer.initializeEngine({
  184. // JsFlutterConfiguration goes here...
  185. // canvasKitBaseUrl: "/canvaskit/",
  186. });
  187. appRunner.runApp();
  188. },
  189. });
  190. if ('serviceWorker' in navigator) {
  191. // Service workers are supported. Use them.
  192. window.addEventListener('load', function () {
  193. // Wait for registration to finish before dropping the <script> tag.
  194. // Otherwise, the browser will load the script multiple times,
  195. // potentially different versions.
  196. var serviceWorkerUrl = 'flutter_service_worker.js?v=' + serviceWorkerVersion;
  197. navigator.serviceWorker.register(serviceWorkerUrl)
  198. .then((reg) => {
  199. function waitForActivation(serviceWorker) {
  200. serviceWorker.addEventListener('statechange', () => {
  201. if (serviceWorker.state == 'activated') {
  202. console.log('Installed new service worker.');
  203. // loadMainDartJs();
  204. }
  205. });
  206. }
  207. if (!reg.active && (reg.installing || reg.waiting)) {
  208. // No active web worker and we have installed or are installing
  209. // one for the first time. Simply wait for it to activate.
  210. waitForActivation(reg.installing || reg.waiting);
  211. } else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) {
  212. // When the app updates the serviceWorkerVersion changes, so we
  213. // need to ask the service worker to update.
  214. console.log('New service worker available.');
  215. reg.update();
  216. waitForActivation(reg.installing);
  217. } else {
  218. // Existing service worker is still good.
  219. console.log('Loading app from service worker.');
  220. // loadMainDartJs();
  221. }
  222. });
  223. navigator.serviceWorker.register("firebase-messaging-sw.js").then((reg) => {
  224. if (!reg.active && (reg.installing || reg.waiting)) {
  225. // No active web worker and we have installed or are installing
  226. // one for the first time. Simply wait for it to activate.
  227. console.log('Firebase messaging has been installing.');
  228. } else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) {
  229. // When the app updates the serviceWorkerVersion changes, so we
  230. // need to ask the service worker to update.
  231. console.log('Firebase messaging is available.');
  232. } else {
  233. // Existing service worker is still good.
  234. console.log('Firebase messaging has been running.');
  235. }
  236. });
  237. });
  238. }
  239. </script>
  240. </body>
  241. </html>