-
Notifications
You must be signed in to change notification settings - Fork 0
/
calendar.css
222 lines (198 loc) · 6.98 KB
/
calendar.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
/* 暦 & 簡易ブログ のための CSS
* https://codepen.io/daliannyvieira/pen/EgvbKB を参考に実装
-------------------------------------------------------------------------*/
/* 色
---------------------------------------------------------------------*/
:root {
--wakakusairo: #abc900;
--sorairo: #a0d8ef;
--tokiiro: #f4b3c2;
--botaniro: #e7609e;
--hinomaru: #bc012d;
--kinariiro: #fbfaf5;
--kurobeni: #302833;
--kurobeni_8: #30283380;
}
/* 暦の背景写真
出典: ぱくたそ https://www.pakutaso.com/
pro.foto https://pro-foto.jp/
BEIZ images https://www.beiz.jp/
Pixabay https://pixabay.com/ja/
---------------------------------------------------------------------*/
#wallpaper {
min-width: 345px;
height: 100%;
display: grid;
grid-template-columns: 1fr auto 1fr;
background-attachment: fixed;
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
&[data-month= "1"] { background-image: url("calendar_images/snow.webp"); }
&[data-month= "2"] { background-image: url("calendar_images/grasslands.webp"); }
&[data-month= "3"] { background-image: url("calendar_images/hoursetail.webp"); }
&[data-month= "4"] { background-image: url("calendar_images/cherry.webp"); }
&[data-month= "5"] { background-image: url("calendar_images/leaves.webp"); }
&[data-month= "6"] { background-image: url("calendar_images/water.webp"); }
&[data-month= "7"] { background-image: url("calendar_images/sea.webp"); }
&[data-month= "8"] { background-image: url("calendar_images/sky.webp"); }
&[data-month= "9"] { background-image: url("calendar_images/light.webp"); }
&[data-month="10"] { background-image: url("calendar_images/deodora.webp"); }
&[data-month="11"] { background-image: url("calendar_images/maple.webp"); }
&[data-month="12"] { background-image: url("calendar_images/night.webp"); }
}
/* 暦
---------------------------------------------------------------------*/
#calendar {
grid-column: 2;
grid-row: 2;
width: min(calc(100vw - 20px - 20px), 345px); /* 左右の余白 20px を除いた全ての幅 */
background: var(--kinariiro);
background: #fbfaf5c0;
color: var(--kurobeni);
border-radius: 10px;
font-family: 'Yuji Boku', serif;
font-size: 1.2em;
/* 月ごとの暦の写真 */
.photograph {
aspect-ratio: 16 / 9; /* 横16楯9に設定 */
background-position: center center;
background-size: cover;
&[data-month= "1"] { background-image: url("calendar_images/suisen.webp"); }
&[data-month= "2"] { background-image: url("calendar_images/nanohana.webp"); }
&[data-month= "3"] { background-image: url("calendar_images/momo.webp"); }
&[data-month= "4"] { background-image: url("calendar_images/sakura.webp"); }
&[data-month= "5"] { background-image: url("calendar_images/fuji.webp"); }
&[data-month= "6"] { background-image: url("calendar_images/ajisai.webp"); }
&[data-month= "7"] { background-image: url("calendar_images/hanabi.webp"); }
&[data-month= "8"] { background-image: url("calendar_images/himawari.webp"); }
&[data-month= "9"] { background-image: url("calendar_images/higanbana.webp"); }
&[data-month="10"] { background-image: url("calendar_images/kosumosu.webp"); }
&[data-month="11"] { background-image: url("calendar_images/susuki.webp"); }
&[data-month="12"] { background-image: url("calendar_images/tsubaki.webp"); }
}
}
/* 操作盤
---------------------------------------------------------------------*/
#calendar .panel {
display: grid;
grid-template-columns: 1fr 4fr 3fr 1fr;
grid-template-rows: auto;
text-align: center;
vertical-align: middle;
padding: 10px 10px 0px;
.prev { grid-column: 1; grid-row: 1; }
.year { grid-column: 2; grid-row: 1; }
.month { grid-column: 3; grid-row: 1; }
.next { grid-column: 4; grid-row: 1; }
.prev,
.next { color: var(--kurobeni_8); width: 2em; }
.prev:hover { transform: translateX(-5px); }
.next:hover { transform: translateX( 5px); }
.year,
.month { font-size: larger; }
}
/* 暦の本体
---------------------------------------------------------------------*/
/* _table.css が干渉した結果を、元に戻す */
#calendar table {
th, td { border: none; padding: 0; }
td a { text-decoration: unset; color: unset; }
td a:hover { text-decoration: unset; }
th { width: unset; text-align: unset; text-align-last: unset }
tr:nth-child(odd) th { background: unset; color: unset; }
tr:nth-child(even) th { background: unset; color: unset; }
tr:nth-child(odd) td { background: unset; color: unset; }
tr:nth-child(even) td { background: unset; color: unset; }
}
/* aside.pickup の css を少し調整 */
.post .sidebar aside.pickup { margin: 0; padding: 0; border: none; }
/* 日付欄 */
#calendar table {
min-width: 345px;
height: 346px;
padding: 10px 10px;
text-align: center;
thead {
color: var(--kurobeni_8)
tr th,
tr td {
padding-bottom: .4em;
}
}
a {
/* 色 */
color: #333;
text-decoration: none;
display: block;
margin: 0 auto;
cursor: pointer;
/* 日付を円形にする */
width: 30px;
height: 30px;
line-height: 30px;
border-radius: 50%;
/* カーソルを載せるとほんのり染める */
&:hover {
background: var(--botaniro);
color: var(--kinariiro);
transition: .7s;
transform: scale(1);
}
}
/* 色を付ける */
.today > a { background: var(--botaniro); color: var(--kinariiro); }
.sunday > a { background: var(--tokiiro); }
.saturday > a { background: var(--sorairo); }
.holiday > a { background: var(--hinomaru); color: var(--kinariiro); }
/* ブログ執筆日 */
.blogday a {
outline: 6px double var(--wakakusairo); /* 若草色の輪郭線 */
&:hover {
outline-offset: 7px; /* 少し外側に 若草色の輪郭線 */
outline: 6px double var(--wakakusairo);
transition: .7s;
transform: scale(1);
}
}
}
#calendar {
/* ブログの見出し */
.blog.header {
padding: 0 50px;
font-size: 1.15em;
letter-spacing: 4px;
text-shadow: 3px 3px 3px var(--kurobeni_8), -1px -1px 1px var(--wakakusairo);
}
/* ブログの一覧 */
nav {
width: calc(100% - 20px);
height: 170px;
overflow-y: scroll; /* 縦方向にスクロール */
margin: 0 10px 10px 10px;
border: 3px double var(--wakakusairo);
/* flexbox(一次元)を用いて 最新順に並べる */
ul {
display: flex;
flex-direction: column-reverse;
gap: 0em;
list-style: none;
padding: 0;
text-align: right;
/* ブログ表題が長すぎるときは ... で省略 */
li a {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 1em;
/* カーソルを載せるとほんのり染める */
&:hover {
background: var(--wakakusairo);
color: var(--kinariiro);
transition: .7s;
transform: scale(1);
}
}
}
}
}