Skip to content

Commit

Permalink
Merge pull request #103 from MRT-Map/split-airportcalc
Browse files Browse the repository at this point in the history
Split airportcalc 2 into its own page
  • Loading branch information
iiiii7d authored Jan 3, 2024
2 parents 7845a4f + adebe46 commit 9ebc36d
Show file tree
Hide file tree
Showing 22 changed files with 494 additions and 425 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

A detailed map of the Minecart Rapid Transit server, inspired by OpenStreetMap and Google Maps

Also includes Airportcalc 2

All data is sourced from staff documents and the server dynamic map. You may need to hard refresh your page (shift+f5) to get the latest updates.

## Collaborators
Expand All @@ -14,5 +16,3 @@ All data is sourced from staff documents and the server dynamic map. You may nee
- megascatterbomb
- Airplaneguy9
- Scarycrumb45

MRT Map and Airportcalc logo by Cortesi
31 changes: 31 additions & 0 deletions airportcalc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!doctype html>
<html>
<head>
<title>Airportcalc 2</title>
<meta
name="description"
content="A city and airport size calculator for the Minecart Rapid Transit server"
/>
<meta name="author" content="MRT Mapping Services" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link rel="icon" type="image/png" href="./media/ac192.png" />
<link rel="manifest" href="manifest.json" />

<link rel="stylesheet" href="out-ac.css" />
<script defer src="out-ac.js"></script>
</head>

<body>
<div id="map"></div>
<div id="bar"></div>
<a id="downloader" style="display: none"></a>
<input
type="file"
name="importer"
id="importer"
accept=".apc,.json"
style="display: none"
/>
</body>
</html>
11 changes: 8 additions & 3 deletions build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ import postcssPresetEnv from "postcss-preset-env";
const postcssPlugins = [autoprefixer(), postcssPresetEnv({ stage: 0 })];

let ctx = await esbuild.context({
entryPoints: ["src/index.ts"],
entryPoints: [
{ in: "src/map/index.ts", out: "out-map" },
{ in: "src/airportcalc/index.ts", out: "out-ac" },
],
bundle: true,
minify: true,
sourcemap: true,
outfile: "out/out.js",
publicPath: process.argv[2] == "prod" ? "https://mrt-map.github.io/map" : undefined,
outdir: "out",
publicPath:
process.argv[2] == "prod" ? "https://mrt-map.github.io/map" : undefined,
plugins: [
sassPlugin({
async transform(source) {
Expand All @@ -34,6 +38,7 @@ let ctx = await esbuild.context({
});
if (!fs.existsSync("out")) fs.mkdirSync("out");
fs.copyFileSync("./index.html", "./out/index.html");
fs.copyFileSync("./airportcalc.html", "./out/airportcalc.html");
fs.copyFileSync("./manifest.json", "./out/manifest.json");
fse.copySync("./media", "./out/media");

Expand Down
17 changes: 4 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<title>MRT City Map</title>
Expand All @@ -10,10 +10,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link rel="icon" type="image/png" href="./media/map192.png" />
<link rel="manifest" href="manifest.json">
<link rel="manifest" href="manifest.json" />

<link rel="stylesheet" href="out.css" />
<script defer src="out.js"></script>
<link rel="stylesheet" href="out-map.css" />
<script defer src="out-map.js"></script>
</head>

<body>
Expand All @@ -29,14 +29,5 @@
</div>

<div id="map"></div>
<div id="bar"></div>
<a id="downloader" style="display: none"></a>
<input
type="file"
name="importer"
id="importer"
accept=".apc,.json"
style="display: none"
/>
</body>
</html>
Binary file added media/ac192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/ac512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9ebc36d

Please sign in to comment.