components.less 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  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. }
  192. &:hover {
  193. color: @body-bg;
  194. }
  195. }
  196. .nav-ul {
  197. display: none;
  198. overflow: hidden;
  199. padding: 0;
  200. position: absolute;
  201. z-index: 1;
  202. background-color: #fff;
  203. overflow: auto !important;
  204. .nav-li {
  205. width: 100px;
  206. padding: 10px;
  207. list-style: none;
  208. &:hover {
  209. background-color: @body-bg;
  210. a {
  211. color: #fff;
  212. }
  213. }
  214. a {
  215. color: #777;
  216. line-height: 15px;
  217. font-size: small;
  218. }
  219. }
  220. }
  221. }
  222. }
  223. }
  224. }
  225. // 小屏幕下拉菜单
  226. // 移动端下拉菜单
  227. #nav-sm {
  228. position: fixed;
  229. z-index: 99;
  230. width: 100vw;
  231. overflow-y: scroll;
  232. @media screen and (max-width:768px) {
  233. & {
  234. border-top: 1px solid #eee;
  235. }
  236. }
  237. &::-webkit-scrollbar {
  238. height: 0;
  239. }
  240. box-sizing: border-box;
  241. background-color: #fff;
  242. margin-top: 80px;
  243. padding: 0;
  244. &>ul>li>a.active{
  245. color: @body-bg;
  246. }
  247. ul {
  248. li {
  249. list-style-type: none;
  250. a {
  251. font-weight: bold;
  252. font-size: 20px;
  253. font-size: 16px;
  254. line-height: 40px;
  255. color: #555;
  256. text-decoration: none;
  257. &:hover {
  258. color: @body-bg;
  259. }
  260. }
  261. .nav-sm-ul {
  262. display: flex;
  263. justify-content: flex-start;
  264. align-items: center;
  265. flex-wrap: wrap;
  266. padding: 0;
  267. .nav-sm-li {
  268. padding: 0 10px;
  269. a {
  270. font-size: 14px;
  271. font-weight: normal;
  272. }
  273. }
  274. }
  275. }
  276. }
  277. }
  278. .nav-sm-noheight {
  279. height: 0px;
  280. }
  281. .nav-sm-show {
  282. height: calc(~"100vh - 80px");
  283. animation: nav 1s;
  284. -webkit-animation: nav 1s normal;
  285. -moz-animation: nav 1s;
  286. }
  287. .nav-sm-noshow {
  288. height: 0px;
  289. animation: navc 1s;
  290. -webkit-animation: navc 1s normal;
  291. -moz-animation: navc 1s;
  292. }
  293. // 主题默认样式
  294. .body {
  295. background-color: #fff;
  296. max-width: 1200px;
  297. min-height: 700px;
  298. overflow: hidden;
  299. position: relative;
  300. padding: 10px 15px 15px;
  301. margin: 141px 20px 20px;
  302. // 自定义样式类
  303. // 加载
  304. .my-loading{
  305. text-align: center ;
  306. color: #999;
  307. display: none;
  308. }
  309. // 点击阅读
  310. .my-read {
  311. margin-top: 20px;
  312. text-align: center;
  313. .good {
  314. border-radius: 5px;
  315. border: 1px solid #e6e6e6;
  316. display: inline-block;
  317. padding: 5px 30px;
  318. margin-bottom: 10px;
  319. }
  320. }
  321. // 相关文章
  322. .my-articles {
  323. ul {
  324. width: 100%;
  325. border-top: 1px solid #e6e6e6;
  326. padding: 10px 20px;
  327. list-style: square;
  328. color: #777;
  329. overflow: hidden;
  330. li {
  331. overflow: hidden;
  332. text-overflow: ellipsis;
  333. white-space: nowrap;
  334. width: 100%;
  335. padding: 5px 0px;
  336. }
  337. }
  338. }
  339. // 评论区
  340. .my-comment {
  341. .h5 {
  342. display: flex;
  343. justify-content: space-between;
  344. align-content: center;
  345. }
  346. .remind {
  347. text-align: center;
  348. background-color: #e6e6e6;
  349. padding: 5px;
  350. border-radius: 5px;
  351. margin: 10px 0px;
  352. }
  353. .comment {
  354. border-top: 1px solid #e6e6e6;
  355. padding-top: 10px;
  356. .nocomment,
  357. .loading,
  358. .nodata {
  359. display: none;
  360. text-align: center;
  361. margin: 10px;
  362. }
  363. .nocomment {
  364. display: block;
  365. padding-bottom: 10px;
  366. &:hover {
  367. color: @body-bg;
  368. }
  369. }
  370. .user {
  371. width: 100%;
  372. padding: 20px 0;
  373. border-bottom: 1px solid #e6e6e6;
  374. display: grid;
  375. grid-template-columns: 10% 90%;
  376. .u-img {
  377. width: 100%;
  378. text-align: center;
  379. .img {
  380. width: 100%;
  381. max-width: 64px;
  382. }
  383. }
  384. .u-content {
  385. margin-left: 10px;
  386. text-align: justify;
  387. .u-name {
  388. font-size: 16px;
  389. }
  390. .u-detail {
  391. padding: 5px 0px;
  392. }
  393. .u-flex {
  394. display: flex;
  395. justify-content: space-between;
  396. align-items: center;
  397. }
  398. }
  399. }
  400. }
  401. }
  402. @media screen and (max-width:768px) {
  403. & {
  404. padding: 0px;
  405. border-radius: 10px 10px 0 0;
  406. margin: 100px 20px 20px;
  407. }
  408. }
  409. }
  410. .footer {
  411. width: 100%;
  412. box-sizing: border-box;
  413. overflow: hidden;
  414. background-color: #fff;
  415. border-top: 1px solid #f1f1f1;
  416. text-align: center;
  417. color: #777;
  418. p {
  419. margin: 0;
  420. padding: 20px 0px 0px;
  421. }
  422. &>p:last-child {
  423. padding-bottom: 50px;
  424. }
  425. }
  426. // 顶部
  427. #top {
  428. position: fixed;
  429. bottom: 80px;
  430. right: 20px;
  431. padding: 20px;
  432. color: #fff;
  433. background-color: rgba(98, 96, 96, 0.3);
  434. border-radius: 10px;
  435. }
  436. // 分享功能
  437. #share {
  438. position: fixed;
  439. top: 60vh;
  440. right: 0px;
  441. box-sizing: border-box;
  442. display: flex;
  443. @media screen and (max-width:768px) {
  444. & {
  445. display: none;
  446. }
  447. }
  448. div {
  449. height: 132px;
  450. box-sizing: border-box;
  451. background-color: @body-bg;
  452. color: #fff;
  453. font-size: 15px;
  454. width: 30px;
  455. letter-spacing: 10px;
  456. text-align: center;
  457. line-height: 30px;
  458. border-radius: 5px 0 0 5px;
  459. writing-mode: vertical-lr;
  460. /*从左向右 从右向左是 writing-mode: vertical-rl;*/
  461. writing-mode: tb-lr;
  462. /*IE浏览器的从左向右 从右向左是 writing-mode: tb-rl;*/
  463. }
  464. ul {
  465. width: 0px;
  466. height: 132px;
  467. border: 1px solid #aaa;
  468. box-sizing: border-box;
  469. border-right: none;
  470. list-style: none;
  471. padding: 0;
  472. box-sizing: border-box;
  473. &>li:first-child {
  474. background-color: #c6c6c6;
  475. line-height: 26px;
  476. font-weight: bold;
  477. }
  478. li {
  479. padding: 5px 10px;
  480. width: 100px;
  481. vertical-align: middle;
  482. img {
  483. width: 20px;
  484. vertical-align: middle;
  485. margin-right: 5px;
  486. }
  487. &:hover:not(ul>li:first-child) {
  488. background-color: #e6e6e6;
  489. }
  490. }
  491. }
  492. // width: 100px;height: 100px;
  493. }
  494. // 交互板
  495. #toast{
  496. display: none;
  497. position: fixed;
  498. top: 0;
  499. left: 0;
  500. z-index: 100;
  501. width: 100vw;
  502. height: 100vh;
  503. background-color: rgba(29, 27, 27, 0.5) ;
  504. text-align: center;
  505. &>div{
  506. background-color: #fff;
  507. position: absolute;
  508. padding: 5px;
  509. border-radius: 5px;
  510. width: 200px;
  511. // box-shadow: 0px 0px 5px #fff;
  512. left: calc(~"50vw - 100px");
  513. top: 30vh;
  514. }
  515. }
  516. // 下载app
  517. #download{
  518. position: fixed;
  519. bottom: 0px;
  520. width: 100vw;
  521. display: none;
  522. justify-content: space-between;align-items: center;
  523. background-color: rgba(1,1,1,0.5);
  524. padding: 5px 10px;
  525. color: #fff;
  526. .left{
  527. width: 200px;
  528. &::before{
  529. display: block;content: '';
  530. clear: both;
  531. }
  532. img,div{
  533. float: left;
  534. }
  535. img{
  536. width: 50px;
  537. }
  538. div{
  539. margin-left: 10px;
  540. }
  541. .row1{
  542. margin-bottom: 10px;
  543. }
  544. }
  545. @media screen and (max-width:768px) {
  546. display: flex;
  547. }
  548. }