_sliding-box.scss 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /* Sliding box zoom effect */
  2. @keyframes scale-effect {
  3. 0% {
  4. @include prefix(transform, scale(0.9), webkit);
  5. }
  6. to {
  7. @include prefix(transform, scale(1), webkit);
  8. }
  9. }
  10. @-webkit-keyframes scale-effect {
  11. 0% {
  12. @include prefix(transform, scale(0.9), webkit);
  13. }
  14. to {
  15. @include prefix(transform, scale(1), webkit);
  16. }
  17. }
  18. /* Sliding box fade effect */
  19. @keyframes fade {
  20. 0% {
  21. opacity: 0.2;
  22. }
  23. to {
  24. opacity: 1;
  25. }
  26. }
  27. @-webkit-keyframes fade {
  28. 0% {
  29. opacity: 0.2;
  30. }
  31. to {
  32. opacity: 1;
  33. }
  34. }
  35. /* Sliding box right effect */
  36. @keyframes slide-right {
  37. 0% {
  38. @include prefix(transform, translateX(-25px), webkit);
  39. }
  40. to {
  41. @include prefix(transform, translateX(0), webkit);
  42. }
  43. }
  44. @-webkit-keyframes slide-right {
  45. 0% {
  46. @include prefix(transform, translateX(-25px), webkit);
  47. }
  48. to {
  49. @include prefix(transform, translateX(0), webkit);
  50. }
  51. }
  52. /* Sliding box */
  53. .sliding-box {
  54. * {
  55. will-change: transform;
  56. }
  57. .sliding-box-item {
  58. margin-left: 15px;
  59. margin-right: 15px;
  60. float: left;
  61. overflow: hidden;
  62. position: relative;
  63. @include prefix(transition, width 0.7s, webkit);
  64. .sliding-box-content {
  65. top: 0;
  66. height: 100%;
  67. position: absolute;
  68. }
  69. }
  70. }
  71. /* Sliding box style 01 */
  72. .sliding-box-style-01 {
  73. .sliding-box-item {
  74. .sliding-box-content {
  75. &:after {
  76. content: '';
  77. right: 100%;
  78. top: 50%;
  79. height: 0;
  80. width: 0;
  81. opacity: 0;
  82. z-index: 9;
  83. margin-top: -10px;
  84. position: absolute;
  85. border: solid transparent;
  86. border-right-color: var(--white);
  87. border-width: 12px;
  88. pointer-events: none;
  89. @include prefix(transition, all 0.2s linear, webkit);
  90. }
  91. }
  92. &.active, &:hover {
  93. .sliding-box-content {
  94. &:after {
  95. opacity: 1;
  96. }
  97. }
  98. }
  99. }
  100. }
  101. /* Sliding box style 02 */
  102. .sliding-box-style-02 {
  103. .sliding-box-item {
  104. .sliding-box-img {
  105. border-radius: 4px;
  106. @include prefix(transition, all 0.2s linear, webkit);
  107. }
  108. &.active {
  109. .sliding-box-img {
  110. border-radius: 4px 0 0 4px;
  111. }
  112. .sliding-box-content {
  113. border-radius: 0 4px 4px 0;
  114. }
  115. .content-hover {
  116. animation: fade 1s;
  117. }
  118. }
  119. }
  120. }
  121. /* Sliding box style 03 */
  122. .sliding-box-style-03 {
  123. .overlay {
  124. position: absolute;
  125. top: 0px;
  126. left: 0px;
  127. width: 100%;
  128. height: 100%;
  129. opacity: 0.5;
  130. z-index: 1;
  131. @include prefix(transition, all 0.3s linear, webkit);
  132. }
  133. .overlay-contnet {
  134. position: absolute;
  135. left: 0;
  136. top: 0;
  137. opacity: 1;
  138. visibility: visible;
  139. @include prefix(transition, all 0.4s linear, webkit);
  140. }
  141. .number {
  142. position: absolute;
  143. bottom: -30px;
  144. left: 0;
  145. right: 0;
  146. text-align: center;
  147. }
  148. .sliding-box-content {
  149. &:after {
  150. display: none;
  151. }
  152. }
  153. &.active {
  154. .overlay {
  155. opacity: 0;
  156. visibility: hidden;
  157. }
  158. .overlay-contnet {
  159. opacity: 0;
  160. visibility: hidden;
  161. }
  162. }
  163. }