1
0

UIWindowDownloadDirProg.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /**
  2. * Copyright (C) 2024 Puter Technologies Inc.
  3. *
  4. * This file is part of Puter.
  5. *
  6. * Puter is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Affero General Public License as published
  8. * by the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Affero General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Affero General Public License
  17. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  18. */
  19. import UIWindow from './UIWindow.js'
  20. async function UIWindowDownloadDirProg(options){
  21. options = options ?? {};
  22. let h = '';
  23. // Loading spinner
  24. h +=`<svg style="height: 40px; width: 40px; padding: 10px; display: block; float: left;" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24"><title>circle anim</title><g fill="#212121" class="nc-icon-wrapper"><g class="nc-loop-circle-24-icon-f"><path d="M12 24a12 12 0 1 1 12-12 12.013 12.013 0 0 1-12 12zm0-22a10 10 0 1 0 10 10A10.011 10.011 0 0 0 12 2z" fill="#212121" opacity=".4"></path><path d="M24 12h-2A10.011 10.011 0 0 0 12 2V0a12.013 12.013 0 0 1 12 12z" data-color="color-2"></path></g><style>.nc-loop-circle-24-icon-f{--animation-duration:0.5s;transform-origin:12px 12px;animation:nc-loop-circle-anim var(--animation-duration) infinite linear}@keyframes nc-loop-circle-anim{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}</style></g></svg>`;
  25. h += `<p style="text-align:left; padding-left:20px; padding-right:20px; overflow:hidden; width: 310px; text-overflow: ellipsis; white-space: nowrap; float:left; font-size:14px;" class="dir-dl-status">${options.defaultText ?? 'Preparing...'}</p>`;
  26. const el_window = await UIWindow({
  27. title: 'Instant Login!',
  28. app: 'instant-login',
  29. single_instance: true,
  30. icon: null,
  31. uid: null,
  32. is_dir: false,
  33. body_content: h,
  34. draggable_body: false,
  35. has_head: false,
  36. selectable_body: false,
  37. draggable_body: false,
  38. allow_context_menu: false,
  39. is_resizable: false,
  40. is_droppable: false,
  41. init_center: true,
  42. allow_native_ctxmenu: false,
  43. allow_user_select: false,
  44. backdrop: false,
  45. width: 460,
  46. height: 'auto',
  47. dominant: true,
  48. show_in_taskbar: false,
  49. draggable_body: true,
  50. onAppend: function(this_window){
  51. },
  52. window_class: 'window-qr',
  53. body_css: {
  54. width: 'initial',
  55. height: '100px',
  56. 'background-color': 'rgb(245 247 249)',
  57. 'backdrop-filter': 'blur(3px)',
  58. 'display': 'flex',
  59. "flex-direction": 'row',
  60. 'justify-content': 'center',
  61. 'align-items': 'center',
  62. }
  63. })
  64. return el_window;
  65. }
  66. export default UIWindowDownloadDirProg