@@ -25,68 +25,9 @@ scramjet.init();
2525navigator . serviceWorker . register ( "./sw.js" ) ;
2626
2727const connection = new BareMux . BareMuxConnection ( "/baremux/worker.js" ) ;
28- const flex = css `
29- display: flex;
30- ` ;
31- const col = css `
32- flex-direction: column;
33- ` ;
3428
3529connection . setTransport ( store . transport , [ { wisp : store . wispurl } ] ) ;
3630
37- // let signedinr;
38- // let signedin = new Promise((resolve) => (signedinr = resolve));
39-
40- function SignIn ( ) {
41- this . css = `
42- transition: opacity 0.4s ease;
43- :modal[open] {
44- animation: fade 0.4s ease normal;
45- }
46-
47- :modal::backdrop {
48- backdrop-filter: blur(3px);
49- }
50- ` ;
51- this . status = "" ;
52-
53- function handleModalClose ( modal ) {
54- modal . style . opacity = 0 ;
55- setTimeout ( ( ) => {
56- modal . close ( ) ;
57- modal . style . opacity = 1 ;
58- } , 250 ) ;
59- }
60-
61- const signin = async ( ) => {
62- this . status = "Signing in..." ;
63- console . log ( "??" ) ;
64- try {
65- await puter . auth . signIn ( ) ;
66- this . status = "Signed in successfully!" ;
67- signedinr ( ) ;
68- handleModalClose ( this . root ) ;
69- } catch ( e ) {
70- console . log ( e ) ;
71- this . status = "Error signing in: " + e . message ;
72- return ;
73- }
74- } ;
75-
76- return html `
77- < dialog
78- class ="signin "
79- style ="background-color: #121212; color: white; border-radius: 8px; "
80- >
81- < h1 > Sign In</ h1 >
82- < p > Sign in with Puter to accses Scramjet Browser</ p >
83-
84- < button on:click =${ signin } > Sign In</ button >
85- < p > ${ use ( this . status ) } </ p >
86- </ dialog >
87- ` ;
88- }
89-
9031function Config ( ) {
9132 this . css = `
9233 transition: opacity 0.4s ease;
@@ -255,17 +196,6 @@ function BrowserApp() {
255196
256197 const frame = scramjet . createFrame ( ) ;
257198
258- this . mount = async ( ) => {
259- // if (!puter.auth.isSignedIn()) {
260- // const signin = h(SignIn);
261- // document.body.appendChild(signin);
262- // signin.showModal();
263- // await signedin;
264- // }
265- // let wisp = await puter.net.generateWispV1URL();
266- // console.log(wisp);
267- } ;
268-
269199 frame . addEventListener ( "urlchange" , ( e ) => {
270200 if ( ! e . url ) return ;
271201 this . url = e . url ;
0 commit comments