Skip to content

Commit

Permalink
try fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cBournhonesque committed Jul 25, 2024
1 parent ac1e677 commit 3a5cc03
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 36 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,14 @@ jobs:
uses: cargo-bins/[email protected]

- name: Install and run trunk (Web)
working-directory: client
if: ${{ matrix.platform == 'web' }}
run: |
cargo binstall trunk --no-confirm
trunk build --bin client --release --dist '${{ env.OUT_DIR }}'
trunk build --release --dist '${{ env.OUT_DIR }}'
zip --recurse-paths '${{ env.PACKAGE }}${{ matrix.package_ext }}' '${{ env.OUT_DIR }}'
mkdir -p ../tmp/package
mv '${{ env.PACKAGE }}${{ matrix.package_ext }}' ../tmp/package
# - name: Build binaries (non-Web)
# if: ${{ matrix.platform != 'web' }}
Expand Down Expand Up @@ -180,16 +184,16 @@ jobs:
# </plist>
# EOF

- name: Finish package (non-Windows)
if: ${{ matrix.platform != 'windows' }}
working-directory: tmp/package
run: |
if [ '${{ matrix.platform }}' == 'macos' ]; then
ln -s /Applications .
hdiutil create -fs HFS+ -volname '${{ env.PACKAGE_NAME }}' -srcfolder . '${{ env.PACKAGE }}${{ matrix.package_ext }}'
else
zip --recurse-paths '${{ env.PACKAGE }}${{ matrix.package_ext }}' '${{ env.PACKAGE_NAME }}'
fi
# - name: Finish package (non-Windows)
# if: ${{ matrix.platform != 'web' && matrix.platform != 'windows' }}
# working-directory: tmp/package
# run: |
# if [ '${{ matrix.platform }}' == 'macos' ]; then
# ln -s /Applications .
# hdiutil create -fs HFS+ -volname '${{ env.PACKAGE_NAME }}' -srcfolder . '${{ env.PACKAGE }}${{ matrix.package_ext }}'
# else
# zip --recurse-paths '${{ env.PACKAGE }}${{ matrix.package_ext }}' '${{ env.PACKAGE_NAME }}'
# fi

# - name: Finish package (Windows)
# if: ${{ matrix.platform == 'windows' }}
Expand Down
50 changes: 25 additions & 25 deletions client/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@
<html lang="en">

<head>
<meta charset="utf-8" />
<meta charset="utf-8"/>
<title>bevy_quickstart</title>
<link data-trunk rel="copy-dir" href="../../assets" />
<link data-trunk rel="inline" href="style.css" />
<link data-trunk rel="inline" type="module" href="restart-audio-context.js" />
<link data-trunk rel="rust" data-cargo-no-default-features data-wasm-opt="s" href="../" />
<link data-trunk rel="copy-dir" href="../../assets"/>
<link data-trunk rel="inline" href="style.css"/>
<link data-trunk rel="inline" type="module" href="restart-audio-context.js"/>
<link data-trunk rel="rust" data-cargo-no-default-features data-wasm-opt="s" href="../"/>
</head>

<body>
<div id="game" class="center">
<div id="loading-screen" class="center">
<span class="spinner"></span>
</div>

<canvas id="bevy">
Javascript and canvas support is required
</canvas>
<div id="game" class="center">
<div id="loading-screen" class="center">
<span class="spinner"></span>
</div>

<script type="module">
// Hide loading screen when the game starts.
const loading_screen = document.getElementById('loading-screen');
const bevy = document.getElementById('bevy');
const observer = new MutationObserver(() => {
if (bevy.height > 1) {
loading_screen.style.display = 'none';
observer.disconnect();
}
});
observer.observe(bevy, { attributeFilter: ['height'] });
</script>
<canvas id="bevy">
Javascript and canvas support is required
</canvas>
</div>

<script type="module">
// Hide loading screen when the game starts.
const loading_screen = document.getElementById('loading-screen');
const bevy = document.getElementById('bevy');
const observer = new MutationObserver(() => {
if (bevy.height > 1) {
loading_screen.style.display = 'none';
observer.disconnect();
}
});
observer.observe(bevy, {attributeFilter: ['height']});
</script>
</body>

</html>

0 comments on commit 3a5cc03

Please sign in to comment.