style.scss 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  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. h2 {
  13. margin-bottom: 1rem;
  14. }
  15. p,
  16. li {
  17. line-height: 32px;
  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: 600;
  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: 15px 0 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. h4 {
  229. margin-top: 3rem;
  230. font-size: 1.25rem;
  231. font-weight: 500;
  232. line-height: 32px;
  233. a {
  234. padding: 5px 8px;
  235. margin-right: 3px;
  236. border: 1px solid #000;
  237. border-radius: 5px;
  238. font-size: 14px;
  239. &:hover {
  240. color: #fff !important;
  241. }
  242. }
  243. }
  244. .back-link {
  245. color: #000;
  246. display: block;
  247. text-align: center;
  248. text-decoration: none;
  249. transition: all 0.3s;
  250. &:hover {
  251. opacity: 0.7;
  252. }
  253. }
  254. }
  255. /* single.html End */
  256. /* content.html Start */
  257. .news-main {
  258. height: 100%;
  259. overflow: hidden;
  260. a {
  261. text-decoration: none;
  262. }
  263. .title-info {
  264. position: absolute;
  265. bottom: 0;
  266. left: 0;
  267. right: 0;
  268. z-index: 10;
  269. padding: 1rem;
  270. 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%);
  271. a,
  272. h2,
  273. small {
  274. color: #fff;
  275. letter-spacing: 1px;
  276. }
  277. h2 {
  278. line-height: 1.5;
  279. a {
  280. font-weight: 500;
  281. font-size: 1.5rem;
  282. display: -webkit-box;
  283. -webkit-box-orient: vertical;
  284. -webkit-line-clamp: 2; // 顯示兩行
  285. overflow: hidden;
  286. text-overflow: ellipsis;
  287. word-break: break-word;
  288. @media (max-width: 991px) {
  289. font-size: 1.25rem;
  290. }
  291. }
  292. }
  293. .badge-link {
  294. display: inline-block;
  295. padding: 1px 20px;
  296. margin-bottom: 10px;
  297. background-color: var(--sub-color);
  298. font-weight: 500;
  299. }
  300. }
  301. .post-title {
  302. a {
  303. font-size: 34px;
  304. }
  305. }
  306. img {
  307. height: 100%;
  308. object-fit: cover;
  309. @media (max-width: 575px) {
  310. height: 50vw;
  311. }
  312. }
  313. .main-img {
  314. @media (max-width: 991px) {
  315. height: 50vw;
  316. }
  317. }
  318. .news-info {
  319. a {
  320. font-size: 16px;
  321. }
  322. }
  323. }
  324. /* content.html End */
  325. /* focus.html Start */
  326. .focus-content {
  327. position: sticky;
  328. top: 20px;
  329. }
  330. .focus-content,
  331. .news-featured {
  332. img {
  333. height: 5vw;
  334. object-fit: cover;
  335. @media (max-width: 991px) {
  336. height: 15vw;
  337. }
  338. }
  339. .post-title {
  340. // 超過則省略
  341. overflow: hidden;
  342. text-overflow: ellipsis;
  343. display: -webkit-box;
  344. -webkit-line-clamp: 2;
  345. -webkit-box-orient: vertical;
  346. line-break: after-white-space;
  347. font-size: 1.125rem;
  348. }
  349. }
  350. /* focus.html End */
  351. /* recent.html Start */
  352. .recent-content {
  353. .news-list {
  354. margin: 0;
  355. li {
  356. margin: 15px 0;
  357. img {
  358. width: 140px;
  359. height: 105px;
  360. object-fit: cover;
  361. }
  362. small {
  363. display: block;
  364. }
  365. .news-info {
  366. margin-top: 0px;
  367. }
  368. }
  369. li:last-child {
  370. margin: 0;
  371. }
  372. }
  373. }
  374. /* recent.html End */
  375. /* news-tab.html Start */
  376. .tab-category {
  377. .nav-link {
  378. color: var(--main-color);
  379. font-weight: 500;
  380. }
  381. .nav-pills .nav-link.active,
  382. .nav-pills .show>.nav-link {
  383. color: var(--sub-color);
  384. background-color: var(--main-color);
  385. }
  386. #pills-tab {
  387. position: absolute;
  388. @media (max-width: 767px) {
  389. position: relative;
  390. }
  391. }
  392. }
  393. .tab-content {
  394. .bg-img {
  395. position: relative;
  396. height: 370px;
  397. // 設置背景混和模式為相乘模式
  398. background-blend-mode: multiply;
  399. background-size: cover;
  400. background-position: center center;
  401. cursor: pointer;
  402. @media (max-width: 991px) {
  403. height: 50vw;
  404. }
  405. section {
  406. padding: 10px 25px;
  407. position: absolute;
  408. bottom: 0;
  409. color: #fff;
  410. a {
  411. color: #fff;
  412. text-decoration: none;
  413. }
  414. small {
  415. font-size: 12px;
  416. }
  417. }
  418. }
  419. .col-5 {
  420. img {
  421. height: 150px;
  422. }
  423. }
  424. }
  425. /* news-tab.html End */
  426. /* news-all.html Start */
  427. .news-all {
  428. .post-title {
  429. margin: 5px auto;
  430. a {
  431. font-size: 1.5rem;
  432. display: -webkit-box;
  433. -webkit-box-orient: vertical;
  434. -webkit-line-clamp: 2; // 顯示兩行
  435. overflow: hidden;
  436. text-overflow: ellipsis;
  437. word-break: break-word;
  438. }
  439. }
  440. .news-info {
  441. a {
  442. font-size: 18px;
  443. }
  444. }
  445. hr {
  446. margin: 1.5rem 0;
  447. }
  448. img {
  449. height: 12vw;
  450. object-fit: cover;
  451. @media (max-width: 991px) {
  452. height: 20vw;
  453. }
  454. @media (max-width: 575px) {
  455. height: 50vw;
  456. }
  457. }
  458. .line {
  459. padding: 0 12px;
  460. }
  461. // .first-img {
  462. // height: 50vh;
  463. // object-fit: cover;
  464. // }
  465. }
  466. /* news-all.html End */
  467. /* news-featured.html Start */
  468. .news-featured {
  469. position: sticky;
  470. top: 20px;
  471. }
  472. /* news-featured.html End */
  473. .cover-img {
  474. height: 280px;
  475. object-fit: cover;
  476. }