home.css 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. @media screen and (min-width: 100px) and (max-width: 768px) {
  2. /*==============首页主题====================*/
  3. .card {
  4. width: calc(100% - 30px);
  5. margin: auto;
  6. padding: 0 15px;
  7. text-align: left;
  8. }
  9. .card .card-header {
  10. margin: 20px 0 0 5px;
  11. display: flex;
  12. line-height: 32px;
  13. }
  14. .card .card-header .card-title {
  15. text-align: left;
  16. display: inline-block;
  17. padding: 0;
  18. width: auto;
  19. margin: 0;
  20. font-size: 24px;
  21. }
  22. .card .card-header .cart-other {
  23. flex: 1;
  24. margin: 0;
  25. width: auto;
  26. text-align: right;
  27. vertical-align: middle;
  28. align-items: center;
  29. font-size: 12px;
  30. }
  31. .card .card-header .cart-other a {
  32. cursor: pointer;
  33. padding: 5px 15px;
  34. color: #666666;
  35. font-size: 16px;
  36. /*color: white;*/
  37. /*background: #1475fa;*/
  38. }
  39. .card .card-header .cart-other a:after {
  40. content: " >";
  41. }
  42. .card .card-des {
  43. margin: 8px 0 0 5px;
  44. color: #666666;
  45. font-size: 14px;
  46. }
  47. .card .card-list {
  48. display: flex;
  49. align-items: center; /* 确保文本和图片顶部对齐 */
  50. justify-content: space-between;
  51. flex-wrap: wrap;
  52. padding: 5px 0 0 0;
  53. margin-top: 15px;
  54. overflow: hidden;
  55. }
  56. .card .card-list .goods-info {
  57. width: calc(33.3333% - 20px); /* 三个卡片平分宽度,留出间隙 */
  58. margin-right: 10px;
  59. margin-bottom: 20px;
  60. text-align: center;
  61. }
  62. /* 隐藏 .card-list 中第六个元素之后的所有元素 */
  63. .card .card-list .goods-info:nth-child(n+7) {
  64. display: none;
  65. }
  66. /* 保证最后一列没有右边距 */
  67. .card .card-list div:nth-child(3n) {
  68. margin-right: 0;
  69. }
  70. /* 统一图片容器的高度 */
  71. .goods-info .goods-img {
  72. /*width: 100%;*/
  73. width: calc(33.3333VW - 20px);
  74. height: calc(44.4444VW - 27px); /* 设定一个固定的高度 */
  75. overflow: hidden; /* 超出部分隐藏 */
  76. }
  77. /* 图片自适应并裁剪 */
  78. .goods-info .goods-img img {
  79. width: 100%;
  80. height: 100%;
  81. object-fit: cover; /* 保持图片裁剪以适应容器 */
  82. }
  83. .card .card-show {
  84. text-align: center;
  85. width: 100%;
  86. cursor: pointer;
  87. color: #646cff;
  88. }
  89. /*topic list item*/
  90. .goods-info {
  91. display: block;
  92. margin-bottom: 30px;
  93. }
  94. .goods-info:hover {
  95. cursor: pointer;
  96. }
  97. .goods-info .goods-name {
  98. font-size: 12px;
  99. text-overflow: ellipsis;
  100. overflow: hidden;
  101. -webkit-line-clamp: 2;
  102. display: -webkit-box;
  103. -webkit-box-orient: vertical;
  104. }
  105. .goods-price {
  106. display: none;
  107. }
  108. .goods-info .goods-price {
  109. display: none;
  110. font-size: 0;
  111. color: transparent;
  112. }
  113. .goods-info .goods-price-od {
  114. display: none;
  115. }
  116. .goods-info .goods-original-price {
  117. display: none;
  118. }
  119. .goods-info br {
  120. display: none;
  121. }
  122. .goods-info .goods-discount-percentage {
  123. display: none;
  124. }
  125. .card-show {
  126. display: none;
  127. }
  128. }
  129. @media screen and (min-width: 768px) {
  130. .home-suspension {
  131. left: 0;
  132. right: 0;
  133. top: 0;
  134. bottom: 0;
  135. position: absolute;
  136. z-index: 10;
  137. width: 0;
  138. height: 0;
  139. }
  140. .bottom-advertisement {
  141. position: fixed;
  142. bottom: 0;
  143. left: 0;
  144. width: 100%;
  145. height: 130px;
  146. background: #8a65d9;
  147. }
  148. .advertisement-content {
  149. width: 1180px;
  150. height: 130px;
  151. margin: auto auto;
  152. }
  153. .right-handler {
  154. position: fixed;
  155. bottom: 50px;
  156. right: 50px;
  157. width: 75px;
  158. background-color: white;
  159. display: flex;
  160. flex-direction: column;
  161. color: black;
  162. z-index: 1;
  163. border-radius: 8px;
  164. box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  165. }
  166. .handler-btn .tooltip {
  167. display: none;
  168. }
  169. .handler-btn .handler-btn:hover .tooltip {
  170. display: block;
  171. }
  172. .handler-item-top {
  173. border-radius: 8px 8px 0 0;
  174. }
  175. .handler-item-bottom {
  176. border-radius: 0 0 8px 8px;
  177. }
  178. .handler-item {
  179. transition: background-color 0.3s ease-in-out;
  180. }
  181. .item-icon-top {
  182. padding: 10px 0;
  183. color: #666666;
  184. transform: rotateZ(180deg);
  185. display: flex;
  186. justify-content: center;
  187. align-items: center;
  188. }
  189. .item-icon-top div {
  190. width: 25px;
  191. height: 25px;
  192. }
  193. .right-handler div:hover {
  194. background-color: #1475fa;
  195. }
  196. .item-icon-top:hover {
  197. }
  198. .item-icon-top:hover span {
  199. color: white;
  200. }
  201. .item-icon-top:hover .item-icon {
  202. color: white;
  203. }
  204. .item-icon-top:hover .item-icon-top {
  205. color: white;
  206. }
  207. .handler-item-content {
  208. margin: 0 auto;
  209. width: 52px;
  210. height: 74px;
  211. justify-content: center;
  212. align-items: center;
  213. border-bottom: #F1F1F1 1px solid;
  214. display: flex;
  215. flex-direction: column;
  216. font-size: 13px;
  217. }
  218. .item-icon {
  219. color: #666666;
  220. }
  221. span {
  222. color: #333333;
  223. }
  224. .handler-item-content:hover {
  225. cursor: pointer;
  226. user-select: none;
  227. color: white;
  228. background-color: #1475fa;
  229. }
  230. .handler-item-content:hover span {
  231. color: white;
  232. }
  233. .handler-item-content:hover .item-icon {
  234. color: white;
  235. }
  236. .handler-item-content:hover .item-icon-top {
  237. color: white;
  238. }
  239. .tooltip {
  240. display: block;
  241. position: absolute;
  242. padding: 10px;
  243. border-radius: 8px;
  244. box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
  245. cursor: auto;
  246. color: #333333;
  247. }
  248. .tooltip-arrow {
  249. position: absolute;
  250. right: -9.5px;
  251. top: calc(50% - 10px);
  252. width: 10px;
  253. height: 20px;
  254. -webkit-clip-path: polygon(100% 50%, 0 0, 0 100%);
  255. clip-path: polygon(100% 50%, 0 0, 0 100%);
  256. }
  257. .slot-image {
  258. max-width: 80px;
  259. max-height: 80px;
  260. }
  261. .handler-to-top {
  262. cursor: pointer;
  263. }
  264. .gift-pack {
  265. width: 1170px;
  266. text-align: left;
  267. font-size: 12px;
  268. margin: 60px auto 50px auto;
  269. line-height: 18px;
  270. padding-bottom: 20px;
  271. border-bottom: 1px solid rgb(217, 217, 217);
  272. }
  273. .gift-pack-title {
  274. font-size: 24px;
  275. margin-bottom: 15px;
  276. }
  277. .gift-pack-content {
  278. display: grid;
  279. grid-template-columns: repeat(3, 1fr);
  280. grid-gap: 20px;
  281. }
  282. .content-item {
  283. cursor: pointer;
  284. }
  285. .content-item-img {
  286. max-width: 370px;
  287. max-height: 165px;
  288. overflow: hidden;
  289. }
  290. .content-item-img img {
  291. border-radius: 10px;
  292. width: 370px;
  293. height: 165px;
  294. }
  295. .content-item-title {
  296. font-weight: bold;
  297. font-size: 14px;
  298. }
  299. .content-item-remark {
  300. color: #999;
  301. }
  302. .content-item-price {
  303. display: flex;
  304. vertical-align: middle;
  305. margin: 10px 0;
  306. }
  307. .content-item-price div {
  308. margin-right: 10px;
  309. }
  310. .price-original {
  311. text-decoration: line-through;
  312. color: #888888;
  313. }
  314. .price-target {
  315. vertical-align: middle;
  316. padding: 0 3px;
  317. margin: 0 0 0 4px;
  318. background: rgb(223, 30, 28);
  319. color: white;
  320. font-weight: bolder;
  321. }
  322. .price-target span {
  323. color: white;
  324. }
  325. .price-now {
  326. font-family: BlinkMacSystemFont;
  327. font-size: 16px;
  328. }
  329. /*==============首页主题====================*/
  330. .card {
  331. width: 1180px;
  332. margin: auto;
  333. padding: 0;
  334. /* border: 1px solid #ccc; */
  335. text-align: left;
  336. }
  337. .card .card-header {
  338. margin: 20px 0 0 5px;
  339. display: flex;
  340. line-height: 32px;
  341. }
  342. .card .card-header .card-title {
  343. text-align: left;
  344. display: inline-block;
  345. padding: 0;
  346. width: auto;
  347. margin: 0;
  348. font-weight: bold;
  349. font-size: 24px;
  350. }
  351. .card .card-header .cart-other {
  352. flex: 1;
  353. margin: 0;
  354. width: auto;
  355. text-align: right;
  356. vertical-align: middle;
  357. align-items: center;
  358. font-size: 12px;
  359. }
  360. .card .card-header .cart-other a {
  361. cursor: pointer;
  362. padding: 5px 15px;
  363. color: white;
  364. background: #1475fa;
  365. }
  366. .card .card-des {
  367. margin: 8px 0 0 5px;
  368. color: #666666;
  369. font-size: 14px;
  370. }
  371. .card .card-list {
  372. display: flex;
  373. align-items: flex-start;
  374. flex-wrap: wrap;
  375. padding: 5px 0 0 0;
  376. margin-top: 15px;
  377. overflow: hidden;
  378. /* overflow-y: auto; */
  379. }
  380. .card .card-list div {
  381. margin-right: 30px;
  382. display: inline-block;
  383. }
  384. .card .card-list div:nth-child(6n) {
  385. margin-right: 0;
  386. }
  387. .card .card-list div:nth-child(6n+1) {
  388. margin-left: 5px;
  389. }
  390. .card .card-show {
  391. text-align: center;
  392. width: 100%;
  393. cursor: pointer;
  394. color: #646cff;
  395. }
  396. /*topic list item*/
  397. .goods-info {
  398. display: block;
  399. max-width: 170px;
  400. margin-bottom: 30px;
  401. }
  402. .goods-info:hover {
  403. cursor: pointer;
  404. }
  405. .goods-info .goods-img {
  406. width: auto;
  407. padding: 0;
  408. margin: 0 0 12px 0;
  409. overflow: hidden;
  410. display: flex;
  411. }
  412. .goods-info .goods-img img {
  413. height: 228px;
  414. width: 170px;
  415. }
  416. .goods-info .goods-img img:hover {
  417. z-index: 0;
  418. }
  419. .goods-info .goods-img:hover::after {
  420. opacity: 1;
  421. box-shadow: rgba(100, 100, 100, 0.3) 0 0 8px 3px;
  422. }
  423. .goods-info .goods-img::after {
  424. content: "";
  425. position: absolute;
  426. z-index: 9;
  427. width: 170px;
  428. height: 228px;
  429. box-sizing: border-box;
  430. background: rgba(229, 229, 229, 0.2);
  431. transform: translateX(-170px);
  432. animation: 0.2s ease 0s 1 normal none running enlarge;
  433. opacity: 0;
  434. transition: all 0.3s ease 0s;
  435. }
  436. .goods-info .goods-name {
  437. font-size: 12px;
  438. text-overflow: ellipsis;
  439. overflow: hidden;
  440. -webkit-line-clamp: 2;
  441. }
  442. .goods-info .goods-price {
  443. font-size: 16px;
  444. margin: 5px 0;
  445. font-weight: bold;
  446. }
  447. .goods-info .goods-price::before {
  448. content: "¥";
  449. }
  450. .goods-info .goods-original-price {
  451. display: inline-block;
  452. text-decoration: line-through;
  453. font-size: 12px;
  454. margin: 0;
  455. padding: 0;
  456. }
  457. .goods-info .goods-discount-percentage {
  458. display: inline-block;
  459. font-size: 12px;
  460. margin: 0 0 0 10px;
  461. padding: 0 5px;
  462. color: white;
  463. background: rgb(223, 30, 28);
  464. }
  465. .goods-info .goods-discount-percentage::before {
  466. content: "-";
  467. }
  468. .goods-info .goods-discount-percentage::after {
  469. content: "%";
  470. }
  471. }