This commit is contained in:
+4
-2
@@ -118,9 +118,11 @@ body {
|
|||||||
.sheet-handle {
|
.sheet-handle {
|
||||||
width: 36px;
|
width: 36px;
|
||||||
height: 4px;
|
height: 4px;
|
||||||
background: #2e2e2e;
|
background: #444;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
margin: 10px auto 0;
|
margin: 0 auto;
|
||||||
|
padding: 16px 0;
|
||||||
|
background-clip: content-box;
|
||||||
}
|
}
|
||||||
@keyframes slideUp {
|
@keyframes slideUp {
|
||||||
from { transform: translateY(100%); }
|
from { transform: translateY(100%); }
|
||||||
|
|||||||
+17
-2
@@ -219,8 +219,23 @@ function HomePage() {
|
|||||||
{isMobile && expandedCard && (
|
{isMobile && expandedCard && (
|
||||||
<>
|
<>
|
||||||
<div className="sheet-backdrop" onClick={() => setExpandedCardId(null)} />
|
<div className="sheet-backdrop" onClick={() => setExpandedCardId(null)} />
|
||||||
<div className="bottom-sheet">
|
<div
|
||||||
<div className="sheet-handle" />
|
className="bottom-sheet"
|
||||||
|
onTouchStart={e => { e._sheetStartY = e.touches[0].clientY; }}
|
||||||
|
onTouchMove={e => {
|
||||||
|
const dy = e.touches[0].clientY - e._sheetStartY;
|
||||||
|
if (dy > 0) e.currentTarget.style.transform = `translateY(${dy}px)`;
|
||||||
|
}}
|
||||||
|
onTouchEnd={e => {
|
||||||
|
const dy = e.changedTouches[0].clientY - e._sheetStartY;
|
||||||
|
if (dy > 80) {
|
||||||
|
setExpandedCardId(null);
|
||||||
|
} else {
|
||||||
|
e.currentTarget.style.transform = '';
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className="sheet-handle" style={{ cursor: 'grab' }} />
|
||||||
<div style={{ padding: '12px 16px', display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '12px' }}>
|
<div style={{ padding: '12px 16px', display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '12px' }}>
|
||||||
{cardDetailContent(expandedCard)}
|
{cardDetailContent(expandedCard)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user