added a stylesheet (passed 10% of the size budget)
also changed wasm name from pirates to index to save like 9 bytes also changed to "s" opt level to save like 9 bytes
This commit is contained in:
parent
63f6a46482
commit
a875e36df8
6 changed files with 20 additions and 10 deletions
|
@ -3,6 +3,7 @@
|
|||
<head>
|
||||
<script type="module" src="index.js">
|
||||
</script>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="window"></canvas>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
async function init() {
|
||||
const { instance } = await WebAssembly.instantiateStreaming(
|
||||
fetch("./pirates.wasm")
|
||||
fetch("./index.wasm")
|
||||
);
|
||||
|
||||
const width = 600;
|
||||
|
|
12
front/style.css
Normal file
12
front/style.css
Normal file
|
@ -0,0 +1,12 @@
|
|||
body {
|
||||
margin: 0;
|
||||
background-color: #222222;
|
||||
}
|
||||
|
||||
#window {
|
||||
display: block;
|
||||
margin: auto;
|
||||
height: 100vh;
|
||||
max-width: 100vw;
|
||||
image-rendering: crisp-edges;
|
||||
}
|
3
justfile
3
justfile
|
@ -3,13 +3,14 @@ alias r := run
|
|||
alias c := check-zip
|
||||
|
||||
build: minify-js minify-rust minify-html
|
||||
cp front/style.css build/style.css
|
||||
|
||||
build-rust:
|
||||
cargo build --manifest-path pirates/Cargo.toml --target wasm32-unknown-unknown --release
|
||||
|
||||
minify-rust: build-rust build-dir
|
||||
wasm-strip pirates/target/wasm32-unknown-unknown/release/pirates.wasm
|
||||
wasm-opt -o build/pirates.wasm -Oz pirates/target/wasm32-unknown-unknown/release/pirates.wasm
|
||||
wasm-opt -o build/index.wasm -Oz pirates/target/wasm32-unknown-unknown/release/pirates.wasm
|
||||
|
||||
minify-js: build-dir
|
||||
#minify-js -m module --output build/index.js front/index.js
|
||||
|
|
8
note
8
note
|
@ -1,8 +0,0 @@
|
|||
The next great period of piracy was the Middle Ages. In the 12th and 13th centuries trade in Europe was growing rapidly offering rich pickings for pirates. The English Channel was infested with pirates many of them operating from the Cinque Ports, Dover, Hastings, Hythe, Romney, and Sandwich. There were also pirates operating from ports like Dunkirk and Calais. There were also many pirates in the Indian Ocean and the Mediterranean.
|
||||
https://localhistories.org/a-history-of-pirates/
|
||||
|
||||
caravel crew simulator with piracy mechanics?
|
||||
takes place on the english channel
|
||||
very small scale, crossings no more than 2 minuites
|
||||
model ~15 ports
|
||||
|
|
@ -3,6 +3,10 @@ name = "pirates"
|
|||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
opt-level = 's'
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
|
|
Loading…
Reference in a new issue