style.scss 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  1. /* 共通樣式 */
  2. :root {
  3. --main-color: #000;
  4. --sub-color: #e47140;
  5. --gray-color: #727272;
  6. }
  7. * {
  8. letter-spacing: 1px;
  9. font-weight: 300;
  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. ol {
  20. padding: 0;
  21. }
  22. img {
  23. width: 100%;
  24. height: auto;
  25. }
  26. html,
  27. body {
  28. height: 100%;
  29. margin: 0;
  30. }
  31. body {
  32. display: flex;
  33. flex-direction: column;
  34. overflow-y: scroll;
  35. }
  36. .btn:focus,
  37. .form-control:focus {
  38. border-color: var(--main-color) !important;
  39. box-shadow: none !important;
  40. outline: 0 none !important;
  41. }
  42. .badge {
  43. font-weight: 400 !important;
  44. }
  45. .w-90 {
  46. width: 95%;
  47. margin: 0 auto;
  48. }
  49. .navbar {
  50. background-color: #000 !important;
  51. .navbar-nav .nav-item .nav-link {
  52. color: #fff;
  53. }
  54. .navbar-collapse {
  55. flex-grow: 0;
  56. }
  57. .navbar-brand {
  58. font-size: 24px;
  59. font-weight: 100;
  60. font-family: "Roboto Slab", serif !important;
  61. color: #fff;
  62. transition: all 0.3s;
  63. &:hover {
  64. opacity: 0.9;
  65. color: var(--sub-color);
  66. }
  67. }
  68. }
  69. .blog-post-tags {
  70. .badge {
  71. background-color: var(--main-color);
  72. &:hover {
  73. color: var(--main-color);
  74. background-color: #fff;
  75. // border: 1px solid var(--main-color);
  76. }
  77. }
  78. }
  79. .blog-post-title {
  80. margin: 10px 0 20px;
  81. a {
  82. font-size: 50px;
  83. font-weight: 600;
  84. @media (max-width: 991px) {
  85. font-size: 36px;
  86. }
  87. }
  88. }
  89. .pagination {
  90. justify-content: center;
  91. .page-link {
  92. color: var(--main-color);
  93. }
  94. .page-item.active .page-link {
  95. z-index: 3;
  96. color: #fff;
  97. background-color: var(--main-color);
  98. border-color: var(--main-color);
  99. }
  100. }
  101. .post-title {
  102. line-height: 24px;
  103. a {
  104. color: #000;
  105. text-decoration: none;
  106. font-size: 22px;
  107. font-weight: 500;
  108. }
  109. }
  110. .post-block-title {
  111. margin-bottom: 20px;
  112. position: relative;
  113. font-size: 22px;
  114. &::after {
  115. position: absolute;
  116. z-index: -10;
  117. top: 15px;
  118. left: 0;
  119. width: 100%;
  120. height: 0px;
  121. content: "";
  122. border-bottom: 1px solid #929292;
  123. bottom: 5px;
  124. }
  125. span {
  126. font-weight: 500;
  127. background: #fff;
  128. }
  129. }
  130. .news-info {
  131. margin-top: 10px;
  132. display: flex;
  133. justify-content: space-between;
  134. line-height: 20px;
  135. a {
  136. font-size: 14px;
  137. font-weight: 500;
  138. color: var(--gray-color);
  139. text-decoration: none;
  140. transition: all 0.3s;
  141. &:hover {
  142. opacity: 0.8;
  143. }
  144. }
  145. small {
  146. margin-left: 10px;
  147. color: var(--gray-color);
  148. }
  149. }
  150. .news-thumbnail {
  151. height: 100%;
  152. object-fit: cover;
  153. }
  154. // 文字省略
  155. .line-clamp {
  156. max-width: 150px;
  157. display: -webkit-box;
  158. -webkit-line-clamp: 2;
  159. -webkit-box-orient: vertical;
  160. overflow: hidden;
  161. text-overflow: ellipsis;
  162. }
  163. .post-depiction {
  164. // max-width: 350px;
  165. margin: 10px 0;
  166. display: -webkit-box;
  167. -webkit-line-clamp: 2;
  168. -webkit-box-orient: vertical;
  169. overflow: hidden;
  170. text-overflow: ellipsis;
  171. line-height: 26px;
  172. a {
  173. color: #7a7a7a;
  174. text-decoration: none;
  175. }
  176. }
  177. .top-btn {
  178. position: fixed;
  179. bottom: 15px;
  180. right: 15px;
  181. z-index: 10;
  182. opacity: 0; // scrollTop = 0
  183. transition: all .5s;
  184. button {
  185. border: none;
  186. background: var(--sub-color);
  187. border-radius: 100px;
  188. width: 55px;
  189. height: 55px;
  190. }
  191. }
  192. .show {
  193. opacity: 1; // scrollTop > 100
  194. }
  195. /* sidebar.html Start */
  196. .news-sidebar {
  197. position: sticky;
  198. top: 15px;
  199. .news-featured {
  200. position: unset;
  201. }
  202. }
  203. .search-btn {
  204. border: 1px solid var(--main-color) !important;
  205. svg {
  206. color: var(--main-color);
  207. }
  208. &:hover {
  209. background-color: var(--main-color) !important;
  210. svg {
  211. color: #fff;
  212. }
  213. }
  214. }
  215. .tags {
  216. margin: 0 5px 5px 0;
  217. padding: 7px 10px !important;
  218. font-size: 14px !important;
  219. font-weight: 400 !important;
  220. color: var(--main-color) !important;
  221. border: 1px solid var(--main-color) !important;
  222. &:hover {
  223. color: #fff !important;
  224. background-color: var(--main-color);
  225. }
  226. }
  227. /* sidebar.html End */
  228. /* single.html Start */
  229. .blog-post.content {
  230. h2 {
  231. line-height: 46px;
  232. }
  233. h4 {
  234. font-size: 16px;
  235. font-weight: 300;
  236. line-height: 32px;
  237. a {
  238. padding: 5px 8px;
  239. margin-right: 3px;
  240. border: 1px solid #000;
  241. border-radius: 5px;
  242. font-size: 14px;
  243. &:hover {
  244. color: #fff !important;
  245. }
  246. }
  247. }
  248. .back-link {
  249. color: #000;
  250. display: block;
  251. text-align: center;
  252. text-decoration: none;
  253. transition: all 0.3s;
  254. &:hover {
  255. opacity: 0.7;
  256. }
  257. }
  258. }
  259. /* single.html End */
  260. /* content.html Start */
  261. .news-main {
  262. // height: 100%;
  263. overflow: hidden;
  264. @media (max-width: 991px) {
  265. display: flex;
  266. flex-direction: column-reverse;
  267. margin-top: 8px;
  268. }
  269. .post-title {
  270. line-height: 46px;
  271. @media (max-width: 991px) {
  272. line-height: 30px;
  273. }
  274. a {
  275. font-size: 34px;
  276. @media (max-width: 991px) {
  277. font-size: 22px;
  278. }
  279. }
  280. }
  281. img {
  282. // height: 100%;
  283. object-fit: cover;
  284. }
  285. }
  286. /* content.html End */
  287. /* recent.html Start */
  288. .recent-content {
  289. .news-list {
  290. margin: 0;
  291. li {
  292. margin: 15px 0;
  293. img {
  294. width: 140px;
  295. height: 105px;
  296. object-fit: cover;
  297. }
  298. small {
  299. display: block;
  300. }
  301. .news-info {
  302. margin-top: 0px;
  303. }
  304. }
  305. li:last-child {
  306. margin: 0;
  307. }
  308. }
  309. }
  310. /* recent.html End */
  311. /* news-tab.html Start */
  312. .tab-category {
  313. .nav-link {
  314. color: var(--main-color);
  315. font-weight: 500;
  316. }
  317. .nav-pills .nav-link.active,
  318. .nav-pills .show>.nav-link {
  319. color: var(--sub-color);
  320. background-color: var(--main-color);
  321. }
  322. }
  323. .tab-content {
  324. .bg-img {
  325. position: relative;
  326. height: 370px;
  327. // 設置背景混和模式為相乘模式
  328. background-blend-mode: multiply;
  329. background-size: cover;
  330. background-position: center center;
  331. cursor: pointer;
  332. section {
  333. padding: 10px 25px;
  334. position: absolute;
  335. bottom: 0;
  336. color: #fff;
  337. a {
  338. color: #fff;
  339. text-decoration: none;
  340. }
  341. small {
  342. font-size: 12px;
  343. }
  344. }
  345. }
  346. }
  347. /* news-tab.html End */
  348. /* news-all.html Start */
  349. .news-all {
  350. img {
  351. object-fit: cover;
  352. max-height: 300px;
  353. }
  354. .post-title {
  355. margin: 5px auto;
  356. line-height: 46px;
  357. @media (max-width: 767px) {
  358. line-height: 40px;
  359. }
  360. a {
  361. // 超過兩行則省略
  362. overflow: hidden;
  363. text-overflow: ellipsis;
  364. display: -webkit-box;
  365. -webkit-line-clamp: 1;
  366. -webkit-box-orient: vertical;
  367. line-break: after-white-space;
  368. font-size: 28px;
  369. @media (max-width: 767px) {
  370. font-size: 26px;
  371. }
  372. }
  373. }
  374. .news-info {
  375. a {
  376. font-size: 18px;
  377. }
  378. }
  379. hr {
  380. margin: 1.5rem 0;
  381. }
  382. .line {
  383. padding: 0 12px;
  384. }
  385. }
  386. .cover-img {
  387. max-height: 250px;
  388. object-fit: cover;
  389. }
  390. /* news-all.html End */
  391. /* news-featured.html Start */
  392. .news-featured {
  393. position: sticky;
  394. top: 20px;
  395. }
  396. .news-featured,
  397. .focus-content {
  398. img {
  399. object-fit: cover;
  400. @media (max-width: 991px) {
  401. height: 370px;
  402. }
  403. @media (max-width: 767px) {
  404. height: 300px;
  405. }
  406. }
  407. }
  408. .post-container {
  409. display: flex;
  410. justify-content: space-between;
  411. align-items: center;
  412. }
  413. .post-title {
  414. margin: 0;
  415. /* 可以消除標題的預設邊距 */
  416. }
  417. .news-post {
  418. display: flex;
  419. justify-content: end;
  420. a {
  421. font-size: 14px;
  422. font-weight: 500;
  423. color: var(--gray-color);
  424. text-decoration: none;
  425. transition: all .3s;
  426. &:hover {
  427. opacity: .8;
  428. }
  429. }
  430. small {
  431. margin-left: 10px;
  432. }
  433. }
  434. /* news-featured.html End */