magic.scss 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. .adjust-position {
  2. margin-top: -20px;
  3. margin-bottom: -20px;
  4. }
  5. .header-wrap {
  6. position: relative;
  7. height: 710px;
  8. .img-header {
  9. position: absolute;
  10. bottom: 0;
  11. width: 100%;
  12. }
  13. }
  14. $module_name: '.cube-item';
  15. #{$module_name} {
  16. height: 90px;
  17. width: 88px;
  18. // margin-left: auto;
  19. // margin-right: 10px;
  20. border-radius: 26px;
  21. overflow: hidden;
  22. position: relative;
  23. transform: translateZ(0);
  24. &::before {
  25. content: '';
  26. position: absolute;
  27. bottom: 0;
  28. left: 0;
  29. width: 100%;
  30. height: 60px;
  31. border-radius: 0 0 26px 26px;
  32. }
  33. &-box {
  34. height: 63px;
  35. width: 100%;
  36. text-align: center;
  37. position: absolute;
  38. background: #fff;
  39. border-radius: 26px 26px 11px 11px;
  40. transform: translateZ(0);
  41. background-size: cover;
  42. background-repeat: no-repeat;
  43. overflow: hidden;
  44. }
  45. .sub-name {
  46. width: 100%;
  47. position: absolute;
  48. top: 63px;
  49. padding: 0 10px;
  50. box-sizing: border-box;
  51. color: #fff;
  52. font-size: 14px;
  53. text-align: center;
  54. line-height: 27px;
  55. white-space: nowrap;
  56. overflow: hidden;
  57. text-overflow: ellipsis;
  58. transform: translateZ(0);
  59. }
  60. .sub-image {
  61. display: block;
  62. width: 60px;
  63. height: 60px;
  64. margin: 0 auto;
  65. background-color: #fff;
  66. background-position: center;
  67. background-size: 100%;
  68. transform: translateY(6px);
  69. }
  70. .sub-desc {
  71. display: flex;
  72. align-items: center;
  73. justify-content: center;
  74. width: 77px;
  75. box-sizing: border-box;
  76. height: 15px;
  77. color: #fff;
  78. border-radius: 6px;
  79. font-size: 12px;
  80. text-align: center;
  81. position: absolute;
  82. bottom: 29px;
  83. left: 50%;
  84. transform-origin: 0 center;
  85. transform: translate3d(-50%, 0, 1px);
  86. span {
  87. width: 100%;
  88. display: block;
  89. line-height: normal;
  90. text-overflow: ellipsis;
  91. white-space: nowrap;
  92. overflow: hidden;
  93. }
  94. }
  95. // 图片
  96. &--pic {
  97. &::before {
  98. background: url('https://img12.360buyimg.com/imagetools/jfs/t1/184083/34/6101/38841/60b065caEaaf7c5d0/eec4cd260f46d9f0.png') no-repeat
  99. center/100%;
  100. height: 100%;
  101. }
  102. .cube-item-box {
  103. display: none;
  104. }
  105. .sub-desc {
  106. display: none;
  107. }
  108. .sub-name {
  109. display: none;
  110. }
  111. }
  112. // 活动
  113. &--act {
  114. &::before {
  115. background: url('https://img11.360buyimg.com/imagetools/jfs/t1/195605/17/5252/39357/60b065caEe0aa4c7e/04a341f4e51c6a9b.png') no-repeat
  116. center/100%;
  117. }
  118. .sub-desc {
  119. background: #ff5c17;
  120. }
  121. }
  122. // 榜单
  123. &--rank {
  124. &::before {
  125. background: url('https://img14.360buyimg.com/imagetools/jfs/t1/183388/37/6207/39741/60b065caEea1440a1/8860c63660fc9ac4.png') no-repeat
  126. center/100%;
  127. }
  128. .sub-desc {
  129. background: #1f95fb;
  130. }
  131. }
  132. // shop
  133. &--shop {
  134. &::before {
  135. background: url('https://img12.360buyimg.com/imagetools/jfs/t1/184083/34/6101/38841/60b065caEaaf7c5d0/eec4cd260f46d9f0.png') no-repeat
  136. center/100%;
  137. }
  138. .sub-desc {
  139. background: #ffd01f;
  140. span {
  141. color: #000;
  142. }
  143. }
  144. }
  145. // lbs
  146. &--lbs {
  147. &::before {
  148. background: url('https://img10.360buyimg.com/imagetools/jfs/t1/129094/23/18726/38672/60b065caEb849e8cb/da761e3ebae5bc84.png') no-repeat
  149. center/100%;
  150. }
  151. .sub-desc {
  152. background: #ffd01f;
  153. span {
  154. color: #000;
  155. }
  156. }
  157. }
  158. // 未读
  159. &--unread {
  160. box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
  161. animation: show 2s infinite;
  162. }
  163. &--special {
  164. background-size: cover;
  165. background-repeat: no-repeat;
  166. &:before {
  167. display: none;
  168. }
  169. .cube-item-box {
  170. display: none;
  171. }
  172. .sub-desc {
  173. display: none;
  174. }
  175. }
  176. @keyframes show {
  177. 0% {
  178. box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
  179. }
  180. 50% {
  181. box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
  182. }
  183. 100% {
  184. box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
  185. }
  186. }
  187. @at-root .cube-wrapper--inited {
  188. .cube-col {
  189. .cube-item {
  190. .sub-image {
  191. animation: cube-image 0.2s cubic-bezier(0.33, 0, 0.67, 1) 1s forwards;
  192. }
  193. }
  194. }
  195. }
  196. @keyframes cube-image {
  197. 0% {
  198. transform: translateY(13px);
  199. }
  200. 66% {
  201. transform: translateY(-5px);
  202. }
  203. 100% {
  204. transform: translateY(0);
  205. }
  206. }
  207. }
  208. $module_name1: '.cube';
  209. #{$module_name1} {
  210. width: 100%;
  211. // position: absolute;
  212. z-index: 10;
  213. &-container {
  214. width: 100%;
  215. padding: 15px 0;
  216. box-sizing: border-box;
  217. height: 100%;
  218. overflow: hidden;
  219. }
  220. &-wrapper {
  221. width: 100%;
  222. white-space: nowrap;
  223. perspective: 500px;
  224. animation-play-state: paused;
  225. transition-property: all;
  226. transition-timing-function: cubic-bezier(0.39, 0.575, 0.565, 1);
  227. }
  228. &-col {
  229. display: inline-block;
  230. width: 25%;
  231. box-sizing: border-box;
  232. // padding: 0 4px;
  233. transition: inherit;
  234. &--anime:nth-child(5) {
  235. #{$module_name1}-item-wrap {
  236. animation: cube5 560ms cubic-bezier(0.33, 0, 0.67, 1) 1s both;
  237. }
  238. }
  239. @keyframes cube5 {
  240. 0% {
  241. animation-timing-function: cubic-bezier(0.33, 0, 0.67, 1);
  242. transform: translate3d(733px, 0, 0);
  243. }
  244. 57% {
  245. animation-timing-function: cubic-bezier(0.33, 0, 0.67, 1);
  246. transform: translate3d(-30px, 0, 0);
  247. }
  248. 58% {
  249. animation-timing-function: cubic-bezier(0.17, 0, 0.67, 1);
  250. transform: translate3d(-30px, 0, 0);
  251. }
  252. 100% {
  253. animation-timing-function: cubic-bezier(0.17, 0, 0.67, 1);
  254. transform: translate3d(0, 0, 0);
  255. }
  256. }
  257. &--anime:nth-child(6) {
  258. #{$module_name1}-item-wrap {
  259. animation: cube6 560ms cubic-bezier(0.33, 0, 0.83, 1) 1.08s both;
  260. }
  261. }
  262. @keyframes cube6 {
  263. 0% {
  264. animation-timing-function: cubic-bezier(0.33, 0, 0.83, 1);
  265. transform: translate3d(554px, 0, 0);
  266. }
  267. 57% {
  268. animation-timing-function: cubic-bezier(0.33, 0, 0.83, 1);
  269. transform: translate3d(-20px, 0, 0);
  270. }
  271. 58% {
  272. animation-timing-function: cubic-bezier(0.17, 0, 0.67, 1);
  273. transform: translate3d(-20px, 0, 0);
  274. }
  275. 100% {
  276. animation-timing-function: cubic-bezier(0.17, 0, 0.67, 1);
  277. transform: translate3d(0, 0, 0);
  278. }
  279. }
  280. &--anime:nth-child(7) {
  281. #{$module_name1}-item-wrap {
  282. animation: cube7 560ms cubic-bezier(0.33, 0, 0.83, 1) 1.16s both;
  283. }
  284. }
  285. @keyframes cube7 {
  286. 0% {
  287. animation-timing-function: cubic-bezier(0.33, 0, 0.83, 1);
  288. transform: translate3d(378px, 0, 0);
  289. }
  290. 57% {
  291. animation-timing-function: cubic-bezier(0.33, 0, 0.83, 1);
  292. transform: translate3d(-20px, 0, 0);
  293. }
  294. 58% {
  295. animation-timing-function: cubic-bezier(0.17, 0, 0.67, 1);
  296. transform: translate3d(-20px, 0, 0);
  297. }
  298. 100% {
  299. animation-timing-function: cubic-bezier(0.17, 0, 0.67, 1);
  300. transform: translate3d(0, 0, 0);
  301. }
  302. }
  303. &--anime:nth-child(8) {
  304. #{$module_name1}-item-wrap {
  305. animation: cube8 560ms cubic-bezier(0.33, 0, 0.83, 1) 1.28s both;
  306. }
  307. }
  308. @keyframes cube8 {
  309. 0% {
  310. animation-timing-function: cubic-bezier(0.33, 0, 0.83, 1);
  311. transform: translate3d(205px, 0, 0);
  312. }
  313. 57% {
  314. animation-timing-function: cubic-bezier(0.33, 0, 0.83, 1);
  315. transform: translate3d(-20px, 0, 0);
  316. }
  317. 58% {
  318. animation-timing-function: cubic-bezier(0.17, 0, 0.67, 1);
  319. transform: translate3d(-20px, 0, 0);
  320. }
  321. 100% {
  322. animation-timing-function: cubic-bezier(0.17, 0, 0.67, 1);
  323. transform: translate3d(0, 0, 0);
  324. }
  325. }
  326. }
  327. &-item-wrap {
  328. margin-bottom: 16px;
  329. }
  330. }