mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-31 02:30:13 +02:00
build 3.4.0
This commit is contained in:
18
app/templates/template-kontra-game-engine.json
Normal file
18
app/templates/template-kontra-game-engine.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"title": "Kontra HTML5 game engine template",
|
||||
"html": " <canvas></canvas>",
|
||||
"css": "",
|
||||
"js":
|
||||
"// Learn More here -> https://straker.github.io/kontra/getting-started\nkontra.init();\n\nvar sprite = kontra.sprite({\n x: 100, // starting x,y position of the sprite\n y: 80,\n color: '#bad455', // fill color of the sprite rectangle\n width: 20, // width and height of the sprite rectangle\n height: 40,\n dx: 2, // move the sprite 2px to the right every frame\n});\n\nvar loop = kontra.gameLoop({ // create the main game loop\n update: function() { // update the game state\n sprite.update();\n\n // wrap the sprites position when it reaches\n // the edge of the screen\n if (sprite.x > kontra.canvas.width) {\n sprite.x = -sprite.width;\n }\n },\n render: function() { // render the game state\n sprite.render();\n }\n});\n\nloop.start(); // start the game",
|
||||
"externalLibs": {
|
||||
"js":
|
||||
"https://unpkg.com/kontra@3.3.0/dist/core.js\nhttps://unpkg.com/kontra@3.3.0/dist/sprite.js\nhttps://unpkg.com/kontra@3.3.0/dist/gameLoop.js\nhttps://unpkg.com/kontra@3.3.0/dist/pointer.js",
|
||||
"css": ""
|
||||
},
|
||||
"htmlMode": "html",
|
||||
"cssMode": "css",
|
||||
"jsMode": "js",
|
||||
"sizes": ["33px", "33px", "calc(100% - 66px)"],
|
||||
"mainSizes": [50, 50],
|
||||
"layoutMode": 1
|
||||
}
|
16
app/templates/template-preact.json
Normal file
16
app/templates/template-preact.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"title": "Preact template",
|
||||
"externalLibs": {
|
||||
"js": "\nhttps://cdnjs.cloudflare.com/ajax/libs/preact/8.2.9/preact.min.js",
|
||||
"css": ""
|
||||
},
|
||||
"sizes": ["calc(30% - 3px)", "30px", "calc(70% - 3px)"],
|
||||
"mainSizes": [68.1051, 31.6949],
|
||||
"htmlMode": "html",
|
||||
"cssMode": "css",
|
||||
"jsMode": "es6",
|
||||
"layoutMode": 1,
|
||||
"js":
|
||||
"\nconst { h, Component, render, createElement } = window.preact;\nconst React = {createElement}\n\nclass App extends Component {\n constructor() {\n super();\n this.message = 'World';\n }\n render() {\n return (<div>Hello {this.message}</div>)\n }\n}\nrender(<App/>, window.root)\n\n",
|
||||
"html": "<div id=\"root\"></div>\n"
|
||||
}
|
18
app/templates/template-react.json
Normal file
18
app/templates/template-react.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"title": "React template",
|
||||
"externalLibs": {
|
||||
"js":
|
||||
"\nhttps://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react.min.js\nhttps://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react-dom.min.js",
|
||||
"css": ""
|
||||
},
|
||||
"updatedOn": 1531063870556,
|
||||
"sizes": ["", "calc(17.4842% - 6px)", "calc(49.1221% - 3px)"],
|
||||
"mainSizes": [68.1051, 31.6949],
|
||||
"htmlMode": "html",
|
||||
"cssMode": "css",
|
||||
"jsMode": "es6",
|
||||
"layoutMode": 1,
|
||||
"js":
|
||||
"class App extends React.Component {\n constructor() {\n super();\n this.message = 'World';\n }\n render() {\n return (<h1>Hello {this.message}</h1>);\n }\n}\nReactDOM.render(<App/>, window.root);\n\n\n",
|
||||
"html": "<div id=\"root\"></div>\n"
|
||||
}
|
Reference in New Issue
Block a user