components.less 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986
  1. @title-top: #3181ff;
  2. @title-bg: #e0ecff;
  3. @body-bg: #03C762;
  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: 20px;
  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;
  413. height: 6px;
  414. background-color: #000;
  415. transform: translateY(-2px);
  416. margin-right: 5px;
  417. border-radius: 50%;
  418. }
  419. color: #777;
  420. overflow: hidden;
  421. text-overflow: ellipsis;
  422. white-space: nowrap;
  423. width: 100%;
  424. padding: 5px 0px;
  425. }
  426. }
  427. }
  428. // 评论区
  429. .my-comment {
  430. .h5 {
  431. display: flex;
  432. justify-content: space-between;
  433. align-content: center;
  434. }
  435. .remind {
  436. text-align: center;
  437. background-color: #e6e6e6;
  438. padding: 5px;
  439. border-radius: 5px;
  440. margin: 10px 0px;
  441. }
  442. .comment {
  443. border-top: 1px solid #e6e6e6;
  444. padding-top: 10px;
  445. .nocomment,
  446. .loading,
  447. .nodata {
  448. display: none;
  449. text-align: center;
  450. margin: 10px;
  451. }
  452. .nocomment {
  453. display: block;
  454. padding-bottom: 10px;
  455. &:hover {
  456. color: @body-bg;
  457. }
  458. }
  459. .user {
  460. width: 100%;
  461. padding: 20px 0;
  462. border-bottom: 1px solid #e6e6e6;
  463. display: grid;
  464. grid-template-columns: 10% 90%;
  465. .u-img {
  466. width: 100%;
  467. text-align: center;
  468. .img {
  469. width: 100%;
  470. max-width: 64px;
  471. }
  472. }
  473. .u-content {
  474. margin-left: 10px;
  475. text-align: justify;
  476. .u-name {
  477. font-size: 16px;
  478. }
  479. .u-detail {
  480. padding: 5px 0px;
  481. }
  482. .u-flex {
  483. display: flex;
  484. justify-content: space-between;
  485. align-items: center;
  486. }
  487. }
  488. }
  489. }
  490. }
  491. // 横向菜单
  492. .my-nav {
  493. border-bottom: 1px solid #e6e6e6;
  494. &::after {
  495. display: block;
  496. content: '';
  497. clear: both;
  498. }
  499. ul {
  500. list-style: none;
  501. padding: 0;
  502. li {
  503. float: left;
  504. padding: 5px;
  505. margin: 0px 5px;
  506. color: #777;
  507. }
  508. .active {
  509. color: black;
  510. border-bottom: 3px solid @body-bg;
  511. font-weight: bold;
  512. }
  513. }
  514. }
  515. // 上拉刷新 列表
  516. .my-list {
  517. .list-item {
  518. text-decoration: none;
  519. color: black;
  520. display: flex;
  521. justify-content: flex-start;
  522. align-items: start;
  523. padding-bottom: 10px;
  524. margin-bottom: 10px;
  525. border-bottom: 1px solid #e6e6e6;
  526. &:hover {
  527. color: #2382ff;
  528. }
  529. .item-img {
  530. flex: 1;
  531. padding: 0 20px;
  532. @media screen and (max-width: 768px) {
  533. & {
  534. padding: 0 10px;
  535. }
  536. }
  537. img {
  538. width: 100%;
  539. border-radius: 5px;
  540. &:hover {
  541. transform: scale(1.1);
  542. }
  543. }
  544. }
  545. .item-detail {
  546. flex: 4;
  547. height: 100%;
  548. position: relative;
  549. overflow: hidden;
  550. @media screen and (max-width: 768px) {
  551. & {
  552. flex: 2;
  553. }
  554. }
  555. .title {
  556. font-weight: 400;
  557. overflow: hidden;
  558. text-overflow: ellipsis;
  559. display: -webkit-box;
  560. -webkit-box-orient: vertical;
  561. -webkit-line-clamp: 2;
  562. font-size: 16px;
  563. }
  564. .time {
  565. font-size: 12px;
  566. color: #777;
  567. margin-top: 5px;
  568. span {
  569. margin-left: 5px;
  570. }
  571. }
  572. }
  573. }
  574. }
  575. @media screen and (max-width:768px) {
  576. & {
  577. padding: 0px;
  578. border-radius: 10px 10px 0 0;
  579. margin: 100px 20px 20px;
  580. }
  581. }
  582. }
  583. .footer {
  584. width: 100%;
  585. box-sizing: border-box;
  586. overflow: hidden;
  587. background-color: #fff;
  588. border-top: 1px solid #f1f1f1;
  589. text-align: center;
  590. color: #777;
  591. p {
  592. margin: 0;
  593. padding: 20px 0px 0px;
  594. }
  595. &>p:last-child {
  596. padding-bottom: 50px;
  597. }
  598. }
  599. // 顶部
  600. #top {
  601. position: fixed;
  602. bottom: 80px;
  603. right: 20px;
  604. padding: 20px;
  605. color: #fff;
  606. background-color: rgba(98, 96, 96, 0.3);
  607. border-radius: 10px;
  608. }
  609. // 分享功能
  610. #share {
  611. position: fixed;
  612. top: 60vh;
  613. right: 0px;
  614. box-sizing: border-box;
  615. display: flex;
  616. @media screen and (max-width:768px) {
  617. & {
  618. display: none;
  619. }
  620. }
  621. &>div:first-child {
  622. height: 132px;
  623. box-sizing: border-box;
  624. background-color: @body-bg;
  625. color: #fff;
  626. font-size: 15px;
  627. width: 30px;
  628. letter-spacing: 10px;
  629. text-align: center;
  630. line-height: 30px;
  631. border-radius: 5px 0 0 5px;
  632. writing-mode: vertical-lr;
  633. /*从左向右 从右向左是 writing-mode: vertical-rl;*/
  634. writing-mode: tb-lr;
  635. /*IE浏览器的从左向右 从右向左是 writing-mode: tb-rl;*/
  636. }
  637. ul {
  638. width: 0px;
  639. height: 132px;
  640. border: 1px solid #aaa;
  641. box-sizing: border-box;
  642. border-right: none;
  643. list-style: none;
  644. padding: 0;
  645. box-sizing: border-box;
  646. &>li:first-child {
  647. background-color: #c6c6c6;
  648. line-height: 26px;
  649. font-weight: bold;
  650. }
  651. li {
  652. padding: 5px 10px;
  653. width: 100px;
  654. vertical-align: middle;
  655. img {
  656. width: 20px;
  657. vertical-align: middle;
  658. margin-right: 5px;
  659. }
  660. &:hover:not(ul>li:first-child) {
  661. background-color: #e6e6e6;
  662. }
  663. }
  664. }
  665. #qrcode {
  666. &::before {
  667. display: block;
  668. content: "微信扫一扫:分享";
  669. line-height: 30px;
  670. font-size: 12px;
  671. text-align: center;
  672. background-color: #e6e6e6;
  673. }
  674. img {
  675. margin: auto;
  676. padding: 20px 0;
  677. }
  678. width: 180px;
  679. box-sizing: border-box;
  680. box-shadow: 0px 0px 5px #999;
  681. display: none;
  682. position: absolute;
  683. background-color: #fff;
  684. top: -210px;
  685. border-radius: 5px;
  686. right: 140px;
  687. .wei {
  688. text-align: center;
  689. }
  690. }
  691. }
  692. // 交互板
  693. #toast {
  694. display: none;
  695. position: fixed;
  696. top: 0;
  697. left: 0;
  698. z-index: 100;
  699. width: 100vw;
  700. height: 100vh;
  701. background-color: rgba(29, 27, 27, 0.5);
  702. text-align: center;
  703. &>div {
  704. background-color: #fff;
  705. position: absolute;
  706. padding: 5px;
  707. border-radius: 5px;
  708. width: 200px;
  709. // box-shadow: 0px 0px 5px #fff;
  710. left: calc(~"50vw - 100px");
  711. top: 30vh;
  712. }
  713. }
  714. // 下载app
  715. #download {
  716. position: fixed;
  717. bottom: 0px;
  718. width: 100vw;
  719. display: none;
  720. justify-content: space-between;
  721. align-items: center;
  722. background-color: rgba(1, 1, 1, 0.5);
  723. padding: 5px 10px;
  724. color: #fff;
  725. .left {
  726. width: 200px;
  727. &::before {
  728. display: block;
  729. content: '';
  730. clear: both;
  731. }
  732. img,
  733. div {
  734. float: left;
  735. }
  736. img {
  737. width: 50px;
  738. }
  739. div {
  740. margin-left: 10px;
  741. }
  742. .row1 {
  743. margin-bottom: 10px;
  744. }
  745. }
  746. @media screen and (max-width:768px) {
  747. display: flex;
  748. }
  749. }
  750. // 通用图片轮播观看
  751. #imglist {
  752. &::-webkit-scrollbar {
  753. /*滚动条整体样式*/
  754. width: 5px;
  755. /*高宽分别对应横竖滚动条的尺寸*/
  756. height: 5px;
  757. }
  758. &::-webkit-scrollbar-thumb {
  759. /*滚动条里面小方块*/
  760. border-radius: 10px;
  761. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  762. background: #999;
  763. }
  764. // 2382ff
  765. &::-webkit-scrollbar-thumb:hover {
  766. background: @body-bg;
  767. }
  768. &::-webkit-scrollbar-track {
  769. /*滚动条里面轨道*/
  770. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  771. border-radius: 10px;
  772. background: #eee;
  773. }
  774. display: none;
  775. overflow: scroll;
  776. position: fixed;
  777. width: 100vw;
  778. box-sizing: border-box;
  779. height: 100vh;
  780. top: 0;
  781. z-index: 1000;
  782. background-color: #fff;
  783. span{
  784. display: block;
  785. position: fixed;
  786. right: 20px;
  787. top: 10px;
  788. width: 35px;
  789. height:115px;
  790. background-color: #000;
  791. padding: 5px;
  792. border-radius: 5px;
  793. img{
  794. width: 25px;
  795. position:relative !important;
  796. margin: 5px 0;
  797. }
  798. }
  799. div {
  800. line-height: 100%;
  801. position: relative;
  802. width: 100%;
  803. height: 100%;
  804. // background-color: rgba(0, 0, 0, 0.6);
  805. img {
  806. position: absolute;
  807. }
  808. .glyphicon {
  809. &:hover {
  810. background-color: rgba(247, 237, 237, 0.5);
  811. }
  812. position:fixed;
  813. color: #000;
  814. width: 20%;
  815. max-width: 50px;
  816. height: 100px;
  817. border-radius: 5px;
  818. text-align: center;
  819. line-height: 100px;
  820. margin-top: calc(~"50vh - 50px");
  821. }
  822. .left {
  823. left: 50px;
  824. }
  825. .right {
  826. right:50px;
  827. }
  828. }
  829. }