Move to parcel

This commit is contained in:
Renan LE CARO 2025-03-05 22:10:17 +01:00
parent c2706d00e7
commit 110f504820
16 changed files with 7665 additions and 513 deletions

View file

@ -1,146 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="64"
height="64"
viewBox="0 0 16.933333 16.933333"
version="1.1"
id="svg5"
xml:space="preserve"
sodipodi:docname="icon.svg"
inkscape:export-filename="icon.png"
inkscape:export-xdpi="768"
inkscape:export-ydpi="768"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview212"
pagecolor="#ffffff"
bordercolor="#999999"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="5.84375"
inkscape:cx="30.802139"
inkscape:cy="32.085561"
inkscape:window-width="1920"
inkscape:window-height="1080"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" /><defs
id="defs2" /><g
id="layer1"><rect
style="fill:#030b1f;fill-opacity:1;stroke-width:0.819666;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="rect234"
width="16.933332"
height="16.933332"
x="0"
y="0" /><rect
style="fill:#ffffff;fill-opacity:1;stroke-width:0.730758;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="rect1706"
width="4.2333331"
height="2.1166666"
x="2.5952761"
y="14.816667" /><path
style="fill:#ffffff;fill-opacity:1;stroke-width:0.840585;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760"
d="M 8.6672224,9.1329346 A 1.0583333,1.0583333 0 0 1 7.6113975,10.191265 1.0583333,1.0583333 0 0 1 6.5505677,9.1379514 1.0583333,1.0583333 0 0 1 7.6013639,8.074628 1.0583333,1.0583333 0 0 1 8.6671748,9.122901" /><path
style="fill:#8953e5;fill-opacity:1;stroke-width:0.271844;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760-2"
d="M 7.0868055,6.1665268 A 0.34226292,0.34226292 0 0 1 6.7453538,6.5087888 0.34226292,0.34226292 0 0 1 6.4022835,6.1681492 0.34226292,0.34226292 0 0 1 6.7421089,5.8242725 0.34226292,0.34226292 0 0 1 7.0867901,6.1632819" /><path
style="fill:#8953e5;fill-opacity:1;stroke-width:0.271844;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760-2-7"
d="M 9.9609095,4.6433425 A 0.34226292,0.34226292 0 0 1 9.6194578,4.9856045 0.34226292,0.34226292 0 0 1 9.2763875,4.6449649 0.34226292,0.34226292 0 0 1 9.616213,4.3010882 0.34226292,0.34226292 0 0 1 9.9608942,4.6400976" /><path
style="fill:#8953e5;fill-opacity:1;stroke-width:0.271844;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760-2-0"
d="M 9.4754292,6.0612068 A 0.34226292,0.34226292 0 0 1 9.1339775,6.4034688 0.34226292,0.34226292 0 0 1 8.7909072,6.0628293 0.34226292,0.34226292 0 0 1 9.1307327,5.7189525 0.34226292,0.34226292 0 0 1 9.4754139,6.057962" /><path
style="fill:#8953e5;fill-opacity:1;stroke-width:0.271844;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760-2-9"
d="M 8.7935426,7.682621 A 0.34226292,0.34226292 0 0 1 8.4520909,8.024883 0.34226292,0.34226292 0 0 1 8.1090206,7.6842434 0.34226292,0.34226292 0 0 1 8.448846,7.3403667 0.34226292,0.34226292 0 0 1 8.7935272,7.6793762" /><path
style="fill:#8953e5;fill-opacity:1;stroke-width:0.271844;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760-2-3"
d="M 10.550572,7.5443454 A 0.34226292,0.34226292 0 0 1 10.20912,7.8866073 0.34226292,0.34226292 0 0 1 9.8660501,7.5459678 0.34226292,0.34226292 0 0 1 10.205876,7.2020911 0.34226292,0.34226292 0 0 1 10.550557,7.5411005" /><path
style="fill:#8953e5;fill-opacity:1;stroke-width:0.271844;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760-2-6"
d="m 11.171486,10.027683 a 0.34226292,0.34226292 0 0 1 -0.341452,0.342262 0.34226292,0.34226292 0 0 1 -0.34307,-0.340639 0.34226292,0.34226292 0 0 1 0.339825,-0.343877 0.34226292,0.34226292 0 0 1 0.344681,0.339009" /><path
style="fill:#8953e5;fill-opacity:1;stroke-width:0.271844;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760-2-06"
d="M 9.6700341,9.248889 A 0.34226292,0.34226292 0 0 1 9.3285824,9.5911509 0.34226292,0.34226292 0 0 1 8.9855121,9.2505114 0.34226292,0.34226292 0 0 1 9.3253375,8.9066347 0.34226292,0.34226292 0 0 1 9.6700187,9.2456441" /><path
style="fill:#8953e5;fill-opacity:1;stroke-width:0.271844;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760-2-2"
d="m 9.8461224,10.381763 a 0.34226292,0.34226292 0 0 1 -0.3414517,0.342262 0.34226292,0.34226292 0 0 1 -0.3430703,-0.340639 0.34226292,0.34226292 0 0 1 0.3398255,-0.343877 0.34226292,0.34226292 0 0 1 0.3446812,0.33901" /><path
style="fill:#8953e5;fill-opacity:1;stroke-width:0.271844;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760-2-61"
d="m 10.677446,12.346528 a 0.34226292,0.34226292 0 0 1 -0.341452,0.342262 0.34226292,0.34226292 0 0 1 -0.3430699,-0.34064 0.34226292,0.34226292 0 0 1 0.3398249,-0.343876 0.34226292,0.34226292 0 0 1 0.344682,0.339009" /><path
style="fill:#8953e5;fill-opacity:1;stroke-width:0.271844;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760-2-8"
d="m 12.174136,14.576557 a 0.34226292,0.34226292 0 0 1 -0.341452,0.342262 0.34226292,0.34226292 0 0 1 -0.34307,-0.340639 0.34226292,0.34226292 0 0 1 0.339825,-0.343877 0.34226292,0.34226292 0 0 1 0.344681,0.339009" /><path
style="fill:#4aaae5;fill-opacity:1;stroke-width:0.271844;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760-2-8-7"
d="m 12.155115,8.4203005 a 0.34226292,0.34226292 0 0 1 -0.341452,0.3422619 0.34226292,0.34226292 0 0 1 -0.34307,-0.3406395 0.34226292,0.34226292 0 0 1 0.339825,-0.3438767 0.34226292,0.34226292 0 0 1 0.344681,0.3390094" /><path
style="fill:#4aaae5;fill-opacity:1;stroke-width:0.271844;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760-2-8-7-9"
d="M 13.807412,9.5352793 A 0.34226292,0.34226292 0 0 1 13.46596,9.8775412 0.34226292,0.34226292 0 0 1 13.12289,9.5369017 0.34226292,0.34226292 0 0 1 13.462715,9.193025 0.34226292,0.34226292 0 0 1 13.807396,9.5320344" /><path
style="fill:#4aaae5;fill-opacity:1;stroke-width:0.271844;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760-2-8-7-2"
d="M 10.550572,8.4820604 A 0.34226292,0.34226292 0 0 1 10.20912,8.8243224 0.34226292,0.34226292 0 0 1 9.8660501,8.4836829 0.34226292,0.34226292 0 0 1 10.205876,8.1398062 0.34226292,0.34226292 0 0 1 10.550557,8.4788156" /><path
style="fill:#4aaae5;fill-opacity:1;stroke-width:0.271844;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760-2-8-7-0"
d="m 11.829275,6.7558122 a 0.34226292,0.34226292 0 0 1 -0.341452,0.3422619 0.34226292,0.34226292 0 0 1 -0.34307,-0.3406395 0.34226292,0.34226292 0 0 1 0.339825,-0.3438767 0.34226292,0.34226292 0 0 1 0.344681,0.3390094" /><path
style="fill:#4aaae5;fill-opacity:1;stroke-width:0.271844;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760-2-8-7-23"
d="m 10.76369,5.8607206 a 0.34226292,0.34226292 0 0 1 -0.341452,0.342262 0.34226292,0.34226292 0 0 1 -0.34307,-0.3406395 0.34226292,0.34226292 0 0 1 0.339825,-0.3438767 0.34226292,0.34226292 0 0 1 0.344681,0.3390094" /><path
style="fill:#4aaae5;fill-opacity:1;stroke-width:0.271844;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760-2-8-7-7"
d="M 8.3128425,4.9443169 A 0.34226292,0.34226292 0 0 1 7.9713908,5.2865788 0.34226292,0.34226292 0 0 1 7.6283205,4.9459393 0.34226292,0.34226292 0 0 1 7.968146,4.6020626 0.34226292,0.34226292 0 0 1 8.3128272,4.941072" /><path
style="fill:#4aaae5;fill-opacity:1;stroke-width:0.271844;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760-2-8-7-5"
d="M 8.5685832,6.3082666 A 0.34226292,0.34226292 0 0 1 8.2271315,6.6505286 0.34226292,0.34226292 0 0 1 7.8840612,6.3098891 0.34226292,0.34226292 0 0 1 8.2238866,5.9660124 0.34226292,0.34226292 0 0 1 8.5685678,6.3050218" /><path
style="fill:#4aaae5;fill-opacity:1;stroke-width:0.271844;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="path1760-2-8-7-92"
d="M 9.7620389,7.0115528 A 0.34226292,0.34226292 0 0 1 9.4205872,7.3538148 0.34226292,0.34226292 0 0 1 9.0775169,7.0131753 0.34226292,0.34226292 0 0 1 9.4173423,6.6692985 0.34226292,0.34226292 0 0 1 9.7620235,7.008308" /><rect
style="fill:#4aaae5;fill-opacity:1;stroke-width:1.46181;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="rect1762"
width="4.2333331"
height="4.2333331"
x="0"
y="-6.9388939e-18" /><rect
style="fill:#8953e5;fill-opacity:1;stroke-width:1.46181;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="rect1762-3"
width="4.2333331"
height="4.2333331"
x="4.2333331"
y="0" /><rect
style="fill:#4aaae5;fill-opacity:1;stroke-width:1.46181;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="rect1762-5"
width="4.2333331"
height="4.2333331"
x="8.4666662"
y="3.469447e-18" /><rect
style="fill:#8953e5;fill-opacity:1;stroke-width:1.46181;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="rect1762-3-3"
width="4.2333331"
height="4.2333331"
x="12.699999"
y="3.469447e-18" /><rect
style="fill:#4aaae5;fill-opacity:1;stroke-width:1.46181;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="rect1762-56"
width="4.2333331"
height="4.2333331"
x="-16.933332"
y="4.2333331"
transform="scale(-1,1)" /><rect
style="fill:#8953e5;fill-opacity:1;stroke-width:1.46181;stroke-linecap:round;stroke-linejoin:round;paint-order:markers stroke fill;stop-color:#000000"
id="rect1762-3-3-1"
width="4.2333331"
height="4.2333331"
x="-4.2333331"
y="4.2333331"
transform="scale(-1,1)" /></g></svg>

Before

Width:  |  Height:  |  Size: 11 KiB

View file

@ -1,25 +0,0 @@
const palette={
_:'',
B:'black',
W:'white',
g:"#231f20",
y: "#ffd300",
b:"#6262EA",
t:"#5DA3EA",
s:"#E67070",
r:"#e32119",
R:"#ab0c0c",
c:"#59EEA3",
G:"#A1F051",
v:"#A664E8",
p:"#E869E8",
a:"#5BECEC",
C:"#53EE53",
S:"#F44848",
P:"#E66BA8",
O:"#F29E4A",
k:"#618227",
e:"#e1c8b4",
l:"#9b9fa4"
}

View file

@ -10,22 +10,30 @@ sed -i -e "s/^[[:space:]]*versionCode = .*/ versionCode = $versionCode/"
-e "s/^[[:space:]]*versionName = .*/ versionName = \"$versionCode\"/" \
./app/build.gradle.kts
# Invalidate web cache and update version
sed -i "s/\?v=[0-9]*/\?v=$versionCode/g" ./app/src/main/assets/index.html
echo "\"$versionCode\"" > src/version.json
# remove all exif metadata from pictures, because i think fdroid doesn't like that. odd
find -name '*.jp*g' -o -name '*.png' | xargs exiftool -all=
npm run build
rm -rf ./app/src/main/assets/*
cp public/* dist
cp dist/* ./app/src/main/assets/
# Create a release commit and tag
git add .
git commit -m "Automatic deploy $versionCode"
git commit -m "Build and deploy of version $versionCode"
git tag -a $versionCode -m $versionCode
git push
# upload to breakout.lecaro.me
DOMAIN="breakout.lecaro.me"
PUBLIC_CONTENT="./app/src/main/assets/"
PUBLIC_CONTENT="./dist"
exit 1
ssh staging "mkdir -p /opt/mup-nginx-proxy/config/html/static_sites/$DOMAIN"
rsync -avz --delete --delete-excluded --exclude="*.sh" --exclude="node_modules" --exclude="android" --exclude=".*" $PUBLIC_CONTENT staging:/opt/mup-nginx-proxy/config/html/static_sites/$DOMAIN

3539
dist/index.html vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -236,12 +236,11 @@ document.getElementById('new-level').addEventListener('click', e => {
renderAllLevels()
function save() {
return fetch('/', {
method: 'POST', headers: {
'Content-Type': 'text/plain'
},
body: 'let allLevels=' + JSON.stringify(allLevels, null, 2)
body: JSON.stringify(allLevels, null, 2)
})
}

View file

@ -4,7 +4,7 @@ const fs = require('fs')
const app = express()
const port = 4400
const srcPath = 'app/src/main/assets/levels.js'
const srcPath = 'src/levels.json'
app.use(bodyParser.text({
type: 'text/plain',
limit:'1MB'
@ -25,16 +25,17 @@ app.get('/', (req, res) => {
<div id="levels"></div>
<div id="palette">
<button id="new-level">new</button>
</div>
<style>
${fs.readFileSync('./editclient.css').toString()}
</style>
<script>${fs.readFileSync(srcPath).toString()}</script>
<script>${fs.readFileSync('app/src/main/assets/palette.js').toString()}</script>
<script>${fs.readFileSync('./editclient.js').toString()}</script>
<script>
const allLevels = ${fs.readFileSync(srcPath).toString()};
const palette = ${fs.readFileSync('src/palette.json').toString()};
${fs.readFileSync('./editclient.js').toString()}
</script>
</body>
`)
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 MiB

4260
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -2,10 +2,10 @@
"name": "breakout.lecaro.me",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "nodemon editserver.js --watch editserver.js ",
"serve": "http-server app/src/main/assets -o"
"start": "parcel src/index.html",
"build": "rm -f dist/* && parcel build src/index.html",
"editor": "nodemon editserver.js --watch editserver.js"
},
"author": "",
"license": "ISC",
@ -14,5 +14,9 @@
"express": "^4.21.2",
"http-server": "^14.1.1",
"nodemon": "^3.1.9"
},
"devDependencies": {
"parcel": "^2.13.3",
"svgo": "^3.3.2"
}
}

View file

@ -8,7 +8,7 @@
/>
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Breakout 71 privacy policy</title>
<link rel="icon" href="./icon.svg" />
<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>">
<style type="text/css">
body {
@ -32,7 +32,7 @@
Online GmbH in germany.
</p>
<p>
If you install the app through google play, no information will
If you install the app through google play or f-droid, no information will
be collected at all by me.
</p>
</body>

File diff suppressed because one or more lines are too long

View file

@ -9,18 +9,17 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Breakout 71</title>
<meta name="description" content="A breakout game with roguelite mechanics. Break bricks, catch coins, pick upgrades, repeat. Play for free on mobile and desktop.">
<link rel="stylesheet" href="style.css?v=29019801" />
<link rel="icon" href="./icon.svg" />
<style>
@import "style.css";
</style>
<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>
<button id="menu"><span> menu</span></button>
<button id="score"></button>
<canvas id="game"></canvas>
<script>window.appVersion="?v=29019801".slice(3)</script>
<script src="palette.js?v=29019801"></script>
<script src="levels.js?v=29019801"></script>
<script src="game.js?v=29019801"></script>
<script type="module">
import "./game.js";
</script>
</body>
</html>

View file

@ -1,4 +1,4 @@
let allLevels=[
[
{
"name": "71 mini",
"size": 5,

24
src/palette.json Normal file
View file

@ -0,0 +1,24 @@
{
"_": "",
"B": "black",
"W": "white",
"g": "#231f20",
"y": "#ffd300",
"b": "#6262EA",
"t": "#5DA3EA",
"s": "#E67070",
"r": "#e32119",
"R": "#ab0c0c",
"c": "#59EEA3",
"G": "#A1F051",
"v": "#A664E8",
"p": "#E869E8",
"a": "#5BECEC",
"C": "#53EE53",
"S": "#F44848",
"P": "#E66BA8",
"O": "#F29E4A",
"k": "#618227",
"e": "#e1c8b4",
"l": "#9b9fa4"
}

1
src/version.json Normal file
View file

@ -0,0 +1 @@
"29019801"