_ui.slide.scss 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. @charset "utf-8";
  2. /*
  3. * @file: 图片轮播基础UI组件
  4. * @update: 2015-06-30 17:46:06
  5. */
  6. /*
  7. * 默认图片轮播
  8. * @base
  9. */
  10. $img-width: 1000px; // 图片宽度
  11. $img-height: 300px; // 图片高度
  12. .ui-slide {
  13. position: relative;
  14. width: $img-width;
  15. overflow: hidden;
  16. img {
  17. width: 100%;
  18. height: 100%;
  19. }
  20. }
  21. .ui-slide__content {
  22. position: relative;
  23. height: $img-height;
  24. }
  25. .ui-slide__panel {
  26. position: absolute;
  27. width: $img-width;
  28. height: $img-height;
  29. overflow: hidden;
  30. a {
  31. display: block;
  32. }
  33. }
  34. .ui-slide__mask {
  35. position: absolute;
  36. bottom: 0;
  37. right: 0;
  38. width: 100%;
  39. height: 100%;
  40. overflow: hidden;
  41. // padding: 10px 0;
  42. text-indent: 10px;
  43. font-size: 20px;
  44. line-height: 20px;
  45. color: #fff;
  46. @include transparent(#000, .5, true);
  47. }
  48. .ui-slide__prev,
  49. .ui-slide__next {
  50. position: absolute;
  51. top: 50%;
  52. cursor: pointer;
  53. // @include transparent(#000, .3, true);
  54. .ui-icon {
  55. font-size: 24px;
  56. color: #fff;
  57. }
  58. &:hover {
  59. // @include transparent(#000, .6, true);
  60. }
  61. }
  62. .ui-slide__prev {
  63. left: 0;
  64. }
  65. .ui-slide__next {
  66. right: 0;
  67. }
  68. /*
  69. * 点状导航的图片轮播
  70. * @extend: dotted
  71. */
  72. .ui-slide {
  73. &.ext-dotted {
  74. .ui-slide__nav {
  75. position: absolute;
  76. bottom: 15px;
  77. z-index: 99;
  78. width: 100%;
  79. text-align: center;
  80. font-size: 0; /* 所有浏览器 */
  81. *word-spacing: -1px; /* IE6/7 */
  82. }
  83. .ui-slide__trigger {
  84. @include inline-block;
  85. vertical-align: top;
  86. font-size: 12px;
  87. letter-spacing: normal;
  88. word-spacing: normal;
  89. width: 10px;
  90. height: 0;
  91. padding-top: 10px;
  92. cursor: pointer;
  93. overflow: hidden;
  94. border-radius: 50%;
  95. margin-left: 4px;
  96. margin-right: 4px;
  97. background-color: #ccc;
  98. &.is-active {
  99. background-color: #ff6c00;
  100. }
  101. }
  102. }
  103. }
  104. @media (-webkit-min-device-pixel-ratio:0) {
  105. .ui-slide.ext-dotted .ui-slide__nav {
  106. letter-spacing: -5px; /* Safari 5- 等不支持 font-size: 0 的浏览器*/
  107. }
  108. }
  109. /*
  110. * 缩略图导航公共部分
  111. * @extend: thumbX/thumbY
  112. */
  113. $active-border-width: 3px; // 激活项边框宽度
  114. $active-border-color: #288ad6; // 激活项边框颜色
  115. .ui-slide {
  116. &.ext-thumbX,
  117. &.ext-thumbY {
  118. .ui-slide__trigger {
  119. &.is-active {
  120. .ui-slide__thumbMask {
  121. border: $active-border-width solid $active-border-color;
  122. background: 0 0;
  123. @include opacity(1, true);
  124. }
  125. &::after {
  126. content: "";
  127. position: absolute;
  128. width: 0;
  129. height: 0;
  130. border-width: 8px;
  131. border-style: solid;
  132. }
  133. }
  134. }
  135. }
  136. }
  137. .ui-slide__thumbMask {
  138. position: absolute;
  139. top: 0;
  140. left: 0;
  141. display: block;
  142. background: #fff;
  143. @include opacity(.1, true);
  144. }
  145. /*
  146. * 横向缩略图导航
  147. * @extend: thumbX
  148. */
  149. $thumb-x-width: 170px; // 缩略图宽度
  150. $thumb-x-height: 94px; // 缩略图高度
  151. $thumb-x-spacing: 20px; // 缩略图间距
  152. .ui-slide {
  153. &.ext-thumbX {
  154. .ui-slide__nav {
  155. @include clearfix;
  156. padding-top: 15px;
  157. margin-right: -$thumb-x-spacing;
  158. }
  159. .ui-slide__trigger {
  160. position: relative;
  161. float: left;
  162. margin-right: $thumb-x-spacing;
  163. width: $thumb-x-width;
  164. height: $thumb-x-height;
  165. cursor: pointer;
  166. &.is-active {
  167. .ui-slide__thumbMask {
  168. width: $thumb-x-width - 2*$active-border-width;
  169. height: $thumb-x-height - 2*$active-border-width;
  170. }
  171. &::after {
  172. top: -16px;
  173. left: 50%;
  174. margin-left: -8px;
  175. border-color: transparent transparent $active-border-color;
  176. }
  177. }
  178. }
  179. .ui-slide__thumbMask {
  180. width: $thumb-x-width;
  181. height: $thumb-x-height;
  182. }
  183. }
  184. }
  185. /*
  186. * 纵向缩略图导航
  187. * @extend: thumbY
  188. */
  189. $img-y-width: 555px; // 图片宽度
  190. $img-y-height: 300px; // 图片高度
  191. $thumb-y-width: 170px; // 缩略图宽度
  192. $thumb-y-height: 90px; // 缩略图高度
  193. $thumb-y-spacing: 15px; // 缩略图间距
  194. .ui-slide {
  195. &.ext-thumbY {
  196. height: $img-y-height;
  197. .ui-slide__content {
  198. float: left;
  199. width: $img-y-width;
  200. height: $img-y-height;
  201. }
  202. .ui-slide__panel {
  203. width: $img-y-width;
  204. height: $img-y-height;
  205. }
  206. .ui-slide__nav {
  207. overflow: hidden;
  208. zoom: 1;
  209. padding-left: 15px;
  210. margin-bottom: -$thumb-y-spacing;
  211. }
  212. .ui-slide__trigger {
  213. position: relative;
  214. float: left;
  215. margin-bottom: $thumb-y-spacing;
  216. width: $thumb-y-width;
  217. height: $thumb-y-height;
  218. cursor: pointer;
  219. &.is-active {
  220. .ui-slide__thumbMask {
  221. width: $thumb-y-width - 2*$active-border-width;
  222. height: $thumb-y-height - 2*$active-border-width;
  223. }
  224. &::after {
  225. left: -16px;
  226. top: 50%;
  227. margin-top: -8px;
  228. border-color: transparent $active-border-color transparent transparent;
  229. }
  230. }
  231. }
  232. .ui-slide__thumbMask {
  233. width: $thumb-y-width;
  234. height: $thumb-y-height;
  235. }
  236. }
  237. }