feat: SwipeableView 스와이프 탭 전환 컴포넌트
This commit is contained in:
79
src/components/SwipeableView.css
Normal file
79
src/components/SwipeableView.css
Normal file
@@ -0,0 +1,79 @@
|
||||
/* SwipeableView — swipeable tab container */
|
||||
|
||||
.swipeable-view {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Tab bar */
|
||||
.swipeable-view__tabs {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
padding: 4px;
|
||||
background: var(--surface);
|
||||
border-radius: var(--radius-md);
|
||||
border: 1px solid var(--border-line);
|
||||
overflow-x: auto;
|
||||
scrollbar-width: none;
|
||||
-ms-overflow-style: none;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.swipeable-view__tabs::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Individual tab button */
|
||||
.swipeable-view__tab {
|
||||
flex: 1;
|
||||
min-width: fit-content;
|
||||
padding: 8px 16px;
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--text-dim);
|
||||
font-family: var(--font-body);
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
border-radius: calc(var(--radius-md) - 2px);
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
transition: color 0.18s var(--ease-out), background 0.18s var(--ease-out);
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.swipeable-view__tab.is-active {
|
||||
background: var(--surface-raised);
|
||||
color: var(--neon-cyan);
|
||||
}
|
||||
|
||||
/* Sliding track */
|
||||
.swipeable-view__track {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
transition: transform 0.3s var(--ease-out);
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
.swipeable-view__track.is-swiping {
|
||||
transition: none;
|
||||
}
|
||||
|
||||
/* Each panel */
|
||||
.swipeable-view__panel {
|
||||
flex: 0 0 100%;
|
||||
min-width: 0;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
/* Reduced motion */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.swipeable-view__track {
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.swipeable-view__tab {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user