style.css 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. * {
  2. box-sizing: border-box;
  3. }
  4. :root {
  5. --darkest: #171B19;
  6. --dark: #1D2B26;
  7. --med: #2D3B36;
  8. --light: #39574C;
  9. --lightest: #475650;
  10. --size-scale: 50;
  11. --size-scale-px: calc(var(--size-scale) * 1px);
  12. }
  13. body {
  14. margin: 0;
  15. min-height: 100vh;
  16. background-color: var(--light);
  17. color: var(--darkest); /* 為文字顏色添加一個變量 */
  18. font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; /* 選擇一個基本字體 */
  19. }
  20. header {
  21. background-color: var(--darkest);
  22. color: var(--lightest);
  23. padding: 0.25em;
  24. display: flex;
  25. justify-content: space-between;
  26. align-items: center; /* 垂直居中對齊 */
  27. }
  28. header h1 {
  29. margin: 0;
  30. padding: 0;
  31. font-size: 1.5em;
  32. }
  33. .displayNone {
  34. display: none;
  35. }
  36. .card {
  37. display: inline-block;
  38. background: var(--lightest);
  39. box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  40. border-radius: 5px;
  41. overflow: hidden;
  42. max-width: 300px; /* 最大寬度設定 */
  43. /* 你可以根據實際的網站佈局需要調整這個最大寬度 */
  44. }
  45. .card-size-1 { width: 25%; }
  46. .card-size-2 { width: 50%; }
  47. .card-size-3 { width: 75%; }
  48. .card-size-4 { width: 100%; }
  49. .mood-image {
  50. width: 100%; /* 使圖片寬度適應容器 */
  51. height: auto; /* 高度自動 */
  52. object-fit: cover; /* 保持圖片比例,並填滿整個格子 */
  53. }
  54. /* 模態視窗背景樣式 */
  55. .modal {
  56. display: none; /* Hidden by default */
  57. position: fixed; /* Stay in place */
  58. z-index: 1; /* Sit on top */
  59. left: 0;
  60. top: 0;
  61. width: 100%; /* Full width */
  62. height: 100%; /* Full height */
  63. overflow: auto; /* Enable scroll if needed */
  64. background-color: rgb(0,0,0); /* Fallback color */
  65. background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
  66. }
  67. /* 模態視窗內容樣式 */
  68. .modal-content {
  69. background-color: #fefefe;
  70. margin: 15% auto; /* 15% from the top and centered */
  71. padding: 20px;
  72. border: 1px solid #888;
  73. width: 80%; /* Could be more or less, depending on screen size */
  74. }
  75. /* The Close Button */
  76. .close {
  77. color: #aaa;
  78. float: right;
  79. font-size: 28px;
  80. font-weight: bold;
  81. }
  82. .close:hover,
  83. .close:focus {
  84. color: black;
  85. text-decoration: none;
  86. cursor: pointer;
  87. }