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
+
20
+ import UIWindow from './UIWindow.js'
21
+
22
+ async function UIWindowWelcome ( options ) {
23
+
24
+ options = options ?? { } ;
25
+
26
+ let h = '' ;
27
+ // close button containing the multiplication sign
28
+ h += `<div class="generic-close-window-button welcome-window-close-button"> × </div>` ;
29
+ h += `<div style="display:flex; flex-direction: colum;">` ;
30
+ h += `<div style="overflow: hidden; width: 200px; max-width: 200px; min-width: 200px; background: linear-gradient(45deg, #3d476b, #838eb7); min-height: 400px; padding: 20px; box-sizing: border-box;">` ;
31
+ h += `<img style="display: block; margin: 45px auto 0; width: 270px; opacity: 0.5;" src="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%3F%3E%3Csvg%20width%3D%2248%22%20height%3D%2248%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20class%3D%22layer%22%3E%3Ctitle%3ELayer%201%3C%2Ftitle%3E%3Cg%20id%3D%22svg_1%22%20stroke-width%3D%221%22%20transform%3D%22rotate(90%2024%2023.9997)%22%3E%3Cpolyline%20fill%3D%22none%22%20id%3D%22svg_2%22%20points%3D%2239%2024%2025%2024%2025%2028%22%20stroke%3D%22%23ffffff%22%20stroke-linecap%3D%22square%22%20stroke-miterlimit%3D%2210%22%20stroke-width%3D%221%22%2F%3E%3Cpolyline%20fill%3D%22none%22%20id%3D%22svg_3%22%20points%3D%2235.879%2010.121%2032%2014%2025%2014%2025%2018%22%20stroke%3D%22%23ffffff%22%20stroke-linecap%3D%22square%22%20stroke-miterlimit%3D%2210%22%20stroke-width%3D%221%22%2F%3E%3Cpath%20d%3D%22m13%2C26a10.29%2C10.29%200%200%201%20-7.2%2C-3%22%20fill%3D%22none%22%20id%3D%22svg_4%22%20stroke%3D%22%23ffffff%22%20stroke-linecap%3D%22square%22%20stroke-miterlimit%3D%2210%22%20stroke-width%3D%221%22%2F%3E%3Cpath%20d%3D%22m17%2C31.6a5.83%2C5.83%200%200%201%20-4%2C-5.6a5.73%2C5.73%200%200%201%202%2C-4.4%22%20fill%3D%22none%22%20id%3D%22svg_5%22%20stroke%3D%22%23ffffff%22%20stroke-linecap%3D%22square%22%20stroke-miterlimit%3D%2210%22%20stroke-width%3D%221%22%2F%3E%3Cpath%20d%3D%22m35.88%2C37.88l-3.88%2C-3.88l-7%2C0l0%2C2a9.9%2C9.9%200%200%201%20-10%2C10a9.9%2C9.9%200%200%201%20-10%2C-10a9.06%2C9.06%200%200%201%200.6%2C-3.2a5.63%2C5.63%200%200%201%20-2.6%2C-4.8a5.89%2C5.89%200%200%201%202.8%2C-5a9.99%2C9.99%200%200%201%20-2.8%2C-7a9.9%2C9.9%200%200%201%2010%2C-10l0.4%2C0a5.83%2C5.83%200%200%201%205.6%2C-4a5.89%2C5.89%200%200%201%206%2C6%22%20fill%3D%22none%22%20id%3D%22svg_6%22%20stroke%3D%22%23ffffff%22%20stroke-linecap%3D%22square%22%20stroke-miterlimit%3D%2210%22%20stroke-width%3D%221%22%2F%3E%3Ccircle%20cx%3D%2238%22%20cy%3D%228%22%20data-color%3D%22color-2%22%20fill%3D%22none%22%20id%3D%22svg_7%22%20r%3D%223%22%20stroke%3D%22%23ffffff%22%20stroke-linecap%3D%22square%22%20stroke-miterlimit%3D%2210%22%20stroke-width%3D%221%22%2F%3E%3Ccircle%20cx%3D%2242%22%20cy%3D%2224%22%20data-color%3D%22color-2%22%20fill%3D%22none%22%20id%3D%22svg_8%22%20r%3D%223%22%20stroke%3D%22%23ffffff%22%20stroke-linecap%3D%22square%22%20stroke-miterlimit%3D%2210%22%20stroke-width%3D%221%22%2F%3E%3Ccircle%20cx%3D%2238%22%20cy%3D%2240%22%20data-color%3D%22color-2%22%20fill%3D%22none%22%20id%3D%22svg_9%22%20r%3D%223%22%20stroke%3D%22%23ffffff%22%20stroke-linecap%3D%22square%22%20stroke-miterlimit%3D%2210%22%20stroke-width%3D%221%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E">` ;
32
+ h += `</div>` ;
33
+ h += `<div style="flex-grow: 1; padding-left: 50px; padding-top: 70px; padding-right: 50px;">` ;
34
+ h += `<h1 style="font-size: 25px; font-weight: 300; -webkit-font-smoothing: antialiased; color: #545763;">Welcome to your <br>Personal Internet Computer</h1>` ;
35
+ h += `<p style="margin-top: 25px; font-size: 16px; font-weight: 300; -webkit-font-smoothing: antialiased; color: #3e4251;">Store files, play games, find awesome apps, and much more! All in one place, accessible from anywhere at any time.</p>` ;
36
+ h += `<button class="welcome-window-get-started" style="font-size: 15px; font-weight: 300; -webkit-font-smoothing: antialiased; cursor: pointer; padding: 8px 20px; border-radius: 5px; text-decoration: none; margin-right: 20px; border: 1px solid #656565 !important; background: none; margin-top: 10px;">Get Started</button>` ;
37
+ h += `<div class="welcome-window-footer">` ;
38
+ h += `<a href="/terms" target="_blank">Terms</a>` ;
39
+ h += `<a href="/privacy" style="margin-left: 20px;" target="_blank">Privacy</a>` ;
40
+ h += `<a href="https://developer.puter.com" style="margin-left: 20px;" target="_blank">Developers</a>` ;
41
+ h += `<a href="https://github.com/heyputer/puter" style="margin-left: 20px;" target="_blank">Open Source</a>` ;
42
+ h += `</div>` ;
43
+ h += `</div>` ;
44
+ h += `</div>` ;
45
+
46
+ const el_window = await UIWindow ( {
47
+ title : 'Instant Login!' ,
48
+ app : 'instant-login' ,
49
+ single_instance : true ,
50
+ icon : null ,
51
+ uid : null ,
52
+ is_dir : false ,
53
+ body_content : h ,
54
+ has_head : false ,
55
+ selectable_body : false ,
56
+ allow_context_menu : false ,
57
+ is_resizable : false ,
58
+ is_droppable : false ,
59
+ init_center : true ,
60
+ allow_native_ctxmenu : false ,
61
+ allow_user_select : false ,
62
+ backdrop : true ,
63
+ close_on_backdrop_click : false ,
64
+ backdrop_covers_toolbar : true ,
65
+ width : 650 ,
66
+ height : 'auto' ,
67
+ dominant : true ,
68
+ show_in_taskbar : false ,
69
+ draggable_body : true ,
70
+ onAppend : function ( this_window ) {
71
+ } ,
72
+ window_class : 'window-welcome' ,
73
+ on_close : function ( ) {
74
+ // save the fact that the user has seen the welcome window
75
+ puter . kv . set ( 'has_seen_welcome_window' , true ) ;
76
+ } ,
77
+ body_css : {
78
+ width : 'initial' ,
79
+ height : '100%' ,
80
+ 'background-color' : 'rgb(245 247 249)' ,
81
+ 'backdrop-filter' : 'blur(3px)' ,
82
+ padding : '0' ,
83
+ } ,
84
+ } )
85
+
86
+ $ ( document ) . on ( 'click' , '.welcome-window-get-started' , function ( ) {
87
+ $ ( el_window ) . close ( ) ;
88
+ } )
89
+ }
90
+
91
+ export default UIWindowWelcome
0 commit comments