|
| 1 | + |
| 2 | +<html> |
| 3 | + <head> |
| 4 | + |
| 5 | + <title>stackblitz</title> |
| 6 | + |
| 7 | + <base href='https://javascript-2020.github.io/utils/editors/stackblitz/stackblitz.html'> |
| 8 | + <link rel="shortcut icon" type="image/x-icon" href="images/stackblitz.png"> |
| 9 | + |
| 10 | + |
| 11 | + <style> |
| 12 | + |
| 13 | + html |
| 14 | + {height:100%} |
| 15 | + |
| 16 | + body |
| 17 | + { |
| 18 | + font-family : arial; |
| 19 | + /*margin : 20px;*/ |
| 20 | + height : calc(100% - 16px); |
| 21 | + display : flex; |
| 22 | + flex-direction : column; |
| 23 | + } |
| 24 | + |
| 25 | + |
| 26 | + .hdr |
| 27 | + { |
| 28 | + position : relative; |
| 29 | + display:flex; |
| 30 | + justify-content:space-between; |
| 31 | + align-items:center; |
| 32 | + /*padding-bottom : 10px; |
| 33 | + border-bottom : 1px solid lightblue; |
| 34 | + margin-bottom : 20px;*/ |
| 35 | + margin-top : 0; |
| 36 | + font-family : arial; |
| 37 | + } |
| 38 | + |
| 39 | + .hdr-icon |
| 40 | + { |
| 41 | + display : inline-block; |
| 42 | + text-align : center; |
| 43 | + background : whitesmoke; |
| 44 | + border-radius : 5px; |
| 45 | + border : 1px solid lightgray; |
| 46 | + padding : 5px 3px 0px; |
| 47 | + cursor : pointer; |
| 48 | + margin-right : 10px; |
| 49 | + min-width : 50px; |
| 50 | + } |
| 51 | + |
| 52 | + .hdr-icon-img |
| 53 | + { |
| 54 | + } |
| 55 | + |
| 56 | + .hdr-icon-label |
| 57 | + { |
| 58 | + margin : 2px 0 0; |
| 59 | + } |
| 60 | + |
| 61 | + .hdr-title |
| 62 | + { |
| 63 | + /* |
| 64 | + text-align : center; |
| 65 | + position : absolute; |
| 66 | + left : 0; |
| 67 | + right : 0; |
| 68 | + top : 5px; |
| 69 | + z-index : -1; |
| 70 | + */ |
| 71 | + margin : 0; |
| 72 | + } |
| 73 | + |
| 74 | + .hdr-date |
| 75 | + { |
| 76 | + float : right; |
| 77 | + } |
| 78 | + |
| 79 | + .ftr |
| 80 | + { |
| 81 | + background-color : rgb(238, 232, 170); |
| 82 | + height : 50px; |
| 83 | + margin-top : 70px; |
| 84 | + } |
| 85 | + |
| 86 | + |
| 87 | + #center |
| 88 | + { |
| 89 | + width : 100%; |
| 90 | + max-width : 1000px; |
| 91 | + margin : auto; |
| 92 | + flex : 1; |
| 93 | + } |
| 94 | + |
| 95 | + |
| 96 | + .heading |
| 97 | + { |
| 98 | + border-left : 5px solid rgba(238,232,170,1); |
| 99 | + background : rgba(239,247,250,1); |
| 100 | + padding : 20px 20px; |
| 101 | + } |
| 102 | + |
| 103 | + |
| 104 | + a |
| 105 | + { |
| 106 | + color : blue; |
| 107 | + } |
| 108 | + a:visited |
| 109 | + { |
| 110 | + color : blue; |
| 111 | + } |
| 112 | + |
| 113 | + embed |
| 114 | + {height:100%} |
| 115 | + |
| 116 | + </style> |
| 117 | + |
| 118 | +</head> |
| 119 | + |
| 120 | +<body> |
| 121 | + |
| 122 | + <section style="box-sizing:border-box" class="hdr"> |
| 123 | + <a id="home" href='https://javascript-2020.github.io/'> |
| 124 | + <div class="hdr-icon-label"> |
| 125 | + home |
| 126 | + </div> |
| 127 | + </a> |
| 128 | + <h3 style="color: blue; font-weight: bold;" class="hdr-title"> |
| 129 | + stackblitz |
| 130 | + </h3> |
| 131 | + <div style="" class="hdr-date"> |
| 132 | + 22 Nov 2024 |
| 133 | + </div> |
| 134 | + </section> |
| 135 | + |
| 136 | + |
| 137 | + <div id=embed></div> |
| 138 | + |
| 139 | + <script type=module> |
| 140 | + console.clear(); |
| 141 | + console.log('stackblitz'); |
| 142 | + console.log(); |
| 143 | + console.json=v=>console.log(JSON.stringify(v,null,4)); |
| 144 | + |
| 145 | + var $ = (root,sel)=>(!sel && (sel=root,root=document),root.querySelector(sel)); |
| 146 | + |
| 147 | +/* |
| 148 | + var hdr = $('.hdr'); |
| 149 | + hdr.status = false; |
| 150 | + hdr.show = ()=>hdr.style.height = '60px'; |
| 151 | + hdr.hide = ()=>hdr.style.height = '10px'; |
| 152 | + hdr.onmouseenter = e=>hdr.show(); |
| 153 | + hdr.onmouseleave = e=>hdr.hide(); |
| 154 | +*/ |
| 155 | + |
| 156 | + |
| 157 | +/* |
| 158 | +https://developer.stackblitz.com/platform/api/javascript-sdk |
| 159 | +https://developer.stackblitz.com/platform/api/javascript-sdk-options |
| 160 | +https://webcontainers.io/api |
| 161 | +*/ |
| 162 | + |
| 163 | + import sdk from 'https://cdn.jsdelivr.net/npm/@stackblitz/sdk/+esm'; |
| 164 | + |
| 165 | + var project = { |
| 166 | + title : 'dynamically generated project', |
| 167 | + description : 'created with <3', |
| 168 | + template : 'node', |
| 169 | + files : { |
| 170 | + 'settings.json':` |
| 171 | + { |
| 172 | + |
| 173 | + "editor.fontSize": 16, |
| 174 | + "editor.autoClosingBrackets": "never", |
| 175 | + "editor.autoClosingQuotes": "never", |
| 176 | + "editor.renderIndentGuides": false, |
| 177 | + "editor.formatOnSave": false, |
| 178 | + "editor.formatOnPaste": false, |
| 179 | + "editor.formatOnType": false, |
| 180 | + "editor.occurrencesHighlight": false, |
| 181 | + |
| 182 | + "editor.guides.indentation" : false, |
| 183 | +
|
| 184 | + |
| 185 | + "workbench.colorCustomizations": { |
| 186 | + "editorGutter.background": "#4A90E2", |
| 187 | + "editor.lineHighlightBackground": "#F0F8FF", // Light blue, adjust as needed |
| 188 | + "editor.lineHighlightBorder": "" // Removes the border |
| 189 | + } |
| 190 | + |
| 191 | + } |
| 192 | + ` |
| 193 | + |
| 194 | + } |
| 195 | + }; |
| 196 | + |
| 197 | + var vm = await sdk.embedProject('embed',project,{ |
| 198 | + forceEmbedLayout : true, |
| 199 | + //openFile : 'readme.md', |
| 200 | + theme : 'light', |
| 201 | + hideExplorer : false, |
| 202 | + hideNavigation : false, |
| 203 | + width : '100%', |
| 204 | + height : '100%', |
| 205 | + terminalHeight : '50', |
| 206 | + view : 'default' |
| 207 | + }); |
| 208 | + |
| 209 | +</script> |
| 210 | + |
| 211 | + |
| 212 | +</body> |
| 213 | + |
| 214 | +</html> |
| 215 | + |
| 216 | + |
0 commit comments