49 lines
947 B
JavaScript
49 lines
947 B
JavaScript
|
const defaultSketch = `function setup() {
|
||
|
createCanvas(400, 400);
|
||
|
}
|
||
|
|
||
|
function draw() {
|
||
|
background(220);
|
||
|
}`;
|
||
|
|
||
|
const defaultHTML =
|
||
|
`<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/p5.js"></script>
|
||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/addons/p5.dom.min.js"></script>
|
||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/addons/p5.sound.min.js"></script>
|
||
|
<link rel="stylesheet" type="text/css" href="style.css">
|
||
|
<meta charset="utf-8" />
|
||
|
|
||
|
</head>
|
||
|
<body>
|
||
|
<script src="sketch.js"></script>
|
||
|
</body>
|
||
|
</html>
|
||
|
`;
|
||
|
|
||
|
const defaultCSS =
|
||
|
`html, body {
|
||
|
margin: 0;
|
||
|
padding: 0;
|
||
|
}
|
||
|
canvas {
|
||
|
display: block;
|
||
|
}
|
||
|
`;
|
||
|
|
||
|
export default function createDefaultFiles() {
|
||
|
return {
|
||
|
'index.html': {
|
||
|
content: defaultHTML
|
||
|
},
|
||
|
'style.css': {
|
||
|
content: defaultCSS
|
||
|
},
|
||
|
'sketch.js': {
|
||
|
content: defaultSketch
|
||
|
}
|
||
|
};
|
||
|
}
|