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. 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: 10px 20px;
  405. list-style: square;
  406. color: #777;
  407. overflow: hidden;
  408. li {
  409. overflow: hidden;
  410. text-overflow: ellipsis;
  411. white-space: nowrap;
  412. width: 100%;
  413. padding: 5px 0px;
  414. }
  415. }
  416. }
  417. // 评论区
  418. .my-comment {
  419. .h5 {
  420. display: flex;
  421. justify-content: space-between;
  422. align-content: center;
  423. }
  424. .remind {
  425. text-align: center;
  426. background-color: #e6e6e6;
  427. padding: 5px;
  428. border-radius: 5px;
  429. margin: 10px 0px;
  430. }
  431. .comment {
  432. border-top: 1px solid #e6e6e6;
  433. padding-top: 10px;
  434. .nocomment,
  435. .loading,
  436. .nodata {
  437. display: none;
  438. text-align: center;
  439. margin: 10px;
  440. }
  441. .nocomment {
  442. display: block;
  443. padding-bottom: 10px;
  444. &:hover {
  445. color: @body-bg;
  446. }
  447. }
  448. .user {
  449. width: 100%;
  450. padding: 20px 0;
  451. border-bottom: 1px solid #e6e6e6;
  452. display: grid;
  453. grid-template-columns: 10% 90%;
  454. .u-img {
  455. width: 100%;
  456. text-align: center;
  457. .img {
  458. width: 100%;
  459. max-width: 64px;
  460. }
  461. }
  462. .u-content {
  463. margin-left: 10px;
  464. text-align: justify;
  465. .u-name {
  466. font-size: 16px;
  467. }
  468. .u-detail {
  469. padding: 5px 0px;
  470. }
  471. .u-flex {
  472. display: flex;
  473. justify-content: space-between;
  474. align-items: center;
  475. }
  476. }
  477. }
  478. }
  479. }
  480. // 横向菜单
  481. .my-nav {
  482. border-bottom: 1px solid #e6e6e6;
  483. &::after {
  484. display: block;
  485. content: '';
  486. clear: both;
  487. }
  488. ul {
  489. list-style: none;
  490. padding: 0;
  491. li {
  492. float: left;
  493. padding: 5px;
  494. margin: 0px 5px;
  495. color: #777;
  496. }
  497. .active {
  498. color: black;
  499. border-bottom: 3px solid @body-bg;
  500. font-weight: bold;
  501. }
  502. }
  503. }
  504. // 上拉刷新 列表
  505. .my-list {
  506. .list-item {
  507. text-decoration: none;
  508. color: black;
  509. display: flex;
  510. justify-content: flex-start;
  511. align-items: start;
  512. padding-bottom: 10px;
  513. margin-bottom: 10px;
  514. border-bottom: 1px solid #e6e6e6;
  515. &:hover {
  516. color: #2382ff;
  517. }
  518. .item-img {
  519. flex: 1;
  520. padding: 0 20px;
  521. @media screen and (max-width: 768px) {
  522. & {
  523. padding: 0 10px;
  524. }
  525. }
  526. img {
  527. width: 100%;
  528. border-radius: 5px;
  529. &:hover {
  530. transform: scale(1.1);
  531. }
  532. }
  533. }
  534. .item-detail {
  535. flex: 4;
  536. height: 100%;
  537. position: relative;
  538. overflow: hidden;
  539. @media screen and (max-width: 768px) {
  540. & {
  541. flex: 2;
  542. }
  543. }
  544. .title {
  545. font-weight: 400;
  546. overflow: hidden;
  547. text-overflow: ellipsis;
  548. display: -webkit-box;
  549. -webkit-box-orient: vertical;
  550. -webkit-line-clamp: 2;
  551. font-size: 16px;
  552. }
  553. .time {
  554. font-size: 12px;
  555. color: #777;
  556. margin-top: 5px;
  557. span {
  558. margin-left: 5px;
  559. }
  560. }
  561. }
  562. }
  563. }
  564. @media screen and (max-width:768px) {
  565. & {
  566. padding: 0px;
  567. border-radius: 10px 10px 0 0;
  568. margin: 100px 20px 20px;
  569. }
  570. }
  571. }
  572. .footer {
  573. width: 100%;
  574. box-sizing: border-box;
  575. overflow: hidden;
  576. background-color: #fff;
  577. border-top: 1px solid #f1f1f1;
  578. text-align: center;
  579. color: #777;
  580. p {
  581. margin: 0;
  582. padding: 20px 0px 0px;
  583. }
  584. &>p:last-child {
  585. padding-bottom: 50px;
  586. }
  587. }
  588. // 顶部
  589. #top {
  590. position: fixed;
  591. bottom: 80px;
  592. right: 20px;
  593. padding: 20px;
  594. color: #fff;
  595. background-color: rgba(98, 96, 96, 0.3);
  596. border-radius: 10px;
  597. }
  598. // 分享功能
  599. #share {
  600. position: fixed;
  601. top: 60vh;
  602. right: 0px;
  603. box-sizing: border-box;
  604. display: flex;
  605. @media screen and (max-width:768px) {
  606. & {
  607. display: none;
  608. }
  609. }
  610. div {
  611. height: 132px;
  612. box-sizing: border-box;
  613. background-color: @body-bg;
  614. color: #fff;
  615. font-size: 15px;
  616. width: 30px;
  617. letter-spacing: 10px;
  618. text-align: center;
  619. line-height: 30px;
  620. border-radius: 5px 0 0 5px;
  621. writing-mode: vertical-lr;
  622. /*从左向右 从右向左是 writing-mode: vertical-rl;*/
  623. writing-mode: tb-lr;
  624. /*IE浏览器的从左向右 从右向左是 writing-mode: tb-rl;*/
  625. }
  626. ul {
  627. width: 0px;
  628. height: 132px;
  629. border: 1px solid #aaa;
  630. box-sizing: border-box;
  631. border-right: none;
  632. list-style: none;
  633. padding: 0;
  634. box-sizing: border-box;
  635. &>li:first-child {
  636. background-color: #c6c6c6;
  637. line-height: 26px;
  638. font-weight: bold;
  639. }
  640. li {
  641. padding: 5px 10px;
  642. width: 100px;
  643. vertical-align: middle;
  644. img {
  645. width: 20px;
  646. vertical-align: middle;
  647. margin-right: 5px;
  648. }
  649. &:hover:not(ul>li:first-child) {
  650. background-color: #e6e6e6;
  651. }
  652. }
  653. }
  654. // width: 100px;height: 100px;
  655. }
  656. // 交互板
  657. #toast {
  658. display: none;
  659. position: fixed;
  660. top: 0;
  661. left: 0;
  662. z-index: 100;
  663. width: 100vw;
  664. height: 100vh;
  665. background-color: rgba(29, 27, 27, 0.5);
  666. text-align: center;
  667. &>div {
  668. background-color: #fff;
  669. position: absolute;
  670. padding: 5px;
  671. border-radius: 5px;
  672. width: 200px;
  673. // box-shadow: 0px 0px 5px #fff;
  674. left: calc(~"50vw - 100px");
  675. top: 30vh;
  676. }
  677. }
  678. // 下载app
  679. #download {
  680. position: fixed;
  681. bottom: 0px;
  682. width: 100vw;
  683. display: none;
  684. justify-content: space-between;
  685. align-items: center;
  686. background-color: rgba(1, 1, 1, 0.5);
  687. padding: 5px 10px;
  688. color: #fff;
  689. .left {
  690. width: 200px;
  691. &::before {
  692. display: block;
  693. content: '';
  694. clear: both;
  695. }
  696. img,
  697. div {
  698. float: left;
  699. }
  700. img {
  701. width: 50px;
  702. }
  703. div {
  704. margin-left: 10px;
  705. }
  706. .row1 {
  707. margin-bottom: 10px;
  708. }
  709. }
  710. @media screen and (max-width:768px) {
  711. display: flex;
  712. }
  713. }