|
51 | 51 | }
|
52 | 52 |
|
53 | 53 | pre {
|
54 |
| - white-space: pre-wrap; |
55 |
| - word-break: break-all; |
56 |
| - font-family: inherit; |
57 |
| - line-height: normal; /* Reset line-height */ |
58 |
| - margin: 0; /* Remove default margin */ |
59 |
| - padding: 0; /* Remove default padding */ |
60 |
| -} |
| 54 | + white-space: pre; |
| 55 | + word-break: normal; |
| 56 | + font-family: inherit; |
| 57 | + line-height: 1.5; |
| 58 | + margin: 0; |
| 59 | + padding: 0; |
| 60 | + display: flex; |
| 61 | + align-items: center; |
| 62 | + } |
| 63 | + |
| 64 | + main { |
| 65 | + min-width: 300px; |
| 66 | + width: 100%; |
| 67 | + max-width: 600px; |
| 68 | + } |
61 | 69 |
|
| 70 | + table { |
| 71 | + width: 100%; |
| 72 | + border-collapse: collapse; |
| 73 | + table-layout: fixed; |
| 74 | + } |
| 75 | + |
| 76 | + td { |
| 77 | + padding: 2px 0; |
| 78 | + text-align: left; |
| 79 | + vertical-align: top; |
| 80 | + } |
| 81 | + |
| 82 | + td.date { |
| 83 | + white-space: nowrap; |
| 84 | + } |
| 85 | + |
| 86 | + /* Reset table and row styling to default */ |
| 87 | + tr { |
| 88 | + display: table-row; |
| 89 | + } |
| 90 | + |
| 91 | + td { |
| 92 | + display: table-cell; |
| 93 | + } |
| 94 | + |
62 | 95 | a {
|
63 | 96 | color: #2a5db0;
|
64 | 97 | text-decoration: none;
|
|
67 | 100 | a:hover {
|
68 | 101 | text-decoration: underline;
|
69 | 102 | }
|
| 103 | + |
| 104 | + .holiday { |
| 105 | + color: #e67e22; |
| 106 | + font-weight: 600; |
| 107 | + background-color: #fff3e0; |
| 108 | + padding: 2px 8px; |
| 109 | + border-radius: 4px; |
| 110 | + display: inline-block; |
| 111 | + font-size: 0.95rem; |
| 112 | + border: 1px solid #ffd8a8; |
| 113 | + margin-left: 4px; |
| 114 | + } |
70 | 115 |
|
71 |
| -.holiday { |
72 |
| - color: #d35400; |
73 |
| - font-weight: bold; |
74 |
| -} |
| 116 | + /* Visually hidden elements - visible for screen readers and copying */ |
| 117 | + .visually-hidden { |
| 118 | + clip: rect(1px, 1px, 1px, 1px); |
| 119 | + height: 1px; |
| 120 | + width: 1px; |
| 121 | + overflow: hidden; |
| 122 | + position: absolute; |
| 123 | + white-space: pre; |
| 124 | + } |
| 125 | + |
| 126 | + @media (max-width: 480px) { |
| 127 | + table { |
| 128 | + table-layout: fixed; |
| 129 | + width: 100%; |
| 130 | + } |
| 131 | + |
| 132 | + td.date { |
| 133 | + margin-bottom: 2px; |
| 134 | + } |
| 135 | + |
| 136 | + .holiday { |
| 137 | + display: inline-block; |
| 138 | + word-break: break-word; |
| 139 | + max-width: 100%; |
| 140 | + margin-left: 4px; |
| 141 | + } |
| 142 | + } |
75 | 143 |
|
76 | 144 | </style>
|
77 | 145 | </head>
|
|
104 | 172 | </script>
|
105 | 173 | <main>
|
106 | 174 | {{- $previousWeek := -1 }}{{/* Initialize a variable to track the previous week number */}}
|
| 175 | + <table> |
107 | 176 | {{range $day := .Days -}}
|
108 | 177 | {{- $currentWeek := $day.Date | weekNumber }}{{/* Get the current week number */}}
|
109 | 178 | {{- if ne $currentWeek $previousWeek }}{{/* Compare with the previous week number */}}
|
110 |
| - <h2>Week Number: {{$currentWeek}}</h2>{{/* Print the week number if it's different */}} |
| 179 | + <tr><td colspan="2"><h2>Week Number: {{$currentWeek}}</h2></td></tr>{{/* Print the week number if it's different */}} |
111 | 180 | {{- $previousWeek = $currentWeek }}{{/* Update the previous week number */}}
|
112 | 181 | {{- end }}
|
| 182 | + <tr> |
113 | 183 | {{- if eq ($day.Date.Format "2006-01-02") ($.Now.Format "2006-01-02") }}
|
114 |
| - <pre><strong>{{$day.Date.Format "2006-01-02 Mon"}}</strong></pre> |
| 184 | + <td class="date"><strong>{{$day.Date.Format "2006-01-02 Mon"}}</strong></td> |
| 185 | + {{- else }} |
| 186 | + <td class="date">{{$day.Date.Format "2006-01-02 Mon"}}</td> |
| 187 | + {{- end }} |
| 188 | + {{- if $day.IsHoliday}} |
| 189 | + <td><span class="visually-hidden"> - </span><span class="holiday">{{$day.HolidaySummary}}</span></td> |
115 | 190 | {{- else }}
|
116 |
| - <pre>{{$day.Date.Format "2006-01-02 Mon"}}{{if $day.IsHoliday}}<span class="holiday"> {{$day.HolidaySummary}}</span>{{end}}</pre> |
| 191 | + <td></td> |
117 | 192 | {{- end }}
|
| 193 | + </tr> |
118 | 194 | {{- end }}
|
| 195 | + </table> |
119 | 196 | </main>
|
120 | 197 |
|
121 | 198 | <br>
|
|
0 commit comments