style.scss 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  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-bottom: 20px;
  102. position: relative;
  103. font-size: 22px;
  104. &::after {
  105. position: absolute;
  106. z-index: -10;
  107. top: 15px;
  108. left: 0;
  109. width: 100%;
  110. height: 0px;
  111. content: "";
  112. border-bottom: 1px solid #929292;
  113. bottom: 5px;
  114. }
  115. span {
  116. font-weight: 500;
  117. background: #fff;
  118. }
  119. }
  120. .news-info {
  121. margin-top: 10px;
  122. line-height: 20px;
  123. a {
  124. font-size: 14px;
  125. font-weight: 500;
  126. color: var(--gray-color);
  127. text-decoration: none;
  128. transition: all 0.3s;
  129. &:hover {
  130. opacity: 0.8;
  131. }
  132. }
  133. small {
  134. color: var(--gray-color);
  135. }
  136. }
  137. .news-thumbnail {
  138. height: 100%;
  139. object-fit: cover;
  140. }
  141. // 文字省略
  142. .line-clamp {
  143. max-width: 150px;
  144. display: -webkit-box;
  145. -webkit-line-clamp: 2;
  146. -webkit-box-orient: vertical;
  147. overflow: hidden;
  148. text-overflow: ellipsis;
  149. }
  150. .post-depiction {
  151. // max-width: 350px;
  152. margin: 10px 0;
  153. display: -webkit-box;
  154. -webkit-line-clamp: 2;
  155. -webkit-box-orient: vertical;
  156. overflow: hidden;
  157. text-overflow: ellipsis;
  158. line-height: 26px;
  159. a {
  160. color: #7a7a7a;
  161. text-decoration: none;
  162. }
  163. }
  164. .top-btn {
  165. position: fixed;
  166. bottom: 15px;
  167. right: 15px;
  168. z-index: 10;
  169. opacity: 0; // scrollTop = 0
  170. transition: all 0.5s;
  171. button {
  172. border: none;
  173. background: var(--sub-color);
  174. border-radius: 100px;
  175. width: 55px;
  176. height: 55px;
  177. }
  178. }
  179. .show {
  180. opacity: 1; // scrollTop > 100
  181. }
  182. .blog-header {
  183. .nav-item {
  184. padding: 0 0.3rem;
  185. @media (max-width: 575px) {
  186. padding: 0 1rem;
  187. }
  188. }
  189. }
  190. /* sidebar.html Start */
  191. .news-sidebar {
  192. position: sticky;
  193. top: 15px;
  194. .news-featured {
  195. position: unset;
  196. }
  197. }
  198. .search-btn {
  199. border: 1px solid var(--main-color) !important;
  200. svg {
  201. color: var(--main-color);
  202. }
  203. &:hover {
  204. background-color: var(--main-color) !important;
  205. svg {
  206. color: #fff;
  207. }
  208. }
  209. }
  210. .tags {
  211. margin: 0 5px 5px 0;
  212. padding: 7px 10px !important;
  213. font-size: 14px !important;
  214. font-weight: 400 !important;
  215. color: var(--main-color) !important;
  216. border: 1px solid var(--main-color) !important;
  217. &:hover {
  218. color: #fff !important;
  219. background-color: var(--main-color);
  220. }
  221. }
  222. /* sidebar.html End */
  223. /* single.html Start */
  224. .blog-post.content {
  225. h4 {
  226. margin-top: 3rem;
  227. font-size: 1.25rem;
  228. font-weight: 500;
  229. line-height: 32px;
  230. a {
  231. padding: 5px 8px;
  232. margin-right: 3px;
  233. border: 1px solid #000;
  234. border-radius: 5px;
  235. font-size: 14px;
  236. &:hover {
  237. color: #fff !important;
  238. }
  239. }
  240. }
  241. .back-link {
  242. color: #000;
  243. display: block;
  244. text-align: center;
  245. text-decoration: none;
  246. transition: all 0.3s;
  247. &:hover {
  248. opacity: 0.7;
  249. }
  250. }
  251. }
  252. /* single.html End */
  253. /* content.html Start */
  254. .news-main {
  255. height: 100%;
  256. overflow: hidden;
  257. .post-title {
  258. a {
  259. font-size: 34px;
  260. }
  261. }
  262. img {
  263. height: 100%;
  264. object-fit: cover;
  265. }
  266. .news-info {
  267. a {
  268. font-size: 16px;
  269. }
  270. }
  271. }
  272. /* content.html End */
  273. /* focus.html Start */
  274. .focus-content {
  275. position: sticky;
  276. top: 20px;
  277. }
  278. .focus-content,
  279. .news-featured {
  280. img {
  281. height: 175px;
  282. object-fit: cover;
  283. }
  284. .post-title {
  285. // 超過則省略
  286. overflow: hidden;
  287. text-overflow: ellipsis;
  288. display: -webkit-box;
  289. -webkit-line-clamp: 2;
  290. -webkit-box-orient: vertical;
  291. line-break: after-white-space;
  292. }
  293. }
  294. /* focus.html End */
  295. /* recent.html Start */
  296. .recent-content {
  297. .news-list {
  298. margin: 0;
  299. li {
  300. margin: 15px 0;
  301. img {
  302. width: 140px;
  303. height: 105px;
  304. object-fit: cover;
  305. }
  306. small {
  307. display: block;
  308. }
  309. .news-info {
  310. margin-top: 0px;
  311. }
  312. }
  313. li:last-child {
  314. margin: 0;
  315. }
  316. }
  317. }
  318. /* recent.html End */
  319. /* news-tab.html Start */
  320. .tab-category {
  321. .nav-link {
  322. color: var(--main-color);
  323. font-weight: 500;
  324. }
  325. .nav-pills .nav-link.active,
  326. .nav-pills .show > .nav-link {
  327. color: var(--sub-color);
  328. background-color: var(--main-color);
  329. }
  330. }
  331. .tab-content {
  332. .bg-img {
  333. position: relative;
  334. height: 370px;
  335. // 設置背景混和模式為相乘模式
  336. background-blend-mode: multiply;
  337. background-size: cover;
  338. background-position: center center;
  339. cursor: pointer;
  340. section {
  341. padding: 10px 25px;
  342. position: absolute;
  343. bottom: 0;
  344. color: #fff;
  345. a {
  346. color: #fff;
  347. text-decoration: none;
  348. }
  349. small {
  350. font-size: 12px;
  351. }
  352. }
  353. }
  354. .col-5 {
  355. img {
  356. height: 150px;
  357. }
  358. }
  359. }
  360. /* news-tab.html End */
  361. /* news-all.html Start */
  362. .news-all {
  363. .post-title {
  364. margin: 5px auto;
  365. a {
  366. font-size: 36px;
  367. line-height: 1.5;
  368. display: -webkit-box;
  369. -webkit-line-clamp: 2; /* 限制最多兩行 */
  370. -webkit-box-orient: vertical;
  371. overflow: hidden;
  372. text-overflow: ellipsis;
  373. word-break: break-word;
  374. transition: all 0.3s;
  375. &:hover {
  376. opacity: 0.7;
  377. }
  378. }
  379. }
  380. .post-description {
  381. text-decoration: none;
  382. transition: all 0.3s;
  383. &:hover {
  384. opacity: 0.7;
  385. }
  386. p {
  387. color: #727272;
  388. }
  389. }
  390. .news-info {
  391. a {
  392. font-size: 18px;
  393. }
  394. }
  395. hr {
  396. margin: 1.5rem 0;
  397. }
  398. .first-img {
  399. height: 50vh;
  400. object-fit: cover;
  401. }
  402. .line {
  403. padding: 0 12px;
  404. }
  405. .cover-img {
  406. width: 100%;
  407. height: 220px;
  408. object-fit: cover;
  409. }
  410. }
  411. /* news-all.html End */
  412. /* news-featured.html Start */
  413. .news-featured {
  414. position: sticky;
  415. top: 20px;
  416. }
  417. /* news-featured.html End */
  418. .cover-img {
  419. height: 280px;
  420. object-fit: cover;
  421. }