vertical-nav.component.scss 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. @use '../../../../../shared/styles/_ios-theme.scss' as *;
  2. // 横向滑动条式选项卡导航
  3. .horizontal-tab-nav {
  4. position: relative;
  5. display: flex;
  6. flex-direction: column;
  7. width: 100%;
  8. background: $ios-background;
  9. border-radius: $ios-radius-lg;
  10. overflow: hidden;
  11. box-shadow: $ios-shadow-sm;
  12. }
  13. .tab-container {
  14. display: flex;
  15. position: relative;
  16. background: rgba(0, 122, 255, 0.05);
  17. border-radius: $ios-radius-lg;
  18. padding: 4px;
  19. }
  20. .tab-item {
  21. flex: 1;
  22. display: flex;
  23. align-items: center;
  24. justify-content: center;
  25. padding: 12px 16px;
  26. border: none;
  27. background: transparent;
  28. color: $ios-text-secondary;
  29. font-size: $ios-font-size-md;
  30. font-weight: $ios-font-weight-medium;
  31. cursor: pointer;
  32. transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  33. border-radius: $ios-radius-md;
  34. position: relative;
  35. z-index: 2;
  36. min-width: 120px;
  37. &:hover {
  38. color: $ios-primary;
  39. background: rgba(0, 122, 255, 0.08);
  40. }
  41. &.active {
  42. color: $ios-primary;
  43. font-weight: $ios-font-weight-semibold;
  44. }
  45. .tab-text {
  46. white-space: nowrap;
  47. overflow: hidden;
  48. text-overflow: ellipsis;
  49. transition: all 0.3s ease;
  50. }
  51. }
  52. // 滑动指示器
  53. .tab-indicator {
  54. position: absolute;
  55. top: 4px;
  56. left: 4px;
  57. height: calc(100% - 8px);
  58. width: 120px;
  59. background: $ios-background;
  60. border-radius: $ios-radius-md;
  61. box-shadow: 0 2px 8px rgba(0, 122, 255, 0.15);
  62. transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  63. z-index: 1;
  64. }
  65. // 响应式设计
  66. @media (max-width: 768px) {
  67. .horizontal-tab-nav {
  68. margin: 0 -8px;
  69. }
  70. .tab-item {
  71. padding: 10px 12px;
  72. font-size: $ios-font-size-sm;
  73. min-width: 100px;
  74. }
  75. .tab-indicator {
  76. width: 100px;
  77. }
  78. }
  79. @media (max-width: 480px) {
  80. .tab-item {
  81. padding: 8px 10px;
  82. font-size: 13px;
  83. min-width: 80px;
  84. }
  85. .tab-indicator {
  86. width: 80px;
  87. }
  88. }
  89. // 保持向后兼容的垂直导航样式(如果需要)
  90. .vertical-nav {
  91. display: flex;
  92. flex-direction: column;
  93. gap: $ios-spacing-xs;
  94. padding: $ios-spacing-sm;
  95. background: $ios-background;
  96. border-radius: $ios-radius-md;
  97. border: 1px solid $ios-border;
  98. box-shadow: $ios-shadow-sm;
  99. min-width: 160px;
  100. max-width: 200px;
  101. width: 100%;
  102. .nav-item {
  103. display: flex;
  104. align-items: center;
  105. padding: $ios-spacing-xs $ios-spacing-sm;
  106. border-radius: $ios-radius-sm;
  107. cursor: pointer;
  108. transition: all 0.2s ease;
  109. color: $ios-text-primary;
  110. text-decoration: none;
  111. font-size: $ios-font-size-sm;
  112. font-weight: $ios-font-weight-regular;
  113. line-height: 1.2;
  114. background: transparent;
  115. border: none;
  116. &:hover {
  117. background-color: $ios-background-secondary;
  118. }
  119. &.active {
  120. background-color: $ios-primary;
  121. color: white;
  122. font-weight: $ios-font-weight-medium;
  123. }
  124. .nav-text {
  125. white-space: nowrap;
  126. overflow: hidden;
  127. text-overflow: ellipsis;
  128. flex: 1;
  129. }
  130. }
  131. }