style.scss 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  1. /* 共通樣式 */
  2. :root {
  3. --main-color: #000;
  4. --sub-color: #e47140;
  5. --gray-color: #727272;
  6. }
  7. * {
  8. letter-spacing: 1px;
  9. font-weight: 400;
  10. font-family: "Noto Sans TC", sans-serif !important;
  11. }
  12. p,
  13. li {
  14. line-height: 32px;
  15. }
  16. ul {
  17. list-style: none;
  18. }
  19. img {
  20. width: 100%;
  21. height: auto;
  22. }
  23. html,
  24. body {
  25. height: 100%;
  26. margin: 0;
  27. }
  28. body {
  29. display: flex;
  30. flex-direction: column;
  31. overflow-y: scroll;
  32. }
  33. .btn:focus,
  34. .form-control:focus {
  35. border-color: var(--main-color) !important;
  36. box-shadow: none !important;
  37. outline: 0 none !important;
  38. }
  39. .badge {
  40. font-weight: 400 !important;
  41. }
  42. .navbar {
  43. background-color: var(--main-color) !important;
  44. .navbar-collapse {
  45. flex-grow: 0;
  46. }
  47. .navbar-brand {
  48. font-size: 50px;
  49. font-weight: 500;
  50. font-family: "Roboto Slab", serif !important;
  51. color: var(--sub-color);
  52. transition: all 0.3s;
  53. @media (max-width: 575px) {
  54. padding-left: 1rem;
  55. font-size: 35px;
  56. }
  57. &:hover {
  58. opacity: 0.9;
  59. color: var(--sub-color);
  60. }
  61. }
  62. }
  63. .blog-post-tags {
  64. .badge {
  65. background-color: var(--main-color);
  66. &:hover {
  67. color: var(--main-color);
  68. background-color: #fff;
  69. border: 1px solid var(--main-color);
  70. }
  71. }
  72. }
  73. .blog-post-title {
  74. margin: 10px 0 20px;
  75. a {
  76. font-size: 50px;
  77. font-weight: 500;
  78. }
  79. }
  80. .pagination {
  81. justify-content: center;
  82. .page-link {
  83. color: var(--main-color);
  84. }
  85. .page-item.active .page-link {
  86. z-index: 3;
  87. color: #fff;
  88. background-color: var(--main-color);
  89. border-color: var(--main-color);
  90. }
  91. }
  92. .post-title {
  93. a {
  94. color: #000;
  95. text-decoration: none;
  96. font-size: 22px;
  97. font-weight: 500;
  98. }
  99. }
  100. .post-block-title {
  101. margin-bottom: 25px;
  102. position: relative;
  103. font-size: 20px;
  104. &::after {
  105. position: absolute;
  106. z-index: -10;
  107. top: 30px;
  108. left: 0;
  109. width: 100%;
  110. height: 0px;
  111. content: "";
  112. border-bottom: 1px solid var(--sub-color);
  113. bottom: 5px;
  114. }
  115. span {
  116. padding: 5px 20px;
  117. // font-weight: 500;
  118. color: #fff;
  119. font-weight: 300;
  120. background: var(--sub-color);
  121. }
  122. }
  123. .news-info {
  124. margin-top: 10px;
  125. line-height: 20px;
  126. a {
  127. font-size: 14px;
  128. font-weight: 500;
  129. color: var(--gray-color);
  130. text-decoration: none;
  131. transition: all 0.3s;
  132. &:hover {
  133. opacity: 0.8;
  134. }
  135. }
  136. small {
  137. color: var(--gray-color);
  138. }
  139. }
  140. .news-thumbnail {
  141. height: 100%;
  142. object-fit: cover;
  143. }
  144. // 文字省略
  145. .line-clamp {
  146. max-width: 150px;
  147. display: -webkit-box;
  148. -webkit-line-clamp: 2;
  149. -webkit-box-orient: vertical;
  150. overflow: hidden;
  151. text-overflow: ellipsis;
  152. }
  153. .post-depiction {
  154. // max-width: 350px;
  155. margin: 10px 0;
  156. display: -webkit-box;
  157. -webkit-line-clamp: 2;
  158. -webkit-box-orient: vertical;
  159. overflow: hidden;
  160. text-overflow: ellipsis;
  161. line-height: 26px;
  162. a {
  163. color: #7a7a7a;
  164. text-decoration: none;
  165. }
  166. }
  167. .top-btn {
  168. position: fixed;
  169. bottom: 15px;
  170. right: 15px;
  171. z-index: 10;
  172. opacity: 0; // scrollTop = 0
  173. transition: all 0.5s;
  174. button {
  175. border: none;
  176. background: var(--sub-color);
  177. border-radius: 100px;
  178. width: 55px;
  179. height: 55px;
  180. }
  181. }
  182. .show {
  183. opacity: 1; // scrollTop > 100
  184. }
  185. .blog-header {
  186. .nav-item {
  187. padding: 0 0.3rem;
  188. @media (max-width: 575px) {
  189. padding: 0 1rem;
  190. }
  191. }
  192. }
  193. /* sidebar.html Start */
  194. .news-sidebar {
  195. position: sticky;
  196. top: 15px;
  197. .news-featured {
  198. position: unset;
  199. }
  200. }
  201. .search-btn {
  202. border: 1px solid var(--main-color) !important;
  203. svg {
  204. color: var(--main-color);
  205. }
  206. &:hover {
  207. background-color: var(--main-color) !important;
  208. svg {
  209. color: #fff;
  210. }
  211. }
  212. }
  213. .tags {
  214. margin: 0 5px 5px 0;
  215. padding: 7px 10px !important;
  216. font-size: 14px !important;
  217. font-weight: 400 !important;
  218. color: var(--main-color) !important;
  219. border: 1px solid var(--main-color) !important;
  220. &:hover {
  221. color: #fff !important;
  222. background-color: var(--main-color);
  223. }
  224. }
  225. /* sidebar.html End */
  226. /* single.html Start */
  227. .blog-post.content {
  228. .content {
  229. padding-bottom: 3rem;
  230. }
  231. .toc-container {
  232. padding: 1.5rem;
  233. margin: 3rem 0;
  234. background: #f9f9f9;
  235. border: 1px solid #aaa;
  236. border-radius: 5px;
  237. ul {
  238. margin-bottom: 0;
  239. list-style: disc;
  240. a {
  241. color: var(--sub-color);
  242. text-decoration: none;
  243. }
  244. }
  245. .title {
  246. display: block;
  247. margin-left: 1rem;
  248. margin-bottom: 0.5rem !important;
  249. font-size: 1.25rem;
  250. color: #000;
  251. }
  252. }
  253. h2 {
  254. padding-left: 1rem;
  255. margin: 5rem 0 1.5rem;
  256. border-left: 7px solid var(--sub-color);
  257. }
  258. h4 {
  259. margin-top: 3rem;
  260. font-size: 1.25rem;
  261. font-weight: 500;
  262. line-height: 32px;
  263. a {
  264. padding: 5px 8px;
  265. margin-right: 3px;
  266. border: 1px solid #000;
  267. border-radius: 5px;
  268. font-size: 14px;
  269. &:hover {
  270. color: #fff !important;
  271. }
  272. }
  273. }
  274. .back-link {
  275. color: #000;
  276. display: block;
  277. text-align: center;
  278. text-decoration: none;
  279. transition: all 0.3s;
  280. &:hover {
  281. opacity: 0.7;
  282. }
  283. }
  284. }
  285. /* single.html End */
  286. /* content.html Start */
  287. .news-main {
  288. height: 100%;
  289. overflow: hidden;
  290. a {
  291. text-decoration: none;
  292. }
  293. .title-info {
  294. position: absolute;
  295. bottom: 0;
  296. left: 0;
  297. right: 0;
  298. z-index: 10;
  299. padding: 1rem;
  300. background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 50%, rgba(0, 0, 0, 0.3) 80%, transparent 100%);
  301. a,
  302. h2,
  303. small {
  304. color: #fff;
  305. letter-spacing: 1px;
  306. }
  307. h2 {
  308. line-height: 1.5;
  309. a {
  310. font-weight: 500;
  311. font-size: 1.5rem;
  312. display: -webkit-box;
  313. -webkit-box-orient: vertical;
  314. -webkit-line-clamp: 2; // 顯示兩行
  315. overflow: hidden;
  316. text-overflow: ellipsis;
  317. word-break: break-word;
  318. @media (max-width: 991px) {
  319. font-size: 1.25rem;
  320. }
  321. }
  322. }
  323. .badge-link {
  324. display: inline-block;
  325. padding: 1px 20px;
  326. margin-bottom: 10px;
  327. background-color: var(--sub-color);
  328. font-weight: 500;
  329. }
  330. }
  331. .post-title {
  332. a {
  333. font-size: 34px;
  334. }
  335. }
  336. img {
  337. height: 100%;
  338. object-fit: cover;
  339. }
  340. // .main-img {
  341. // @media (max-width: 991px) {
  342. // height: 50vw;
  343. // }
  344. // }
  345. .news-info {
  346. a {
  347. font-size: 16px;
  348. }
  349. }
  350. }
  351. // .news-main {
  352. // height: 100%;
  353. // overflow: hidden;
  354. // .post-title {
  355. // a {
  356. // font-size: 34px;
  357. // @media (max-width: 991px) {
  358. // font-size: 22px;
  359. // }
  360. // }
  361. // }
  362. // img {
  363. // height: 100%;
  364. // object-fit: cover;
  365. // }
  366. // .news-info {
  367. // a {
  368. // font-size: 16px;
  369. // }
  370. // }
  371. // }
  372. /* content.html End */
  373. /* focus.html Start */
  374. .focus-content {
  375. position: sticky;
  376. top: 20px;
  377. }
  378. .focus-content,
  379. .news-featured {
  380. img {
  381. height: 5vw;
  382. object-fit: cover;
  383. @media (max-width: 991px) {
  384. height: 15vw;
  385. }
  386. }
  387. .post-title {
  388. // 超過則省略
  389. overflow: hidden;
  390. text-overflow: ellipsis;
  391. display: -webkit-box;
  392. -webkit-line-clamp: 2;
  393. -webkit-box-orient: vertical;
  394. line-break: after-white-space;
  395. font-size: 1.125rem;
  396. }
  397. }
  398. /* focus.html End */
  399. /* recent.html Start */
  400. .recent-content {
  401. .news-list {
  402. margin: 0;
  403. li {
  404. margin: 15px 0;
  405. img {
  406. width: 140px;
  407. height: 105px;
  408. object-fit: cover;
  409. }
  410. small {
  411. display: block;
  412. }
  413. .news-info {
  414. margin-top: 0px;
  415. }
  416. }
  417. li:last-child {
  418. margin: 0;
  419. }
  420. }
  421. }
  422. /* recent.html End */
  423. /* news-tab.html Start */
  424. .tab-category {
  425. .nav-link {
  426. color: var(--main-color);
  427. font-weight: 500;
  428. }
  429. .nav-pills .nav-link.active,
  430. .nav-pills .show>.nav-link {
  431. color: var(--sub-color);
  432. background-color: var(--main-color);
  433. }
  434. }
  435. .tab-content {
  436. .bg-img {
  437. position: relative;
  438. height: 370px;
  439. // 設置背景混和模式為相乘模式
  440. background-blend-mode: multiply;
  441. background-size: cover;
  442. background-position: center center;
  443. cursor: pointer;
  444. @media (max-width: 991px) {
  445. height: 50vw;
  446. }
  447. section {
  448. padding: 10px 25px;
  449. position: absolute;
  450. bottom: 0;
  451. color: #fff;
  452. a {
  453. color: #fff;
  454. text-decoration: none;
  455. }
  456. small {
  457. font-size: 12px;
  458. }
  459. }
  460. }
  461. .col-5 {
  462. img {
  463. height: 150px;
  464. }
  465. }
  466. }
  467. /* news-tab.html End */
  468. /* news-all.html Start */
  469. .news-all {
  470. .post-title {
  471. margin: 5px auto;
  472. a {
  473. font-size: 1.5rem;
  474. display: -webkit-box;
  475. -webkit-box-orient: vertical;
  476. -webkit-line-clamp: 2; // 顯示兩行
  477. overflow: hidden;
  478. text-overflow: ellipsis;
  479. word-break: break-word;
  480. }
  481. }
  482. .news-info {
  483. a {
  484. font-size: 18px;
  485. }
  486. }
  487. hr {
  488. margin: 1.5rem 0;
  489. }
  490. img {
  491. height: 12vw;
  492. object-fit: cover;
  493. @media (max-width: 991px) {
  494. height: 20vw;
  495. }
  496. @media (max-width: 575px) {
  497. height: 50vw;
  498. }
  499. }
  500. .line {
  501. padding: 0 12px;
  502. }
  503. // .first-img {
  504. // height: 50vh;
  505. // object-fit: cover;
  506. // }
  507. }
  508. /* news-all.html End */
  509. /* news-featured.html Start */
  510. .news-featured {
  511. position: sticky;
  512. top: 20px;
  513. }
  514. /* news-featured.html End */
  515. /* news-video.html Start */
  516. .news-video {
  517. .post-block-title {
  518. span {
  519. display: block;
  520. width: 100%;
  521. text-align: center;
  522. }
  523. }
  524. .post-title {
  525. a {
  526. font-size: 18px;
  527. display: -webkit-box;
  528. -webkit-line-clamp: 2;
  529. -webkit-box-orient: vertical;
  530. overflow: hidden;
  531. text-overflow: ellipsis;
  532. }
  533. }
  534. .news-info {
  535. a {
  536. font-size: 14px;
  537. }
  538. }
  539. }
  540. /* news-video.html End */
  541. .news-main {
  542. .left-content {
  543. height: 45vh;
  544. }
  545. .right-content {
  546. height: 55vh;
  547. }
  548. .bottom-content {
  549. height: 35vh;
  550. }
  551. .left-content,
  552. .right-content,
  553. .bottom-content {
  554. @media (max-width: 991px) {
  555. height: 50vw;
  556. }
  557. }
  558. // /* 限制輪播高度 */
  559. // .video-swiper {
  560. // height: 650px;
  561. // /* 固定高度,讓 vertical 不會跑版 */
  562. // overflow: hidden;
  563. // /* 確保 slide 高度自適應 */
  564. // .swiper-slide {
  565. // height: auto !important;
  566. // .cover-img {
  567. // height: auto;
  568. // }
  569. // }
  570. // }
  571. }