پیشنمایش زنده
کد HTML
<input type="checkbox" id="night-mode-toggle" />
<div class="calendar">
<div class="header">
<div class="pin"></div>
<p>2026</p>
<div class="pin"></div>
</div>
<div class="hook"></div>
<div class="body">
<div class="month">
<p>03</p>
<p>Mar</p>
</div>
<div class="date">27</div>
<div class="footer">
<div class="fullMonth">
<div class="title">MARCH</div>
<table>
<tbody>
<tr>
<th>S</th>
<th>M</th>
<th>T</th>
<th>W</th>
<th>T</th>
<th>F</th>
<th>S</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
</tr>
<tr>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
</tr>
<tr>
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
<td>21</td>
</tr>
<tr>
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
<td>26</td>
<td class="now">27</td>
<td>28</td>
</tr>
<tr>
<td>29</td>
<td>30</td>
<td>31</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div class="week">
<p class="day">Friday</p>
<p class="lunar">Lunar Feb 9th</p>
</div>
</div>
</div>
</div>
کد CSS
#night-mode-toggle {
display: none;
}
.calendar {
width: 180px;
position: relative;
box-shadow: -10px 5px 10px rgba(0, 0, 0, 0.2);
background: #fff;
}
.calendar::after {
content: "";
display: block;
position: absolute;
top: -2px;
left: -8px;
width: 8px;
height: 100%;
background: #bbb;
transform: skew(0, 20deg);
border-left: 1px solid #999;
}
.header {
padding: 5px 10px;
background: #e3e3e3;
color: #aaa;
display: flex;
justify-content: space-between;
align-items: center;
z-index: 2;
}
.header p {
margin: 0;
font-size: 11px;
font-weight: bold;
}
.pin {
width: 15px;
height: 15px;
background: #f6f6f6;
border-radius: 50%;
}
.hook {
width: 80%;
height: 25px;
background: linear-gradient(0deg, rgba(163, 163, 163, 0.3) 0%, #e3e3e3 100%);
position: absolute;
z-index: 1;
left: 7%;
top: -28px;
border-radius: 4px 4px 0 0;
}
.hook::before {
content: "";
position: absolute;
inset: 0;
margin: auto;
width: 10px;
height: 12px;
background: var(--bgLight);
border-radius: 100%;
}
.body {
background: linear-gradient(-30deg, #fff 20%, #f8f8f8 70%);
padding: 15px 15px 10px;
color: var(--mainColor);
position: relative;
z-index: 3;
}
.body::before,
.body::after {
content: "";
position: absolute;
left: 0;
top: 50%;
width: 4px;
height: 10px;
}
.body::before {
background: var(--secondColor);
margin-top: -10px;
}
.body::after {
background: var(--mainColor);
}
.month {
font-weight: bold;
font-size: 11px;
text-transform: uppercase;
}
.month p {
margin: 0;
}
.date {
font-size: 110px;
font-weight: 700;
text-align: center;
color: var(--secondColor);
font-family: "Anton";
margin: -20px 0 0 5px;
transform: scale(1, 0.9);
letter-spacing: 2px;
}
.footer {
display: flex;
justify-content: space-between;
margin-top: 5px;
}
.fullMonth {
width: 35%;
}
.fullMonth .title {
font-size: 7px;
font-weight: bold;
color: #888;
}
.fullMonth table {
font-size: 6px;
border-collapse: collapse;
transform: scale(0.95);
transform-origin: left top;
color: #666;
}
.fullMonth th {
color: var(--secondColor);
}
.fullMonth .now {
background: var(--secondColor);
color: #000;
border-radius: 50%;
}
.week {
text-align: center;
flex: 1;
}
.week .day {
font-size: 18px;
font-weight: bold;
margin: 0;
color: #333;
}
.week .lunar {
font-family: "Oswald";
font-size: 9px;
color: #999;
}
.icons {
display: flex;
flex-direction: column;
gap: 3px;
color: var(--mainColor);
opacity: 0.6;
}
.material-icons {
font-size: 12px;
}