Welcome to the gallery showcasing a unique calendar design with tooltip functionality. This calendar features a special hover effect for New Year's Day on January 1st, displaying a tooltip text upon interaction. Feel free to explore the code below to see how this interactive calendar is implemented!
table {
border-collapse: collapse;
border-spacing: 0;
}
thead {
width: 300px !important;
}
td {
padding: 0;
}
.container {
font: 87.5%/1.5em 'Lato', sans-serif;
left: 50%;
background: #ccc;
position: fixed;
top: 50%;
width: 300px;
transform: translate(-50%, -50%);
}
.calendar-container {
position: relative;
}
.calendar-container header {
border-radius: 1em 1em 0 0;
background: #e66b6b;
color: #fff;
text-align: center;
width: 402px;
}
.newyear .tooltiptext {
visibility: hidden;
width: 120px;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 0;
position: absolute;
z-index: 1;
bottom: 125%;
left: 50%;
margin-left: -60px;
opacity: 0;
transition: opacity 1s;
}
.newyear .tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #555 transparent transparent transparent;
}
.newyear:hover .tooltiptext {
visibility: visible;
opacity: 1;
}
.month {
font-size: 3em;
line-height: 1em;
width: 300px;
text-align: center;
padding-bottom: 10px;
}
.calendar {
background: #fff;
border-radius: 0 0 1em 1em;
-webkit-box-shadow: 0 2px 1px rgba(0, 0, 0, .2), 0 3px 1px #fff;
box-shadow: 0 2px 1px rgba(0, 0, 0, .2), 0 3px 1px #fff;
color: #555;
display: inline-block;
padding: 2px;
}
.calendar thead {
color: #e66b6b;
font-weight: 700;
text-transform: uppercase;
}
.calendar td {
padding: .5em 1em;
text-align: center;
}
.calendar tbody td:hover {
background: #cacaca;
}
.current-day {
color: #e66b6b;
background: #cacaca;
font-weight: bolder;
}
.prev-month,
.next-month {
color: #cacaca;
}
<div class="container">
<div class="calendar-container">
<header>
<div class="month">Januar</div>
</header>
<table class="calendar">
<thead>
<tr>
<td>Mon</td>
<td>Tue</td>
<td>Wed</td>
<td>Thu</td>
<td>Fri</td>
<td>Sat</td>
<td>Sun</td>
</tr>
</thead>
<tbody>
<tr>
<td class="prev-month">29</td>
<td class="prev-month">30</td>
<td class="prev-month">31</td>
<td class="newyear">1<span class="tooltiptext">Tooltip text</span> </td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
<tr>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
</tr>
<tr>
<td>12</td>
<td>13</td>
<td>14</td>
<td>15</td>
<td>16</td>
<td>17</td>
<td class="current-day">18</td>
</tr>
<tr>
<td>19</td>
<td>20</td>
<td>21</td>
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
</tr>
<tr>
<td>26</td>
<td>27</td>
<td>28</td>
<td>29</td>
<td>30</td>
<td>31</td>
<td class="next-month">1</td>
</tr>
</tbody>
</table>
</div>
<!-- end calendar-container -->
</div>
<!-- end container -->