mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-20 04:05:06 -04:00
wip
This commit is contained in:
parent
722637f11f
commit
0759981a55
21 changed files with 3294 additions and 251 deletions
|
@ -10,36 +10,6 @@ app.use(bodyParser.text({
|
|||
limit:'1MB'
|
||||
}));
|
||||
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.end(`<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Level editor</title>
|
||||
<link rel="icon"
|
||||
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🎨</text></svg>"
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="levels"></div>
|
||||
<div id="palette">
|
||||
<button id="new-level">new</button>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
${fs.readFileSync('./editclient.css').toString()}
|
||||
</style>
|
||||
<script>
|
||||
let allLevels = ${fs.readFileSync(srcPath).toString()};
|
||||
let palette = ${fs.readFileSync('src/palette.json').toString()};
|
||||
let backgrounds = ${fs.readFileSync('src/backgrounds.json').toString()};
|
||||
${fs.readFileSync('./editclient.js').toString()}
|
||||
</script>
|
||||
</body>
|
||||
`)
|
||||
})
|
||||
app.post('/', (req, res) => {
|
||||
if(req.body?.trim()) {
|
||||
fs.writeFileSync(srcPath, req.body)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue