app.base.scss 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. // 全局css基础样式
  2. .card-shadow {
  3. box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.08);
  4. }
  5. .bg-white {
  6. background-color: #fff;
  7. }
  8. .load-text {
  9. padding: 0 0 20rpx 0;
  10. text-align: center;
  11. color: #999;
  12. font-size: 24rpx;
  13. }
  14. .e-fixed {
  15. position: fixed;
  16. left: 0;
  17. /* #ifndef H5 */
  18. top: 0;
  19. /* #endif */
  20. /* #ifdef H5 */
  21. top: 88rpx;
  22. /* #endif */
  23. right: 0;
  24. z-index: 6;
  25. }
  26. .e-loading-icon {
  27. animation: eLoading 0.8s linear infinite;
  28. }
  29. @keyframes eLoading {
  30. 0% {
  31. transform: rotateZ(0deg);
  32. }
  33. 100% {
  34. transform: rotateZ(360deg);
  35. }
  36. }
  37. // 自定义广告
  38. .ad-card {
  39. position: relative;
  40. box-sizing: border-box;
  41. padding: 24rpx;
  42. box-shadow: 0rpx 4rpx 24rpx rgba(0, 0, 0, 0.03);
  43. background-color: #ffffff;
  44. border-radius: 12rpx;
  45. &.is-lr {
  46. display: flex;
  47. .ad-card_tip {
  48. top: initial;
  49. left: 288rpx;
  50. bottom: 24rpx;
  51. // right: 160rpx;
  52. padding: 4rpx 20rpx;
  53. background-color: transparent;
  54. border: 2rpx solid #607d8b;
  55. color: #607d8b;
  56. }
  57. .ad-card_cover {
  58. width: 240rpx;
  59. height: 180rpx;
  60. animation: adLinkAni 1s ease-in-out infinite;
  61. }
  62. .ad-card_info {
  63. width: 0;
  64. flex-grow: 1;
  65. padding-left: 24rpx;
  66. &-title {
  67. margin-top: 0;
  68. width: 100%;
  69. font-size: 30rpx;
  70. }
  71. &-link {
  72. top: initial;
  73. // right: 150rpx;
  74. bottom: 0;
  75. transform: scale(1);
  76. }
  77. }
  78. }
  79. &_tip {
  80. position: absolute;
  81. left: 36rpx;
  82. top: 36rpx;
  83. display: inline-flex;
  84. box-sizing: border-box;
  85. border-radius: 6rpx;
  86. padding: 4rpx 10rpx;
  87. background-color: rgba(0, 0, 0, 0.3);
  88. color: #ffffff;
  89. font-size: 24rpx;
  90. z-index: 2;
  91. }
  92. &_cover {
  93. width: 100%;
  94. height: 300rpx;
  95. border-radius: 6rpx;
  96. }
  97. &_info {
  98. display: flex;
  99. flex-direction: column;
  100. box-sizing: border-box;
  101. position: relative;
  102. &-title {
  103. width: calc(100% - 120rpx);
  104. font-size: 28rpx;
  105. font-weight: bold;
  106. margin-top: 8rpx;
  107. white-space: nowrap;
  108. overflow: hidden;
  109. text-overflow: ellipsis;
  110. color: #333;
  111. }
  112. &-desc {
  113. margin-top: 6rpx;
  114. font-size: 24rpx;
  115. color: #616161;
  116. line-height: 1.8;
  117. overflow: hidden;
  118. text-overflow: ellipsis;
  119. display: -webkit-box;
  120. -webkit-box-orient: vertical;
  121. -webkit-line-clamp: 2;
  122. }
  123. &-link {
  124. position: absolute;
  125. right: 0;
  126. top: 6rpx;
  127. display: inline-flex;
  128. box-sizing: border-box;
  129. border-radius: 6rpx;
  130. padding: 4rpx 10rpx;
  131. border: 2rpx solid #03a9f4;
  132. color: #03a9f4;
  133. font-size: 24rpx;
  134. transform: scale(0.93);
  135. // animation: adLinkAni 0.8s ease-in-out infinite;
  136. }
  137. }
  138. }
  139. @keyframes adLinkAni {
  140. 0% {
  141. transform: scale(1);
  142. }
  143. 50% {
  144. transform: scale(1.02);
  145. }
  146. 100% {
  147. transform: scale(1);
  148. }
  149. }
  150. /* 文本省略样式 开始 */
  151. .text-sub-one {
  152. overflow: hidden;
  153. text-overflow: ellipsis;
  154. white-space: nowrap;
  155. }
  156. /* 多行文本省略 */
  157. @for $i from 2 through 30 {
  158. .text-sub-more-#{$i} {
  159. display: -webkit-box;
  160. -webkit-box-orient: vertical;
  161. -webkit-line-clamp: $i;
  162. overflow: hidden;
  163. }
  164. }
  165. /* 文本省略样式 结束 */
  166. // 定义尺寸变量(单位:rpx)
  167. $spacing-sizes: (
  168. 0: 0,
  169. 2: 4rpx,
  170. 4: 8rpx,
  171. 8: 16rpx,
  172. 12: 24rpx,
  173. 24: 48rpx,
  174. 48: 96rpx
  175. );
  176. // 内边距类
  177. @each $name, $size in $spacing-sizes {
  178. // 全方向内边距:p-{size}
  179. .p-#{$name} {
  180. padding: $size !important;
  181. }
  182. // 水平方向内边距:px-{size}
  183. .px-#{$name} {
  184. padding-left: $size !important;
  185. padding-right: $size !important;
  186. }
  187. // 垂直方向内边距:py-{size}
  188. .py-#{$name} {
  189. padding-top: $size !important;
  190. padding-bottom: $size !important;
  191. }
  192. // 上内边距:pt-{size}
  193. .pt-#{$name} {
  194. padding-top: $size !important;
  195. }
  196. // 右内边距:pr-{size}
  197. .pr-#{$name} {
  198. padding-right: $size !important;
  199. }
  200. // 下内边距:pb-{size}
  201. .pb-#{$name} {
  202. padding-bottom: $size !important;
  203. }
  204. // 左内边距:pl-{size}
  205. .pl-#{$name} {
  206. padding-left: $size !important;
  207. }
  208. }
  209. //外边距工具类
  210. @each $name, $size in $spacing-sizes {
  211. // 全方向外边距:m-{size}
  212. .m-#{$name} {
  213. margin: $size !important;
  214. }
  215. // 水平方向外边距:mx-{size}
  216. .mx-#{$name} {
  217. margin-left: $size !important;
  218. margin-right: $size !important;
  219. }
  220. // 垂直方向外边距:my-{size}
  221. .my-#{$name} {
  222. margin-top: $size !important;
  223. margin-bottom: $size !important;
  224. }
  225. // 上外边距:mt-{size}
  226. .mt-#{$name} {
  227. margin-top: $size !important;
  228. }
  229. // 右外边距:mr-{size}
  230. .mr-#{$name} {
  231. margin-right: $size !important;
  232. }
  233. // 下外边距:mb-{size}
  234. .mb-#{$name} {
  235. margin-bottom: $size !important;
  236. }
  237. // 左外边距:ml-{size}
  238. .ml-#{$name} {
  239. margin-left: $size !important;
  240. }
  241. }
  242. // gap 类
  243. @each $name, $size in $spacing-sizes {
  244. // 全方向gap:gap-{size}
  245. .gap-#{$name} {
  246. gap: $size !important;
  247. }
  248. // 水平方向gap:gap-x-{size}
  249. .gap-x-#{$name} {
  250. column-gap: $size !important;
  251. }
  252. // 垂直方向gap:gap-y-{size}
  253. .gap-y-#{$name} {
  254. row-gap: $size !important;
  255. }
  256. }
  257. .w-full {
  258. width: 100%;
  259. }
  260. .h-full {
  261. height: 100%;
  262. }
  263. .flex {
  264. display: flex;
  265. }
  266. .flex-col {
  267. flex-direction: column;
  268. }
  269. .flex-1 {
  270. flex: 1;
  271. }
  272. .flex-shrink-0 {
  273. flex-shrink: 0;
  274. }
  275. .items-center {
  276. align-items: center;
  277. }
  278. .items-start {
  279. align-items: flex-start;
  280. }
  281. .items-end {
  282. align-items: flex-end;
  283. }
  284. .justify-between {
  285. justify-content: space-between;
  286. }
  287. .justify-around {
  288. justify-content: space-around;
  289. }
  290. .justify-end {
  291. justify-content: flex-end;
  292. }
  293. .justify-start {
  294. justify-content: flex-start;
  295. }
  296. .justify-center {
  297. justify-content: center;
  298. }