Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
HeHang0 committed Nov 10, 2023
1 parent 1ca51d3 commit 15104d0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
- name: Setup Pages
uses: actions/setup-node@v3

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
# - name: Setup MSBuild
# uses: microsoft/setup-msbuild@v1

- name: Build
run: |
Expand All @@ -36,14 +36,14 @@ jobs:
yarn
yarn build:zip
echo '<html><head><script>if(!localStorage.getItem("musiche-proxy-address"))localStorage.setItem("musiche-proxy-address","https://music.picapico.top/proxy");localStorage.setItem("musiche-router-prefix","musiche");let pathname=location.pathname.substring(9);let redirect=pathname?`${(location.search?"&":"?")}redirect=${pathname}`:"";location.href="/musiche"+location.search+redirect;</script></head></html>' > dist/404.html
cd ..\windows
echo "<Weavers><Costura/></Weavers>" > FodyWeavers.xml
mv ..\web\web.zip Resources\web.zip
msbuild Musiche.sln -t:"Restore;Build" /p:Configuration=Release /p:Platform="Any CPU"
msbuild Musiche.sln -t:"Restore;Build;Publish" /p:Configuration=Release /p:Platform="Any CPU" /p:PublishProfile="Properties\PublishProfiles\net6.0.pubxml" /p:TargetFramework=net6.0-windows
cd ..
copy windows\bin\Release\net472\Musiche.exe web\dist\Musiche.exe
copy windows\bin\Publish\net6.0-windows\Musiche.exe web\dist\Musiche.net6.exe
# cd ..\windows
# echo "<Weavers><Costura/></Weavers>" > FodyWeavers.xml
# mv ..\web\web.zip Resources\web.zip
# msbuild Musiche.sln -t:"Restore;Build" /p:Configuration=Release /p:Platform="Any CPU"
# msbuild Musiche.sln -t:"Restore;Build;Publish" /p:Configuration=Release /p:Platform="Any CPU" /p:PublishProfile="Properties\PublishProfiles\net6.0.pubxml" /p:TargetFramework=net6.0-windows
# cd ..
# copy windows\bin\Release\net472\Musiche.exe web\dist\Musiche.exe
# copy windows\bin\Publish\net6.0-windows\Musiche.exe web\dist\Musiche.net6.exe
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
Expand Down
15 changes: 14 additions & 1 deletion web/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ export function getRandomInt(min: number, max: number, ignore?: number) {
}

export function fixNotchIPhoneHeight() {
if (!isInStandaloneMode || !isIOS) return;
if (!isInStandaloneMode || !isIOS)
return {
isInStandaloneMode,
isIOS
};
const computeStyle = getComputedStyle(document.documentElement);
const sat = computeStyle.getPropertyValue('--sat') || '0';
const sal = computeStyle.getPropertyValue('--sal') || '0';
Expand All @@ -116,7 +120,16 @@ export function fixNotchIPhoneHeight() {
!sab.startsWith('0')
)
document.body.parentElement!.style.height = '100vh';
return {
isInStandaloneMode,
isIOS,
sat,
sal,
sar,
sab
};
}
window.fixNotchIPhoneHeight = fixNotchIPhoneHeight;

export function duration2Millisecond(duration: string) {
if (!duration || typeof duration != 'string') duration = '';
Expand Down

0 comments on commit 15104d0

Please sign in to comment.