适配移动端表单软键盘遮挡

This commit is contained in:
2026-07-01 10:52:38 +08:00
parent a98740ac6b
commit ac6008788b
4 changed files with 74 additions and 4 deletions
+15 -3
View File
@@ -1,4 +1,5 @@
:root {
--keyboard-inset: 0px;
--page-bg: #f8f5ef;
--card-bg: #fffdf8;
--ink: #26231f;
@@ -94,7 +95,7 @@ a {
width: min(100%, 520px);
min-height: 100vh;
margin: 0 auto;
padding: 14px 12px 28px;
padding: 14px 12px calc(28px + var(--keyboard-inset));
}
.mobile-page--plain {
@@ -350,6 +351,8 @@ a {
padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
background: rgba(248, 245, 239, 0.94);
backdrop-filter: blur(18px);
transform: translateY(calc(var(--keyboard-inset) * -1));
transition: transform 0.18s ease;
}
.fixed-bottom__inner {
@@ -390,6 +393,11 @@ a {
background: rgba(255, 253, 248, 0.96);
box-shadow: 0 -8px 26px rgba(58, 48, 34, 0.07);
backdrop-filter: blur(18px);
transition: transform 0.18s ease;
}
.app-keyboard-active .tabbar {
transform: translateY(calc(100% + env(safe-area-inset-bottom)));
}
.tabbar__item {
@@ -457,17 +465,21 @@ a {
display: flex;
align-items: flex-end;
justify-content: center;
padding: 14px;
padding: 14px 14px calc(14px + var(--keyboard-inset));
background: rgba(38, 35, 31, 0.34);
overflow: hidden;
}
.modal-panel {
width: min(100%, 500px);
max-height: min(84vh, 720px);
max-height: min(84vh, 720px, calc(100vh - 28px - var(--keyboard-inset)));
overflow: auto;
overscroll-behavior: contain;
-webkit-overflow-scrolling: touch;
border-radius: 22px 22px 16px 16px;
background: var(--card-bg);
box-shadow: 0 18px 46px rgba(38, 35, 31, 0.18);
touch-action: pan-y;
}
.modal-panel__head {