interactive-effects.scss 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. // 交互效果样式
  2. // 全局交互动画变量
  3. :root {
  4. --transition-fast: 0.15s ease-out;
  5. --transition-normal: 0.25s ease-out;
  6. --transition-slow: 0.35s ease-out;
  7. }
  8. // 卡片交互效果增强
  9. .core-card {
  10. transition: all var(--transition-normal);
  11. &:hover {
  12. transform: translateY(-2px) scale(1.02);
  13. box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  14. }
  15. &:active {
  16. transform: translateY(0) scale(0.98);
  17. transition: all var(--transition-fast);
  18. }
  19. }
  20. // 按钮交互效果
  21. .nav-btn, .view-toggle button, .add-shift-btn {
  22. transition: all var(--transition-normal);
  23. position: relative;
  24. overflow: hidden;
  25. &::before {
  26. content: '';
  27. position: absolute;
  28. top: 50%;
  29. left: 50%;
  30. width: 0;
  31. height: 0;
  32. background: rgba(255, 255, 255, 0.3);
  33. border-radius: 50%;
  34. transform: translate(-50%, -50%);
  35. transition: width var(--transition-normal), height var(--transition-normal);
  36. }
  37. &:hover::before {
  38. width: 300px;
  39. height: 300px;
  40. }
  41. &:active {
  42. transform: scale(0.95);
  43. }
  44. }
  45. // 列表行交互效果
  46. .list-row {
  47. transition: all var(--transition-normal);
  48. &:hover {
  49. background: rgba(0, 122, 255, 0.05);
  50. transform: translateX(4px);
  51. box-shadow: 0 2px 8px rgba(0, 122, 255, 0.1);
  52. }
  53. }
  54. // 工作量圆环特殊效果
  55. .workload-ring {
  56. transition: all var(--transition-normal);
  57. &:hover {
  58. transform: scale(1.05);
  59. filter: brightness(1.1);
  60. }
  61. }
  62. // 紧急任务卡片特殊效果
  63. .urgent-task {
  64. position: relative;
  65. &::after {
  66. content: '';
  67. position: absolute;
  68. top: 0;
  69. left: 0;
  70. right: 0;
  71. bottom: 0;
  72. background: linear-gradient(45deg, transparent 30%, rgba(255, 59, 48, 0.1) 50%, transparent 70%);
  73. opacity: 0;
  74. transition: opacity var(--transition-normal);
  75. }
  76. &:hover::after {
  77. opacity: 1;
  78. }
  79. }
  80. // 加载状态效果
  81. .loading {
  82. position: relative;
  83. &::before {
  84. content: '';
  85. position: absolute;
  86. top: 0;
  87. left: -100%;
  88. width: 100%;
  89. height: 100%;
  90. background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  91. animation: shimmer 1.5s infinite;
  92. }
  93. }
  94. @keyframes shimmer {
  95. 0% { left: -100%; }
  96. 100% { left: 100%; }
  97. }
  98. // 成功状态动画
  99. .success-state {
  100. animation: successPulse 0.6s ease-out;
  101. }
  102. @keyframes successPulse {
  103. 0% { transform: scale(1); }
  104. 50% { transform: scale(1.05); }
  105. 100% { transform: scale(1); }
  106. }
  107. // 错误状态动画
  108. .error-state {
  109. animation: errorShake 0.5s ease-out;
  110. }
  111. @keyframes errorShake {
  112. 0%, 100% { transform: translateX(0); }
  113. 25% { transform: translateX(-4px); }
  114. 75% { transform: translateX(4px); }
  115. }
  116. // 微交互反馈
  117. .interactive-element {
  118. &:focus-visible {
  119. outline: 2px solid rgba(0, 122, 255, 0.6);
  120. outline-offset: 2px;
  121. }
  122. }
  123. // 减少动画偏好设置支持
  124. @media (prefers-reduced-motion: reduce) {
  125. * {
  126. animation-duration: 0.01ms !important;
  127. animation-iteration-count: 1 !important;
  128. transition-duration: 0.01ms !important;
  129. }
  130. }