index.html 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset = "UTF-8">
  5. <title>Libreflix</title>
  6. <link rel="stylesheet" href="assets/css/base.css">
  7. <link rel="stylesheet" href="assets/css/loading.css">
  8. </head>
  9. <body>
  10. <div class="container">
  11. <webview id="webview" src="https://libreflix.org/" autosize minwidth="800" minheight="600">
  12. </webview>
  13. <div class = "indicator"></div>
  14. </div>
  15. <script type = "text/javascript">
  16. // Event handlers for loading events.
  17. // Use these to handle loading screens, transitions, etc
  18. onload = () => {
  19. const webview = document.querySelector('webview')
  20. const indicator = document.querySelector('.indicator')
  21. const div = document.createElement('div');
  22. const loadstart = () => {
  23. //indicator.innerText = 'loading...'
  24. div.className = "loading";
  25. indicator.appendChild(div);
  26. }
  27. const loadstop = () => {
  28. //indicator.innerText = ''
  29. div.parentNode.removeChild(div);
  30. }
  31. const overflow = () => {
  32. webview.insertCSS('::-webkit-scrollbar { display: none; }');
  33. }
  34. webview.addEventListener('did-start-loading', loadstart)
  35. webview.addEventListener('did-stop-loading', loadstop)
  36. webview.addEventListener('did-stop-loading', overflow)
  37. }
  38. </script>
  39. </body>
  40. </html>