Skip to content

Commit

Permalink
Merge pull request #31 from OVINC-CN/fix_ios_vh
Browse files Browse the repository at this point in the history
fix: ios vh
  • Loading branch information
OrenZhang authored Jun 29, 2024
2 parents 1408742 + 4937c88 commit 0095902
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
16 changes: 16 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@
<title>ChatGPT | OVINC</title>
<script src="/extra-assets/js/cos-js-sdk-v5.min.js?v=20240306083000"></script>
<script src="https://turing.captcha.qcloud.com/TCaptcha.js?v=20240420185400"></script>
<style>
:root {
--vh: 1vh;
}
</style>
<script>
!(function (n, e) {
function setViewHeight() {
const windowVH = e.innerHeight / 100
n.documentElement.style.setProperty('--vh', windowVH + 'px')
}
const i = 'orientationchange' in window ? 'orientationchange' : 'resize'
n.addEventListener('DOMContentLoaded', setViewHeight)
e.addEventListener(i, setViewHeight)
})(document, window)
</script>
</head>
<body>
<div id="app"></div>
Expand Down
2 changes: 1 addition & 1 deletion src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ body[arco-theme='dark'] {

html, body, #app {
width: 100vw;
height: 100vh;
height: calc(100 * var(--vh));
}

html {
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ onMounted(() => initRUM());
}
#app-layout {
height: 100vh;
height: calc(100 * var(--vh));
width: 100vw;
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/Chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,6 @@ const setPromptForm = (data) => promptForm.value = data;
width: 100%;
display: flex;
flex-direction: column;
max-height: calc(100vh - 160px);
max-height: calc(100 * var(--vh) - 160px);
}
</style>

0 comments on commit 0095902

Please sign in to comment.