components.less 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859
  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. position: relative;
  215. @media screen and (max-width:768px) {
  216. & {
  217. display: none;
  218. }
  219. }
  220. a {
  221. text-decoration: none;
  222. color: @body-bg;
  223. img {
  224. width: 50px;
  225. }
  226. }
  227. div{
  228. position: absolute;
  229. right: 0px;
  230. }
  231. }
  232. }
  233. .hb-item {
  234. // 大屏下拉菜单
  235. .nav {
  236. display: flex;
  237. justify-content: flex-start;
  238. align-content: center;
  239. @media screen and (max-width:768px) {
  240. & {
  241. display: none;
  242. }
  243. }
  244. &>.nav-item>a.active {
  245. color: @body-bg;
  246. }
  247. .nav-item {
  248. padding: 0 20px;
  249. a {
  250. color: #777;
  251. font-weight: bold;
  252. text-decoration: none;
  253. line-height: 40px;
  254. display: table-cell;
  255. vertical-align: bottom;
  256. font-size: 18px;
  257. i {
  258. margin-left: 5px;
  259. font-size: 12px;
  260. color: #e6e6e6;
  261. }
  262. &:hover {
  263. color: @body-bg;
  264. }
  265. }
  266. .nav-ul {
  267. display: none;
  268. overflow: hidden;
  269. padding: 0;
  270. position: absolute;
  271. z-index: 1;
  272. background-color: #fff;
  273. overflow: auto !important;
  274. .nav-li {
  275. width: 100px;
  276. padding: 10px;
  277. list-style: none;
  278. &:hover {
  279. background-color: @body-bg;
  280. a {
  281. color: #fff;
  282. }
  283. }
  284. a {
  285. color: #777;
  286. line-height: 15px;
  287. font-size: small;
  288. }
  289. }
  290. }
  291. }
  292. }
  293. }
  294. }
  295. // 小屏幕下拉菜单
  296. // 移动端下拉菜单
  297. #nav-sm {
  298. position: fixed;
  299. z-index: 99;
  300. width: 100vw;
  301. overflow-y: scroll;
  302. box-sizing: border-box;
  303. background-color: #fff;
  304. margin-top: 80px;
  305. padding: 0 20px;
  306. // 通用样式
  307. .my-province{
  308. padding: 20px 0;
  309. div{
  310. top: 50px;
  311. }
  312. }
  313. @media screen and (max-width:768px) {
  314. & {
  315. border-top: 1px solid #eee;
  316. }
  317. }
  318. &::-webkit-scrollbar {
  319. height: 0;
  320. }
  321. &>ul>li>a.active {
  322. color: @body-bg;
  323. }
  324. ul {
  325. padding-inline-start: 0;
  326. li {
  327. list-style-type: none;
  328. a {
  329. font-weight: bold;
  330. font-size: 20px;
  331. font-size: 16px;
  332. line-height: 40px;
  333. color: #555;
  334. text-decoration: none;
  335. &:hover {
  336. color: @body-bg;
  337. }
  338. }
  339. .nav-sm-ul {
  340. display: flex;
  341. justify-content: flex-start;
  342. align-items: center;
  343. flex-wrap: wrap;
  344. padding: 0;
  345. .nav-sm-li {
  346. padding: 0 10px;
  347. a {
  348. font-size: 14px;
  349. font-weight: normal;
  350. }
  351. }
  352. }
  353. }
  354. }
  355. }
  356. .nav-sm-noheight {
  357. height: 0px;
  358. }
  359. .nav-sm-show {
  360. height: calc(~"100vh - 80px");
  361. animation: nav 0.5s;
  362. -webkit-animation: nav 0.5s normal;
  363. -moz-animation: nav 0.5s;
  364. }
  365. .nav-sm-noshow {
  366. height: 0px;
  367. animation: navc 0.5s;
  368. -webkit-animation: navc 0.5s normal;
  369. -moz-animation: navc 0.5s;
  370. }
  371. // 主题默认样式
  372. .body {
  373. background-color: #fff;
  374. max-width: 1200px;
  375. min-height: 700px;
  376. overflow: hidden;
  377. position: relative;
  378. padding: 10px 15px 15px;
  379. margin: 141px 20px 20px;
  380. // 自定义样式类
  381. // 加载
  382. .my-loading {
  383. text-align: center;
  384. color: #999;
  385. display: none;
  386. }
  387. // 点击阅读
  388. .my-read {
  389. margin-top: 20px;
  390. text-align: center;
  391. .good {
  392. border-radius: 5px;
  393. border: 1px solid #e6e6e6;
  394. display: inline-block;
  395. padding: 5px 30px;
  396. margin-bottom: 10px;
  397. }
  398. }
  399. // 相关文章
  400. .my-articles {
  401. ul {
  402. width: 100%;
  403. border-top: 1px solid #e6e6e6;
  404. padding: 0;
  405. list-style: none;
  406. overflow: hidden;
  407. // margin: ;
  408. li {
  409. &::before{
  410. content: "";
  411. display: inline-block;
  412. width: 6px;height: 6px;
  413. background-color: #000;
  414. transform: translateY(-2px);
  415. margin-right: 5px;
  416. border-radius: 50%;
  417. }
  418. color: #777;
  419. overflow: hidden;
  420. text-overflow: ellipsis;
  421. white-space: nowrap;
  422. width: 100%;
  423. padding: 5px 0px;
  424. }
  425. }
  426. }
  427. // 评论区
  428. .my-comment {
  429. .h5 {
  430. display: flex;
  431. justify-content: space-between;
  432. align-content: center;
  433. }
  434. .remind {
  435. text-align: center;
  436. background-color: #e6e6e6;
  437. padding: 5px;
  438. border-radius: 5px;
  439. margin: 10px 0px;
  440. }
  441. .comment {
  442. border-top: 1px solid #e6e6e6;
  443. padding-top: 10px;
  444. .nocomment,
  445. .loading,
  446. .nodata {
  447. display: none;
  448. text-align: center;
  449. margin: 10px;
  450. }
  451. .nocomment {
  452. display: block;
  453. padding-bottom: 10px;
  454. &:hover {
  455. color: @body-bg;
  456. }
  457. }
  458. .user {
  459. width: 100%;
  460. padding: 20px 0;
  461. border-bottom: 1px solid #e6e6e6;
  462. display: grid;
  463. grid-template-columns: 10% 90%;
  464. .u-img {
  465. width: 100%;
  466. text-align: center;
  467. .img {
  468. width: 100%;
  469. max-width: 64px;
  470. }
  471. }
  472. .u-content {
  473. margin-left: 10px;
  474. text-align: justify;
  475. .u-name {
  476. font-size: 16px;
  477. }
  478. .u-detail {
  479. padding: 5px 0px;
  480. }
  481. .u-flex {
  482. display: flex;
  483. justify-content: space-between;
  484. align-items: center;
  485. }
  486. }
  487. }
  488. }
  489. }
  490. // 横向菜单
  491. .my-nav {
  492. border-bottom: 1px solid #e6e6e6;
  493. &::after {
  494. display: block;
  495. content: '';
  496. clear: both;
  497. }
  498. ul {
  499. list-style: none;
  500. padding: 0;
  501. li {
  502. float: left;
  503. padding: 5px;
  504. margin: 0px 5px;
  505. color: #777;
  506. }
  507. .active {
  508. color: black;
  509. border-bottom: 3px solid @body-bg;
  510. font-weight: bold;
  511. }
  512. }
  513. }
  514. // 上拉刷新 列表
  515. .my-list {
  516. .list-item {
  517. text-decoration: none;
  518. color: black;
  519. display: flex;
  520. justify-content: flex-start;
  521. align-items: start;
  522. padding-bottom: 10px;
  523. margin-bottom: 10px;
  524. border-bottom: 1px solid #e6e6e6;
  525. &:hover {
  526. color: #2382ff;
  527. }
  528. .item-img {
  529. flex: 1;
  530. padding: 0 20px;
  531. @media screen and (max-width: 768px) {
  532. & {
  533. padding: 0 10px;
  534. }
  535. }
  536. img {
  537. width: 100%;
  538. border-radius: 5px;
  539. &:hover {
  540. transform: scale(1.1);
  541. }
  542. }
  543. }
  544. .item-detail {
  545. flex: 4;
  546. height: 100%;
  547. position: relative;
  548. overflow: hidden;
  549. @media screen and (max-width: 768px) {
  550. & {
  551. flex: 2;
  552. }
  553. }
  554. .title {
  555. font-weight: 400;
  556. overflow: hidden;
  557. text-overflow: ellipsis;
  558. display: -webkit-box;
  559. -webkit-box-orient: vertical;
  560. -webkit-line-clamp: 2;
  561. font-size: 16px;
  562. }
  563. .time {
  564. font-size: 12px;
  565. color: #777;
  566. margin-top: 5px;
  567. span {
  568. margin-left: 5px;
  569. }
  570. }
  571. }
  572. }
  573. }
  574. @media screen and (max-width:768px) {
  575. & {
  576. padding: 0px;
  577. border-radius: 10px 10px 0 0;
  578. margin: 100px 20px 20px;
  579. }
  580. }
  581. }
  582. .footer {
  583. width: 100%;
  584. box-sizing: border-box;
  585. overflow: hidden;
  586. background-color: #fff;
  587. border-top: 1px solid #f1f1f1;
  588. text-align: center;
  589. color: #777;
  590. p {
  591. margin: 0;
  592. padding: 20px 0px 0px;
  593. }
  594. &>p:last-child {
  595. padding-bottom: 50px;
  596. }
  597. }
  598. // 顶部
  599. #top {
  600. position: fixed;
  601. bottom: 80px;
  602. right: 20px;
  603. padding: 20px;
  604. color: #fff;
  605. background-color: rgba(98, 96, 96, 0.3);
  606. border-radius: 10px;
  607. }
  608. // 分享功能
  609. #share {
  610. position: fixed;
  611. top: 60vh;
  612. right: 0px;
  613. box-sizing: border-box;
  614. display: flex;
  615. @media screen and (max-width:768px) {
  616. & {
  617. display: none;
  618. }
  619. }
  620. div {
  621. height: 132px;
  622. box-sizing: border-box;
  623. background-color: @body-bg;
  624. color: #fff;
  625. font-size: 15px;
  626. width: 30px;
  627. letter-spacing: 10px;
  628. text-align: center;
  629. line-height: 30px;
  630. border-radius: 5px 0 0 5px;
  631. writing-mode: vertical-lr;
  632. /*从左向右 从右向左是 writing-mode: vertical-rl;*/
  633. writing-mode: tb-lr;
  634. /*IE浏览器的从左向右 从右向左是 writing-mode: tb-rl;*/
  635. }
  636. ul {
  637. width: 0px;
  638. height: 132px;
  639. border: 1px solid #aaa;
  640. box-sizing: border-box;
  641. border-right: none;
  642. list-style: none;
  643. padding: 0;
  644. box-sizing: border-box;
  645. &>li:first-child {
  646. background-color: #c6c6c6;
  647. line-height: 26px;
  648. font-weight: bold;
  649. }
  650. li {
  651. padding: 5px 10px;
  652. width: 100px;
  653. vertical-align: middle;
  654. img {
  655. width: 20px;
  656. vertical-align: middle;
  657. margin-right: 5px;
  658. }
  659. &:hover:not(ul>li:first-child) {
  660. background-color: #e6e6e6;
  661. }
  662. }
  663. }
  664. // width: 100px;height: 100px;
  665. }
  666. // 交互板
  667. #toast {
  668. display: none;
  669. position: fixed;
  670. top: 0;
  671. left: 0;
  672. z-index: 100;
  673. width: 100vw;
  674. height: 100vh;
  675. background-color: rgba(29, 27, 27, 0.5);
  676. text-align: center;
  677. &>div {
  678. background-color: #fff;
  679. position: absolute;
  680. padding: 5px;
  681. border-radius: 5px;
  682. width: 200px;
  683. // box-shadow: 0px 0px 5px #fff;
  684. left: calc(~"50vw - 100px");
  685. top: 30vh;
  686. }
  687. }
  688. // 下载app
  689. #download {
  690. position: fixed;
  691. bottom: 0px;
  692. width: 100vw;
  693. display: none;
  694. justify-content: space-between;
  695. align-items: center;
  696. background-color: rgba(1, 1, 1, 0.5);
  697. padding: 5px 10px;
  698. color: #fff;
  699. .left {
  700. width: 200px;
  701. &::before {
  702. display: block;
  703. content: '';
  704. clear: both;
  705. }
  706. img,
  707. div {
  708. float: left;
  709. }
  710. img {
  711. width: 50px;
  712. }
  713. div {
  714. margin-left: 10px;
  715. }
  716. .row1 {
  717. margin-bottom: 10px;
  718. }
  719. }
  720. @media screen and (max-width:768px) {
  721. display: flex;
  722. }
  723. }