Skip to content

Commit

Permalink
b
Browse files Browse the repository at this point in the history
  • Loading branch information
HeHang0 committed Nov 10, 2023
1 parent 9768df2 commit ce6d490
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
4 changes: 2 additions & 2 deletions web/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Footer from './components/Footer.vue';
import CurrentList from './components/CurrentList.vue';
import PlayDetail from './components/PlayDetail.vue';
import WindowHelper from './components/WindowHelper.vue';
import { fixIos15IPhone8Height, webView2Services } from './utils/utils';
import { fixNotchIPhoneHeight, webView2Services } from './utils/utils';
import { MusicConnection } from './stores/connection';
import { usePlayStore } from './stores/play';
import { useSettingStore } from './stores/setting';
Expand All @@ -29,7 +29,7 @@ iconLink.rel = 'icon';
iconLink.href = LogoCircleImage;
document.head.appendChild(iconLink);
new MusicConnection(webView2Services.enabled);
fixIos15IPhone8Height();
fixNotchIPhoneHeight();
let rootClass = webView2Services.enabled ? 'webview-host' : '';
</script>

Expand Down
7 changes: 0 additions & 7 deletions web/src/style/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,6 @@ body,
padding: 0;
}

@media (display-mode: standalone) {
html {
height: 100vh;
width: 100vw;
}
}

body {
color: var(--music-text-color);
transition: color 0.5s;
Expand Down
13 changes: 6 additions & 7 deletions web/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ export function getRandomInt(min: number, max: number, ignore?: number) {
}
}

export function fixIos15IPhone8Height() {
export function fixNotchIPhoneHeight() {
const computeStyle = getComputedStyle(document.documentElement);
const sat = computeStyle.getPropertyValue('--sat') || '';
const sal = computeStyle.getPropertyValue('--sal') || '';
const sar = computeStyle.getPropertyValue('--sar') || '';
const sab = computeStyle.getPropertyValue('--sab') || '';
const sat = computeStyle.getPropertyValue('--sat') || '0';
const sal = computeStyle.getPropertyValue('--sal') || '0';
const sar = computeStyle.getPropertyValue('--sar') || '0';
const sab = computeStyle.getPropertyValue('--sab') || '0';
alert(`哈哈哈哈 ${sat}-${sal}-${sar}-${sab}`);
if (!isInStandaloneMode || !isIOS) return;
alert(`哈哈哈哈 1`);
Expand All @@ -118,8 +118,7 @@ export function fixIos15IPhone8Height() {
!sar.startsWith('0') ||
!sab.startsWith('0')
)
return;
document.body.parentElement!.style.height = '100%';
document.body.parentElement!.style.height = '100vh';
}

export function duration2Millisecond(duration: string) {
Expand Down

0 comments on commit ce6d490

Please sign in to comment.