index.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Blockly Demo: Fixed Blockly</title>
  6. <script src="../../blockly_compressed.js"></script>
  7. <script src="../../blocks_compressed.js"></script>
  8. <script src="../../msg/js/en.js"></script>
  9. <style>
  10. body {
  11. background-color: #fff;
  12. font-family: sans-serif;
  13. }
  14. h1 {
  15. font-weight: normal;
  16. font-size: 140%;
  17. }
  18. </style>
  19. </head>
  20. <body>
  21. <h1><a href="https://developers.google.com/blockly/">Blockly</a> &gt;
  22. <a href="../index.html">Demos</a> &gt; Fixed Blockly</h1>
  23. <p>This is a simple demo of injecting Blockly into a fixed-sized 'div' element.</p>
  24. <p>&rarr; More info on <a href="https://developers.google.com/blockly/guides/configure-blockly/web/fixed-size">injecting fixed-sized Blockly</a>&hellip;</p>
  25. <div id="blocklyDiv" style="height: 480px; width: 600px;"></div>
  26. <xml id="toolbox" style="display: none">
  27. <block type="controls_if"></block>
  28. <block type="logic_compare"></block>
  29. <block type="controls_repeat_ext"></block>
  30. <block type="math_number"></block>
  31. <block type="math_arithmetic"></block>
  32. <block type="text"></block>
  33. <block type="text_print"></block>
  34. </xml>
  35. <script>
  36. var workspace = Blockly.inject('blocklyDiv',
  37. {media: '../../media/',
  38. toolbox: document.getElementById('toolbox')});
  39. </script>
  40. </body>
  41. </html>