UIWindowClaimReferral.js 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. import UIWindowSaveAccount from './UIWindowSaveAccount.js';
  21. async function UIWindowClaimReferral(options){
  22. let h = '';
  23. h += `<div>`;
  24. h += `<div class="qr-code-window-close-btn generic-close-window-button disable-user-select"> &times; </div>`;
  25. h += `<img src="${window.icons['present.svg']}" style="width: 70px; margin: 20px auto 20px; display: block; margin-bottom: 20px;">`;
  26. h += `<h1 style="font-weight: 400; padding: 0 10px; font-size: 21px; text-align: center; margin-bottom: 0; color: #60626d; -webkit-font-smoothing: antialiased;">You have been referred to Puter by a friend!</h1>`;
  27. h += `<p style="text-align: center; font-size: 16px; padding: 20px; font-weight: 400; margin: -10px 10px 0px 10px; -webkit-font-smoothing: antialiased; color: #5f626d;">Create an account and confirm your email address to receive 1 GB of free storage. Your friend will get 1 GB of free storage too.</p>`;
  28. h += `<button class="button button-primary button-block create-account-ref-btn" style="display: block;">Create Account</button>`;
  29. h += `</div>`;
  30. const el_window = await UIWindow({
  31. title: `Refer a friend!`,
  32. icon: null,
  33. uid: null,
  34. is_dir: false,
  35. body_content: h,
  36. has_head: false,
  37. selectable_body: false,
  38. draggable_body: true,
  39. allow_context_menu: false,
  40. is_draggable: true,
  41. is_resizable: false,
  42. is_droppable: false,
  43. init_center: true,
  44. allow_native_ctxmenu: true,
  45. allow_user_select: true,
  46. onAppend: function(el_window){
  47. },
  48. width: 400,
  49. dominant: true,
  50. window_css: {
  51. height: 'initial',
  52. },
  53. body_css: {
  54. width: 'initial',
  55. 'max-height': 'calc(100vh - 200px)',
  56. 'background-color': 'rgb(241 246 251)',
  57. 'backdrop-filter': 'blur(3px)',
  58. 'padding': '10px 20px 20px 20px',
  59. 'height': 'initial',
  60. }
  61. });
  62. $(el_window).find('.create-account-ref-btn').on('click', function(e){
  63. UIWindowSaveAccount();
  64. $(el_window).close();
  65. })
  66. }
  67. export default UIWindowClaimReferral