diff --git a/.cargo/config.toml b/.cargo/config.toml index 5a2f738..10de96a 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,6 +1,3 @@ [target.x86_64-unknown-linux-gnu] linker = "clang" rustflags = ["-C", "link-arg=-fuse-ld=/usr/bin/mold", "-Zshare-generics=y"] - -[target.wasm32-unknown-unknown] -runner = "wasm-server-runner" diff --git a/.woodpecker/clippy.yml b/.woodpecker/clippy.yml deleted file mode 100644 index fc22646..0000000 --- a/.woodpecker/clippy.yml +++ /dev/null @@ -1,11 +0,0 @@ -when: - - event: [pull_request] - -steps: - clippy: - image: git.ragarock.moe/silvana/yuno/rust:latest - environment: [CARGO_TERM_COLOR=always, CARGO_HOME=./.cargo-home] - commands: - - rustup default nightly - - rustup component add clippy - - cargo clippy -- -D warnings diff --git a/.woodpecker/fmt.yml b/.woodpecker/fmt.yml deleted file mode 100644 index 0236183..0000000 --- a/.woodpecker/fmt.yml +++ /dev/null @@ -1,11 +0,0 @@ -when: - - event: [pull_request] - -steps: - fmt: - image: git.ragarock.moe/silvana/yuno/rust:latest - environment: [CARGO_TERM_COLOR=always, CARGO_HOME=./.cargo-home] - commands: - - rustup default nightly - - rustup component add rustfmt - - cargo fmt -- --check diff --git a/.woodpecker/html.yml b/.woodpecker/html.yml new file mode 100644 index 0000000..7411212 --- /dev/null +++ b/.woodpecker/html.yml @@ -0,0 +1,17 @@ +when: + - event: [tag] + +steps: + build: + image: git.ragarock.moe/silvana/yuno/rust:latest + environment: [CARGO_TERM_COLOR=always, CARGO_HOME=./.cargo-home] + commands: + - rustup default nightly + - rustup target add wasm32-unknown-unknown + - trunk build --public-url yuno/${CI_COMMIT_TAG} + upload: + image: minio/mc + secrets: [access_key, secret_key] + commands: + - mc alias set minio https://minio.ragarock.moe $access_key $secret_key + - mc cp -quiet --recursive dist/ minio/yuno/${CI_COMMIT_TAG}/ diff --git a/.woodpecker/quality.yml b/.woodpecker/quality.yml new file mode 100644 index 0000000..723ff1f --- /dev/null +++ b/.woodpecker/quality.yml @@ -0,0 +1,25 @@ +when: + - event: [pull_request] + +steps: + fmt: + image: git.ragarock.moe/silvana/yuno/rust:latest + environment: [CARGO_TERM_COLOR=always, CARGO_HOME=./.cargo-home] + commands: + - rustup default nightly + - rustup component add rustfmt + - cargo fmt -- --check + clippy: + image: git.ragarock.moe/silvana/yuno/rust:latest + environment: [CARGO_TERM_COLOR=always, CARGO_HOME=./.cargo-home] + commands: + - rustup default nightly + - rustup component add clippy + - cargo clippy -- -D warnings + test: + image: git.ragarock.moe/silvana/yuno/rust:latest + environment: [CARGO_TERM_COLOR=always, CARGO_HOME=./.cargo-home] + commands: + - rustup default nightly + - cargo check + - cargo test diff --git a/.woodpecker/test.yml b/.woodpecker/test.yml deleted file mode 100644 index f3220ac..0000000 --- a/.woodpecker/test.yml +++ /dev/null @@ -1,11 +0,0 @@ -when: - - event: [pull_request] - -steps: - test: - image: git.ragarock.moe/silvana/yuno/rust:latest - environment: [CARGO_TERM_COLOR=always, CARGO_HOME=./.cargo-home] - commands: - - rustup default nightly - - cargo check - - cargo test diff --git a/Cargo.lock b/Cargo.lock index c23d5ab..1599035 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4517,7 +4517,6 @@ dependencies = [ "bevy_kira_audio", "image", "log", - "rand", "webbrowser", "winit", ] diff --git a/Cargo.toml b/Cargo.toml index a506d1a..6cbeaac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,7 +60,6 @@ bevy = { version = "0.14", default-features = false, features = [ ] } bevy_kira_audio = { version = "0.20" } bevy_asset_loader = { version = "0.21", features = ["2d"] } -rand = { version = "0.8.3" } webbrowser = { version = "1", features = ["hardened"] } # keep the following in sync with Bevy's dependencies diff --git a/Dockerfile b/Dockerfile index 8dffb63..80d145c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,7 @@ WORKDIR /app RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs --output init-rust.sh \ && chmod a+x init-rust.sh \ && ./init-rust.sh -y \ + && /root/.cargo/bin/rustup target add wasm32-unknown-unknown \ && /root/.cargo/bin/cargo install trunk ENV PATH="/root/.cargo/bin:$PATH" diff --git a/html/styles.css b/html/styles.css index 1b211ac..4160fde 100644 --- a/html/styles.css +++ b/html/styles.css @@ -12,11 +12,43 @@ body { } .game-container { + width: 100%; + height: 100%; display: flex; justify-content: center; align-items: center; } +.lds-dual-ring { + display: inline-block; + position: absolute; + left: 0; + right: 0; + margin: auto; + width: 80px; + height: 80px; +} + +.lds-dual-ring:after { + content: " "; + display: block; + width: 64px; + height: 64px; + border-radius: 50%; + border: 6px solid #fff; + border-color: #fff transparent #fff transparent; + animation: lds-dual-ring 1.2s linear infinite; +} + +@keyframes lds-dual-ring { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} + #bevy { z-index: 2; } diff --git a/index.html b/index.html index 62406b5..8cbffd4 100644 --- a/index.html +++ b/index.html @@ -10,5 +10,9 @@ +
+
+ Javascript and support for canvas is required +
diff --git a/trunk.toml b/trunk.toml new file mode 100644 index 0000000..aa138e5 --- /dev/null +++ b/trunk.toml @@ -0,0 +1,2 @@ +[serve] +port = 8080