@@ -11,67 +11,18 @@ const scramjet = new ScramjetController({
1111scramjet . init ( ) ;
1212navigator . serviceWorker . register ( "./sw.js" ) ;
1313
14+ import { css } from "dreamland/core" ;
15+
1416const flex = css `
1517 display : flex;
1618` ;
1719const col = css `
1820 flex-direction : column;
1921` ;
2022
21- function PlaygroundApp ( ) {
22- this . css = `
23- width: 100%;
24- height: 100%;
25- color: #f0fef4;
26- display: flex;
27- padding: 0.5em;
28- box-sizing: border-box;
29- gap: 0.5em;
30-
31-
32- .codesplit {
33- width: 50%;
34- height: 100%;
35- display: flex;
36- flex-direction: column;
37-
38- gap: 0.5em;
39- }
40-
41- .mcontainer {
42- background: #1e1e1e;
43- h2 {
44- margin: 0.1em;
45- }
46-
47- border: 1px solid #313131;
48- flex-basis: 100%;
49- display: flex;
50- flex-direction: column;
51- }
52- .monaco {
53- flex: 1;
54- }
55-
56- .frame {
57- height: 100%;
58- display: flex;
59- flex-direction: column;
60- gap: 0.5em;
61- iframe {
62- width: 100%;
63- border: 1px solid #313131;
64- }
65- }
66- .config {
67- border: 1px solid #313131;
68- background: #1e1e1e;
69- padding: 0.5em;
70- }
71- ` ;
72-
73- this . fakeorigin = "https://sandboxedorigin.com" ;
74- this . mount = async ( ) => {
23+ function PlaygroundApp ( cx ) {
24+ cx . fakeorigin = "https://sandboxedorigin.com" ;
25+ cx . mount = async ( ) => {
7526 const monaco = await import (
7627 "https://cdn.jsdelivr.net/npm/monaco-editor/+esm"
7728 ) ;
@@ -220,3 +171,55 @@ window.addEventListener("load", async () => {
220171 throw e ;
221172 }
222173} ) ;
174+
175+ PlaygroundApp . style = css `
176+ : scope {
177+ width : 100% ;
178+ height : 100% ;
179+ color : # f0fef4 ;
180+ display : flex;
181+ padding : 0.5em ;
182+ box-sizing : border-box;
183+ gap : 0.5em ;
184+ }
185+
186+ .codesplit {
187+ width : 50% ;
188+ height : 100% ;
189+ display : flex;
190+ flex-direction : column;
191+
192+ gap : 0.5em ;
193+ }
194+
195+ .mcontainer {
196+ background : # 1e1e1e ;
197+ h2 {
198+ margin : 0.1em ;
199+ }
200+
201+ border : 1px solid # 313131 ;
202+ flex-basis : 100% ;
203+ display : flex;
204+ flex-direction : column;
205+ }
206+ .monaco {
207+ flex : 1 ;
208+ }
209+
210+ .frame {
211+ height : 100% ;
212+ display : flex;
213+ flex-direction : column;
214+ gap : 0.5em ;
215+ iframe {
216+ width : 100% ;
217+ border : 1px solid # 313131 ;
218+ }
219+ }
220+ .config {
221+ border : 1px solid # 313131 ;
222+ background : # 1e1e1e ;
223+ padding : 0.5em ;
224+ }
225+ ` ;
0 commit comments