components.less 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850
  1. @title-top: #3181ff;
  2. @title-bg: #e0ecff;
  3. @body-bg: #2382ff;
  4. // 通用样式
  5. .my-province {
  6. position: relative;
  7. span {
  8. line-height: normal;
  9. color: #f03;
  10. font-size: 14px;
  11. margin-right: 5px;
  12. }
  13. i {
  14. margin-left: 5px;
  15. font-size: 12px;
  16. color: #e6e6e6;
  17. }
  18. div {
  19. display: none;
  20. width: 286px;
  21. position: absolute;
  22. top: 30px;
  23. z-index: 100;
  24. background-color: #fff;
  25. border: 1px solid #e6e6e6;
  26. padding: 10px;
  27. .icon-play {
  28. transform: rotate(-90deg);
  29. position: absolute;
  30. top: -10px;
  31. }
  32. ul {
  33. width: 100%;
  34. padding: 0;
  35. list-style: none;
  36. display: flex;
  37. justify-content: flex-start;
  38. align-items: center;
  39. flex-wrap: wrap;
  40. margin: 0;
  41. &>li:last-child{
  42. color:#f03;
  43. }
  44. li {
  45. padding: 5px;
  46. width: 60px;
  47. margin: 3px;
  48. box-sizing: border-box;
  49. &:hover {
  50. background-color: #f6f6f6;
  51. border: 5px;
  52. }
  53. }
  54. }
  55. }
  56. }
  57. // 标签默认样式
  58. textarea {
  59. resize: none;
  60. }
  61. // 移动端下拉菜单动画
  62. @keyframes nav {
  63. from {
  64. height: 0;
  65. }
  66. to {
  67. height: calc(~"100vh - 90px");
  68. }
  69. }
  70. @-webkit-keyframes nav
  71. /* Safari and Chrome */
  72. {
  73. from {
  74. height: 0;
  75. }
  76. to {
  77. height: calc(~"100vh - 90px");
  78. }
  79. }
  80. @-moz-keyframes nav
  81. /* Safari and Chrome */
  82. {
  83. from {
  84. height: 0;
  85. }
  86. to {
  87. height: calc(~"100vh - 90px");
  88. }
  89. }
  90. @keyframes navc {
  91. from {
  92. height: calc(~"100vh - 90px");
  93. }
  94. to {
  95. height: 0;
  96. }
  97. }
  98. @-webkit-keyframes navc
  99. /* Safari and Chrome */
  100. {
  101. from {
  102. height: calc(~"100vh - 90px");
  103. }
  104. to {
  105. height: 0;
  106. }
  107. }
  108. @-moz-keyframes navc
  109. /* Safari and Chrome */
  110. {
  111. from {
  112. height: calc(~"100vh - 90px");
  113. }
  114. to {
  115. height: 0;
  116. }
  117. }
  118. // js 操作添加
  119. .show {
  120. display: block !important;
  121. }
  122. .noshow {
  123. display: none !important;
  124. }
  125. body {
  126. height: 100vh;
  127. overflow-y: scroll;
  128. // 通用a标签
  129. a {
  130. text-decoration: none;
  131. color: #777;
  132. &:hover {
  133. color: @body-bg;
  134. text-decoration: none;
  135. }
  136. }
  137. &::-webkit-scrollbar {
  138. /*滚动条整体样式*/
  139. width: 5px;
  140. /*高宽分别对应横竖滚动条的尺寸*/
  141. height: 10px;
  142. }
  143. &::-webkit-scrollbar-thumb {
  144. /*滚动条里面小方块*/
  145. border-radius: 10px;
  146. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  147. background: #999;
  148. }
  149. // 2382ff
  150. &::-webkit-scrollbar-thumb:hover {
  151. background: @body-bg;
  152. }
  153. &::-webkit-scrollbar-track {
  154. /*滚动条里面轨道*/
  155. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  156. border-radius: 10px;
  157. background: #eee;
  158. }
  159. }
  160. // 头部
  161. .header {
  162. // 通用样式
  163. .my-province {
  164. margin-left: 5px;
  165. margin-top: 30px;
  166. @media screen and (max-width:768px) {
  167. & {
  168. display: none;
  169. }
  170. }
  171. }
  172. width: 100%;
  173. background-color: #fff;
  174. border-bottom: 1px solid #f1f1f1;
  175. background-color: #fff;
  176. position: fixed;
  177. z-index: 1;
  178. .ha-item {
  179. margin-top: 10px;
  180. height: 70px;
  181. .img {
  182. height: 100%;
  183. span {
  184. font-size: 30px;
  185. font-weight: bold;
  186. color: @body-bg;
  187. display: block;
  188. line-height: 70px;
  189. }
  190. img {
  191. height: 100%;
  192. }
  193. }
  194. .button {
  195. display: none;
  196. @media screen and (max-width:768px) {
  197. & {
  198. display: block;
  199. }
  200. }
  201. .button {
  202. color: @body-bg;
  203. padding: 10px;
  204. border: 2px solid @body-bg;
  205. margin-top: 13px;
  206. text-align: center;
  207. font-size: 20px;
  208. border-radius: 5px;
  209. }
  210. }
  211. .app {
  212. height: 100%;
  213. text-align: center;
  214. @media screen and (max-width:768px) {
  215. & {
  216. display: none;
  217. }
  218. }
  219. a {
  220. text-decoration: none;
  221. color: @body-bg;
  222. img {
  223. width: 50px;
  224. }
  225. }
  226. }
  227. }
  228. .hb-item {
  229. // 大屏下拉菜单
  230. .nav {
  231. display: flex;
  232. justify-content: flex-start;
  233. align-content: center;
  234. @media screen and (max-width:768px) {
  235. & {
  236. display: none;
  237. }
  238. }
  239. &>.nav-item>a.active {
  240. color: @body-bg;
  241. }
  242. .nav-item {
  243. padding: 0 20px;
  244. a {
  245. color: #777;
  246. font-weight: bold;
  247. text-decoration: none;
  248. line-height: 40px;
  249. display: table-cell;
  250. vertical-align: bottom;
  251. font-size: 18px;
  252. i {
  253. margin-left: 5px;
  254. font-size: 12px;
  255. color: #e6e6e6;
  256. }
  257. &:hover {
  258. color: @body-bg;
  259. }
  260. }
  261. .nav-ul {
  262. display: none;
  263. overflow: hidden;
  264. padding: 0;
  265. position: absolute;
  266. z-index: 1;
  267. background-color: #fff;
  268. overflow: auto !important;
  269. .nav-li {
  270. width: 100px;
  271. padding: 10px;
  272. list-style: none;
  273. &:hover {
  274. background-color: @body-bg;
  275. a {
  276. color: #fff;
  277. }
  278. }
  279. a {
  280. color: #777;
  281. line-height: 15px;
  282. font-size: small;
  283. }
  284. }
  285. }
  286. }
  287. }
  288. }
  289. }
  290. // 小屏幕下拉菜单
  291. // 移动端下拉菜单
  292. #nav-sm {
  293. position: fixed;
  294. z-index: 99;
  295. width: 100vw;
  296. overflow-y: scroll;
  297. box-sizing: border-box;
  298. background-color: #fff;
  299. margin-top: 80px;
  300. padding: 0 20px;
  301. // 通用样式
  302. .my-province{
  303. padding: 20px 0;
  304. div{
  305. top: 50px;
  306. }
  307. }
  308. @media screen and (max-width:768px) {
  309. & {
  310. border-top: 1px solid #eee;
  311. }
  312. }
  313. &::-webkit-scrollbar {
  314. height: 0;
  315. }
  316. &>ul>li>a.active {
  317. color: @body-bg;
  318. }
  319. ul {
  320. padding-inline-start: 0;
  321. li {
  322. list-style-type: none;
  323. a {
  324. font-weight: bold;
  325. font-size: 20px;
  326. font-size: 16px;
  327. line-height: 40px;
  328. color: #555;
  329. text-decoration: none;
  330. &:hover {
  331. color: @body-bg;
  332. }
  333. }
  334. .nav-sm-ul {
  335. display: flex;
  336. justify-content: flex-start;
  337. align-items: center;
  338. flex-wrap: wrap;
  339. padding: 0;
  340. .nav-sm-li {
  341. padding: 0 10px;
  342. a {
  343. font-size: 14px;
  344. font-weight: normal;
  345. }
  346. }
  347. }
  348. }
  349. }
  350. }
  351. .nav-sm-noheight {
  352. height: 0px;
  353. }
  354. .nav-sm-show {
  355. height: calc(~"100vh - 80px");
  356. animation: nav 1s;
  357. -webkit-animation: nav 1s normal;
  358. -moz-animation: nav 1s;
  359. }
  360. .nav-sm-noshow {
  361. height: 0px;
  362. animation: navc 1s;
  363. -webkit-animation: navc 1s normal;
  364. -moz-animation: navc 1s;
  365. }
  366. // 主题默认样式
  367. .body {
  368. background-color: #fff;
  369. max-width: 1200px;
  370. min-height: 700px;
  371. overflow: hidden;
  372. position: relative;
  373. padding: 10px 15px 15px;
  374. margin: 141px 20px 20px;
  375. // 自定义样式类
  376. // 加载
  377. .my-loading {
  378. text-align: center;
  379. color: #999;
  380. display: none;
  381. }
  382. // 点击阅读
  383. .my-read {
  384. margin-top: 20px;
  385. text-align: center;
  386. .good {
  387. border-radius: 5px;
  388. border: 1px solid #e6e6e6;
  389. display: inline-block;
  390. padding: 5px 30px;
  391. margin-bottom: 10px;
  392. }
  393. }
  394. // 相关文章
  395. .my-articles {
  396. ul {
  397. width: 100%;
  398. border-top: 1px solid #e6e6e6;
  399. padding: 10px 20px;
  400. list-style: square;
  401. color: #777;
  402. overflow: hidden;
  403. li {
  404. overflow: hidden;
  405. text-overflow: ellipsis;
  406. white-space: nowrap;
  407. width: 100%;
  408. padding: 5px 0px;
  409. }
  410. }
  411. }
  412. // 评论区
  413. .my-comment {
  414. .h5 {
  415. display: flex;
  416. justify-content: space-between;
  417. align-content: center;
  418. }
  419. .remind {
  420. text-align: center;
  421. background-color: #e6e6e6;
  422. padding: 5px;
  423. border-radius: 5px;
  424. margin: 10px 0px;
  425. }
  426. .comment {
  427. border-top: 1px solid #e6e6e6;
  428. padding-top: 10px;
  429. .nocomment,
  430. .loading,
  431. .nodata {
  432. display: none;
  433. text-align: center;
  434. margin: 10px;
  435. }
  436. .nocomment {
  437. display: block;
  438. padding-bottom: 10px;
  439. &:hover {
  440. color: @body-bg;
  441. }
  442. }
  443. .user {
  444. width: 100%;
  445. padding: 20px 0;
  446. border-bottom: 1px solid #e6e6e6;
  447. display: grid;
  448. grid-template-columns: 10% 90%;
  449. .u-img {
  450. width: 100%;
  451. text-align: center;
  452. .img {
  453. width: 100%;
  454. max-width: 64px;
  455. }
  456. }
  457. .u-content {
  458. margin-left: 10px;
  459. text-align: justify;
  460. .u-name {
  461. font-size: 16px;
  462. }
  463. .u-detail {
  464. padding: 5px 0px;
  465. }
  466. .u-flex {
  467. display: flex;
  468. justify-content: space-between;
  469. align-items: center;
  470. }
  471. }
  472. }
  473. }
  474. }
  475. // 横向菜单
  476. .my-nav {
  477. border-bottom: 1px solid #e6e6e6;
  478. &::after {
  479. display: block;
  480. content: '';
  481. clear: both;
  482. }
  483. ul {
  484. list-style: none;
  485. padding: 0;
  486. li {
  487. float: left;
  488. padding: 5px;
  489. color: #777;
  490. }
  491. .active {
  492. color: black;
  493. border-bottom: 3px solid @body-bg;
  494. font-weight: bold;
  495. }
  496. }
  497. }
  498. // 上拉刷新 列表
  499. .my-list {
  500. .list-item {
  501. text-decoration: none;
  502. color: black;
  503. display: flex;
  504. justify-content: flex-start;
  505. align-items: start;
  506. padding-bottom: 10px;
  507. margin-bottom: 10px;
  508. border-bottom: 1px solid #e6e6e6;
  509. &:hover {
  510. color: #2382ff;
  511. }
  512. .item-img {
  513. flex: 1;
  514. padding: 0 20px;
  515. @media screen and (max-width: 768px) {
  516. & {
  517. padding: 0 10px;
  518. }
  519. }
  520. img {
  521. width: 100%;
  522. border-radius: 5px;
  523. &:hover {
  524. transform: scale(1.1);
  525. }
  526. }
  527. }
  528. .item-detail {
  529. flex: 4;
  530. height: 100%;
  531. position: relative;
  532. overflow: hidden;
  533. @media screen and (max-width: 768px) {
  534. & {
  535. flex: 2;
  536. }
  537. }
  538. .title {
  539. font-weight: 400;
  540. overflow: hidden;
  541. text-overflow: ellipsis;
  542. white-space: nowrap;
  543. @media screen and (max-width: 768px) {
  544. & {
  545. white-space: normal;
  546. display: -webkit-box;
  547. -webkit-box-orient: vertical;
  548. -webkit-line-clamp: 2;
  549. }
  550. }
  551. }
  552. .time {
  553. font-size: 12px;
  554. color: #777;
  555. margin-top: 5px;
  556. span {
  557. margin-left: 5px;
  558. }
  559. }
  560. }
  561. }
  562. }
  563. @media screen and (max-width:768px) {
  564. & {
  565. padding: 0px;
  566. border-radius: 10px 10px 0 0;
  567. margin: 100px 20px 20px;
  568. }
  569. }
  570. }
  571. .footer {
  572. width: 100%;
  573. box-sizing: border-box;
  574. overflow: hidden;
  575. background-color: #fff;
  576. border-top: 1px solid #f1f1f1;
  577. text-align: center;
  578. color: #777;
  579. p {
  580. margin: 0;
  581. padding: 20px 0px 0px;
  582. }
  583. &>p:last-child {
  584. padding-bottom: 50px;
  585. }
  586. }
  587. // 顶部
  588. #top {
  589. position: fixed;
  590. bottom: 80px;
  591. right: 20px;
  592. padding: 20px;
  593. color: #fff;
  594. background-color: rgba(98, 96, 96, 0.3);
  595. border-radius: 10px;
  596. }
  597. // 分享功能
  598. #share {
  599. position: fixed;
  600. top: 60vh;
  601. right: 0px;
  602. box-sizing: border-box;
  603. display: flex;
  604. @media screen and (max-width:768px) {
  605. & {
  606. display: none;
  607. }
  608. }
  609. div {
  610. height: 132px;
  611. box-sizing: border-box;
  612. background-color: @body-bg;
  613. color: #fff;
  614. font-size: 15px;
  615. width: 30px;
  616. letter-spacing: 10px;
  617. text-align: center;
  618. line-height: 30px;
  619. border-radius: 5px 0 0 5px;
  620. writing-mode: vertical-lr;
  621. /*从左向右 从右向左是 writing-mode: vertical-rl;*/
  622. writing-mode: tb-lr;
  623. /*IE浏览器的从左向右 从右向左是 writing-mode: tb-rl;*/
  624. }
  625. ul {
  626. width: 0px;
  627. height: 132px;
  628. border: 1px solid #aaa;
  629. box-sizing: border-box;
  630. border-right: none;
  631. list-style: none;
  632. padding: 0;
  633. box-sizing: border-box;
  634. &>li:first-child {
  635. background-color: #c6c6c6;
  636. line-height: 26px;
  637. font-weight: bold;
  638. }
  639. li {
  640. padding: 5px 10px;
  641. width: 100px;
  642. vertical-align: middle;
  643. img {
  644. width: 20px;
  645. vertical-align: middle;
  646. margin-right: 5px;
  647. }
  648. &:hover:not(ul>li:first-child) {
  649. background-color: #e6e6e6;
  650. }
  651. }
  652. }
  653. // width: 100px;height: 100px;
  654. }
  655. // 交互板
  656. #toast {
  657. display: none;
  658. position: fixed;
  659. top: 0;
  660. left: 0;
  661. z-index: 100;
  662. width: 100vw;
  663. height: 100vh;
  664. background-color: rgba(29, 27, 27, 0.5);
  665. text-align: center;
  666. &>div {
  667. background-color: #fff;
  668. position: absolute;
  669. padding: 5px;
  670. border-radius: 5px;
  671. width: 200px;
  672. // box-shadow: 0px 0px 5px #fff;
  673. left: calc(~"50vw - 100px");
  674. top: 30vh;
  675. }
  676. }
  677. // 下载app
  678. #download {
  679. position: fixed;
  680. bottom: 0px;
  681. width: 100vw;
  682. display: none;
  683. justify-content: space-between;
  684. align-items: center;
  685. background-color: rgba(1, 1, 1, 0.5);
  686. padding: 5px 10px;
  687. color: #fff;
  688. .left {
  689. width: 200px;
  690. &::before {
  691. display: block;
  692. content: '';
  693. clear: both;
  694. }
  695. img,
  696. div {
  697. float: left;
  698. }
  699. img {
  700. width: 50px;
  701. }
  702. div {
  703. margin-left: 10px;
  704. }
  705. .row1 {
  706. margin-bottom: 10px;
  707. }
  708. }
  709. @media screen and (max-width:768px) {
  710. display: flex;
  711. }
  712. }