mosaicode-javascript-webaudio/codetemplates/webaudio.json

32 lines
1.8 KiB
JSON

{
"source": "JSON",
"data": "CODE_TEMPLATE",
"version": 1,
"name": "webaudio",
"type": "mosaicode_lib_javascript_webaudio.extensions.html",
"description": "Javascript / webaudio code template",
"language": "javascript",
"command": "python3 -m webbrowser -t $dir_name$index.html\n",
"code_parts": [
"onload",
"function",
"declaration",
"execution",
"html",
"global"
],
"properties": [
{
"name": "title",
"label": "Title",
"value": "Title",
"type": "string"
}
],
"codes": {
"index.html": "<html>\n <head>\n <meta http-equiv=\"Cache-Control\" content=\"no-store\" />\n <!-- $author$ $license$ -->\n <title>$prop[title]$</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"theme.css\">\n <script src=\"functions.js\"></script>\n <script>\nvar context;\n\n $code[global]$\n\n\nfunction doit(){\ncontext = new (window.AudioContext || window.webkitAudioContext)();\n //declaration block\n $code[declaration]$\n\n //execution\n $code[execution]$\n\n //connections\n $connections$\n $single_code[onload]$\n}\n </script>\n </head>\n\n <body>\n <button type=\"button\" value=\"1\" onClick=\"doit();\" id=\"start\">Start Sound!</button><br>\n\n $code[html]$\n </body>\n</html>\n",
"theme.css": "/*\nDeveloped by: $author$\n*/\nhtml, body {\n background: #ffeead;\n color: #ff6f69;\n}\nh1, p {\n color: #ff6f69;\n}\n#navbar a {\n color: #ff6f69;\n}\n.item {\n background: #ffcc5c;\n}\nbutton {\n background: #ff6f69;\n color: #ffcc5c;\n}\n",
"functions.js": "/*\nDeveloped by: $author$\n*/\n$single_code[function]$\n"
}
}