Lift mobile docks and FABs above the bottom tab bar.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -78,8 +78,18 @@ let dragMoved = false;
|
|||||||
let dragOffsetX = 0;
|
let dragOffsetX = 0;
|
||||||
let dragOffsetY = 0;
|
let dragOffsetY = 0;
|
||||||
|
|
||||||
|
function mobileTabbarPx(): number {
|
||||||
|
if (typeof window === 'undefined' || viewport.value.w > 900) return 0;
|
||||||
|
const bar = document.querySelector('.mobile-tabbar');
|
||||||
|
if (bar instanceof HTMLElement) {
|
||||||
|
const h = bar.getBoundingClientRect().height;
|
||||||
|
if (h > 0) return h;
|
||||||
|
}
|
||||||
|
return 64;
|
||||||
|
}
|
||||||
|
|
||||||
function defaultPos(): FabPos {
|
function defaultPos(): FabPos {
|
||||||
const extra = viewport.value.w <= 900 ? 64 : 0;
|
const extra = mobileTabbarPx();
|
||||||
return {
|
return {
|
||||||
left: FAB_MARGIN_LEFT,
|
left: FAB_MARGIN_LEFT,
|
||||||
top: Math.max(8, viewport.value.h - FAB_MARGIN_BOTTOM - extra - FAB_SIZE),
|
top: Math.max(8, viewport.value.h - FAB_MARGIN_BOTTOM - extra - FAB_SIZE),
|
||||||
@@ -88,7 +98,7 @@ function defaultPos(): FabPos {
|
|||||||
|
|
||||||
function clampPos(pos: FabPos): FabPos {
|
function clampPos(pos: FabPos): FabPos {
|
||||||
const margin = 8;
|
const margin = 8;
|
||||||
const bottomGap = viewport.value.w <= 900 ? 64 : 0;
|
const bottomGap = mobileTabbarPx();
|
||||||
return {
|
return {
|
||||||
left: Math.min(Math.max(margin, pos.left), viewport.value.w - FAB_SIZE - margin),
|
left: Math.min(Math.max(margin, pos.left), viewport.value.w - FAB_SIZE - margin),
|
||||||
top: Math.min(
|
top: Math.min(
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
@import "./tokens.css";
|
@import "./tokens.css";
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
|
--mobile-tabbar-h: 0px;
|
||||||
|
|
||||||
/* Surface & Background */
|
/* Surface & Background */
|
||||||
--bg: #f8fafc;
|
--bg: #f8fafc;
|
||||||
--surface: #ffffff;
|
--surface: #ffffff;
|
||||||
@@ -251,6 +253,10 @@ textarea {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 900px) {
|
@media (max-width: 900px) {
|
||||||
|
:root {
|
||||||
|
--mobile-tabbar-h: calc(3.65rem + env(safe-area-inset-bottom, 0px));
|
||||||
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: clamp(1.35rem, 5vw, 1.75rem);
|
font-size: clamp(1.35rem, 5vw, 1.75rem);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -319,6 +319,7 @@ onMounted(load);
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 0.9rem;
|
gap: 0.9rem;
|
||||||
|
padding-bottom: 5.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav {
|
.nav {
|
||||||
@@ -572,7 +573,7 @@ dd {
|
|||||||
.dock {
|
.dock {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset-inline: 0.85rem;
|
inset-inline: 0.85rem;
|
||||||
bottom: calc(0.55rem + env(safe-area-inset-bottom));
|
bottom: calc(0.55rem + var(--mobile-tabbar-h));
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1.15fr 1fr 1fr;
|
grid-template-columns: 1.15fr 1fr 1fr;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
@@ -607,6 +608,10 @@ dd {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 900px) {
|
@media (min-width: 900px) {
|
||||||
|
.page {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.dock {
|
.dock {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
inset-inline: auto;
|
inset-inline: auto;
|
||||||
|
|||||||
@@ -661,6 +661,10 @@ watch([id, isNew], () => void load(), { immediate: true });
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.crm-page:not(.embedded) {
|
||||||
|
padding-bottom: 5rem;
|
||||||
|
}
|
||||||
|
|
||||||
.crm-page.embedded {
|
.crm-page.embedded {
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
}
|
}
|
||||||
@@ -1142,7 +1146,7 @@ watch([id, isNew], () => void load(), { immediate: true });
|
|||||||
.mobile-save {
|
.mobile-save {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset-inline: 0.85rem;
|
inset-inline: 0.85rem;
|
||||||
bottom: calc(0.55rem + env(safe-area-inset-bottom));
|
bottom: calc(0.55rem + var(--mobile-tabbar-h));
|
||||||
z-index: 8;
|
z-index: 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1154,6 +1158,7 @@ watch([id, isNew], () => void load(), { immediate: true });
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 960px) {
|
@media (min-width: 960px) {
|
||||||
|
.crm-page:not(.embedded),
|
||||||
.page {
|
.page {
|
||||||
padding-bottom: 1rem;
|
padding-bottom: 1rem;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
|
|||||||
@@ -791,6 +791,7 @@ onMounted(load);
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
padding-bottom: 5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page.embedded {
|
.page.embedded {
|
||||||
@@ -1391,7 +1392,7 @@ h1 {
|
|||||||
.mobile-save {
|
.mobile-save {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset-inline: 0.85rem;
|
inset-inline: 0.85rem;
|
||||||
bottom: calc(0.55rem + env(safe-area-inset-bottom));
|
bottom: calc(0.55rem + var(--mobile-tabbar-h));
|
||||||
z-index: 8;
|
z-index: 8;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1.2fr;
|
grid-template-columns: 1fr 1.2fr;
|
||||||
|
|||||||
@@ -2362,7 +2362,7 @@ h1 {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.65rem;
|
gap: 0.65rem;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
bottom: 0.5rem;
|
bottom: calc(0.5rem + var(--mobile-tabbar-h));
|
||||||
padding: 0.35rem 0;
|
padding: 0.35rem 0;
|
||||||
background: linear-gradient(to top, #f8fafc 70%, transparent);
|
background: linear-gradient(to top, #f8fafc 70%, transparent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -857,7 +857,7 @@ tbody tr:nth-child(even) { background: #fcfdff; }
|
|||||||
.page-btn.on { background: var(--teal); color: #fff; border-color: transparent; }
|
.page-btn.on { background: var(--teal); color: #fff; border-color: transparent; }
|
||||||
|
|
||||||
.fab {
|
.fab {
|
||||||
display: none; position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 40;
|
display: none; position: fixed; left: 1rem; right: 1rem; bottom: calc(1rem + var(--mobile-tabbar-h)); z-index: 40;
|
||||||
background: var(--teal); color: #fff; text-align: center; text-decoration: none;
|
background: var(--teal); color: #fff; text-align: center; text-decoration: none;
|
||||||
border-radius: var(--radius); padding: 0.9rem; font-weight: 600;
|
border-radius: var(--radius); padding: 0.9rem; font-weight: 600;
|
||||||
box-shadow: 0 12px 28px rgba(13,148,136,.35);
|
box-shadow: 0 12px 28px rgba(13,148,136,.35);
|
||||||
|
|||||||
@@ -2482,7 +2482,7 @@ textarea {
|
|||||||
|
|
||||||
.m-wiz-foot {
|
.m-wiz-foot {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
bottom: 0;
|
bottom: var(--mobile-tabbar-h);
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1.25fr 1fr;
|
grid-template-columns: 1.25fr 1fr;
|
||||||
gap: 0.65rem;
|
gap: 0.65rem;
|
||||||
|
|||||||
@@ -1710,7 +1710,7 @@ onBeforeUnmount(() => {
|
|||||||
.fab {
|
.fab {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset-inline-end: 1.1rem;
|
inset-inline-end: 1.1rem;
|
||||||
bottom: 1.25rem;
|
bottom: calc(1.25rem + var(--mobile-tabbar-h));
|
||||||
z-index: 40;
|
z-index: 40;
|
||||||
width: 54px;
|
width: 54px;
|
||||||
height: 54px;
|
height: 54px;
|
||||||
@@ -2147,6 +2147,10 @@ onBeforeUnmount(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 860px) {
|
@media (max-width: 860px) {
|
||||||
|
.notes-page {
|
||||||
|
padding-bottom: 5rem;
|
||||||
|
}
|
||||||
|
|
||||||
.desktop-only {
|
.desktop-only {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1658,7 +1658,7 @@ watch(() => route.query.tab, readTab, { immediate: true });
|
|||||||
.dock {
|
.dock {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset-inline: 1.1rem;
|
inset-inline: 1.1rem;
|
||||||
bottom: calc(0.7rem + env(safe-area-inset-bottom));
|
bottom: calc(0.7rem + var(--mobile-tabbar-h));
|
||||||
z-index: 12;
|
z-index: 12;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@@ -1709,6 +1709,12 @@ watch(() => route.query.tab, readTab, { immediate: true });
|
|||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 959px) {
|
||||||
|
.page {
|
||||||
|
padding-bottom: 6.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media (min-width: 960px) {
|
@media (min-width: 960px) {
|
||||||
.page {
|
.page {
|
||||||
padding-bottom: 1.2rem;
|
padding-bottom: 1.2rem;
|
||||||
|
|||||||
@@ -658,7 +658,7 @@ defineExpose({ updateDealStage: applyUpdateDealStage });
|
|||||||
.menu-pop {
|
.menu-pop {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset-inline-start: 1rem;
|
inset-inline-start: 1rem;
|
||||||
bottom: 5.5rem;
|
bottom: calc(var(--mobile-tabbar-h) + 1.75rem);
|
||||||
z-index: 40;
|
z-index: 40;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border: 1px solid var(--line);
|
border: 1px solid var(--line);
|
||||||
|
|||||||
@@ -743,7 +743,7 @@ tr:last-child td {
|
|||||||
display: none;
|
display: none;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 1.1rem;
|
left: 1.1rem;
|
||||||
bottom: 1.1rem;
|
bottom: calc(1.1rem + var(--mobile-tabbar-h));
|
||||||
width: 56px;
|
width: 56px;
|
||||||
height: 56px;
|
height: 56px;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
|
|||||||
@@ -1420,7 +1420,7 @@ h1 {
|
|||||||
.dock {
|
.dock {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset-inline: 0.85rem;
|
inset-inline: 0.85rem;
|
||||||
bottom: calc(0.55rem + env(safe-area-inset-bottom));
|
bottom: calc(0.55rem + var(--mobile-tabbar-h));
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -671,7 +671,7 @@ onBeforeUnmount(() => {
|
|||||||
.menu-pop {
|
.menu-pop {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset-inline-start: 1rem;
|
inset-inline-start: 1rem;
|
||||||
bottom: 5.5rem;
|
bottom: calc(var(--mobile-tabbar-h) + 1.75rem);
|
||||||
z-index: 40;
|
z-index: 40;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border: 1px solid var(--line);
|
border: 1px solid var(--line);
|
||||||
|
|||||||
@@ -921,9 +921,9 @@ th { background: #f8fafc; color: #64748b; font-weight: 700; white-space: nowrap;
|
|||||||
.sum-row.payable { color: var(--teal); font-weight: 600; border-bottom: 0; }
|
.sum-row.payable { color: var(--teal); font-weight: 600; border-bottom: 0; }
|
||||||
.forecast-summary { padding: 1rem; }
|
.forecast-summary { padding: 1rem; }
|
||||||
.mob-bottom {
|
.mob-bottom {
|
||||||
position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
|
position: fixed; left: 0; right: 0; bottom: var(--mobile-tabbar-h); z-index: 40;
|
||||||
display: none; grid-template-columns: auto 1fr auto; gap: 0.5rem; align-items: center;
|
display: none; grid-template-columns: auto 1fr auto; gap: 0.5rem; align-items: center;
|
||||||
padding: 0.65rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom));
|
padding: 0.65rem 0.85rem;
|
||||||
background: #fff; border-top: 1px solid #eef2f7; box-shadow: 0 -8px 24px rgba(15,23,42,.06);
|
background: #fff; border-top: 1px solid #eef2f7; box-shadow: 0 -8px 24px rgba(15,23,42,.06);
|
||||||
}
|
}
|
||||||
.fab {
|
.fab {
|
||||||
@@ -948,6 +948,7 @@ th { background: #f8fafc; color: #64748b; font-weight: 700; white-space: nowrap;
|
|||||||
.kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
.kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||||
}
|
}
|
||||||
@media (max-width: 900px) {
|
@media (max-width: 900px) {
|
||||||
|
.page { padding-bottom: 5.5rem; }
|
||||||
.desk-only { display: none !important; }
|
.desk-only { display: none !important; }
|
||||||
.mob-only, .mob-tabs, .mob-goals, .mob-forecast, .mob-bottom { display: flex; }
|
.mob-only, .mob-tabs, .mob-goals, .mob-forecast, .mob-bottom { display: flex; }
|
||||||
.mob-goals, .mob-forecast, .mob-form-screen { display: grid; }
|
.mob-goals, .mob-forecast, .mob-form-screen { display: grid; }
|
||||||
|
|||||||
@@ -1745,7 +1745,7 @@ textarea {
|
|||||||
min-height: 0;
|
min-height: 0;
|
||||||
max-height: min(78dvh, 640px);
|
max-height: min(78dvh, 640px);
|
||||||
border-radius: 22px 22px 0 0;
|
border-radius: 22px 22px 0 0;
|
||||||
padding-bottom: calc(0.85rem + env(safe-area-inset-bottom));
|
padding-bottom: 0.85rem;
|
||||||
animation: sheet-up 0.22s ease;
|
animation: sheet-up 0.22s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user