components.less 12 KB

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