File tree Expand file tree Collapse file tree
packages/instrument-library/src/interactive/breakout-task Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -228,7 +228,25 @@ export default defineInstrument({
228228 const root = document . createElement ( 'div' ) ;
229229 root . id = 'root' ;
230230 document . body . appendChild ( root ) ;
231- runTask ( root , done ) ;
231+
232+ const initialContent = document . createElement ( 'div' ) ;
233+ initialContent . classList . add ( 'initial-content' ) ;
234+
235+ const title = document . createElement ( 'h3' ) ;
236+ title . innerText = 'Welcome to the Breakout Task' ;
237+ const startButton = document . createElement ( 'button' ) ;
238+ startButton . type = 'button' ;
239+ startButton . innerText = 'Start' ;
240+
241+ initialContent . appendChild ( title ) ;
242+ initialContent . appendChild ( startButton ) ;
243+
244+ root . appendChild ( initialContent ) ;
245+
246+ startButton . addEventListener ( 'click' , ( ) => {
247+ root . removeChild ( initialContent ) ;
248+ runTask ( root , done ) ;
249+ } ) ;
232250 }
233251 } ,
234252 details : {
Original file line number Diff line number Diff line change @@ -16,3 +16,30 @@ canvas {
1616 height : 100vh ;
1717 width : 100vw ;
1818}
19+
20+ .initial-content {
21+ display : flex;
22+ flex-direction : column;
23+ justify-content : center;
24+ align-items : center;
25+ gap : 8px ;
26+ }
27+
28+ .initial-content h3 {
29+ font-size : 1.25rem ;
30+ }
31+
32+ .initial-content button {
33+ background-color : blue;
34+ border : none;
35+ border-radius : 0.25rem ;
36+ color : white;
37+ padding : 6px 12px ;
38+ transition-property : opacity;
39+ transition-timing-function : cubic-bezier (0.4 , 0 , 0.2 , 1 );
40+ transition-duration : 200ms ;
41+ }
42+
43+ .initial-content button : hover {
44+ opacity : 60% ;
45+ }
You can’t perform that action at this time.
0 commit comments