Skip to content

Commit caf7c4b

Browse files
committed
Improve sponsor ad hover layout
1 parent 72f0f71 commit caf7c4b

1 file changed

Lines changed: 31 additions & 11 deletions

File tree

theme/pagetoc.css

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
display: none; /*changed via JS once ad is loaded*/
129129
flex-direction: column;
130130
text-decoration: none !important;
131+
overflow: hidden;
131132
backdrop-filter: blur(6px);
132133
}
133134
.sidesponsor img {
@@ -159,12 +160,13 @@
159160
overflow: hidden;
160161
}
161162
.sidesponsor .sponsor-title{
162-
margin-top: 5px;
163-
margin-bottom: 5px;
163+
margin-top: 3px;
164+
margin-bottom: 3px;
164165
margin-left: 15px;
165166
margin-right: 15px;
166167
font-weight: 800;
167168
font-size: 2rem;
169+
line-height: 1.08;
168170
color: var(--sponsor-fg);
169171
}
170172
.sidesponsor:hover .sponsor-title{
@@ -175,29 +177,37 @@
175177
font-size: 1.55rem;
176178
line-height: 1.15;
177179
overflow-wrap: anywhere;
180+
animation: sponsorTextReveal .3s ease .12s both;
178181
}
179182
.sidesponsor .sponsor-description{
180-
display:none;
183+
display: block;
181184
margin-top: 5px;
182185
margin-bottom: 15px;
183186
margin-left: 15px;
184187
margin-right: 15px;
185188
color: var(--sponsor-fg);
186-
transition-property: all;
187-
transition-timing-function: cubic-bezier(.4,0,.2,1);
188-
transition-duration: .3s;
189-
overflow: scroll;
189+
max-height: 0;
190+
opacity: 0;
191+
visibility: hidden;
192+
overflow: hidden;
193+
transition:
194+
opacity .18s ease .14s,
195+
visibility 0s linear .32s;
190196
}
191197
.sidesponsor:hover .sponsor-description{
192-
display:block;
193198
grid-area: sponsor-description;
194199
min-height: 0;
195200
max-height: 100%;
196201
margin-top: 0;
197202
margin-bottom: 0;
198203
font-size: calc(1em - 1px);
204+
opacity: 1;
205+
visibility: visible;
199206
overflow: auto;
200207
overscroll-behavior: contain;
208+
transition:
209+
opacity .18s ease .14s,
210+
visibility 0s linear 0s;
201211
}
202212
.sidesponsor .sponsor-cta{
203213
margin-top: auto;
@@ -209,20 +219,30 @@
209219
border-radius: 8px;
210220
background-color: var(--fg);
211221
color: var(--bg);
222+
font-weight: 800;
212223
}
213224
.sidesponsor:hover .sponsor-cta{
214225
grid-area: sponsor-cta;
215226
margin-top: 0;
216227
margin-bottom: 4px;
217-
padding: 7px 10px;
228+
padding: 10px 14px;
218229
box-sizing: border-box;
219230
max-width: 100%;
220231
overflow: hidden;
221232
text-overflow: ellipsis;
222233
white-space: nowrap;
223-
font-size: 1.08rem;
224-
font-weight: 700;
234+
font-size: 1.2rem;
235+
font-weight: 800;
225236
line-height: 1.1;
237+
animation: sponsorTextReveal .3s ease .12s both;
238+
}
239+
@keyframes sponsorTextReveal {
240+
0%, 45% {
241+
opacity: 0;
242+
}
243+
100% {
244+
opacity: 1;
245+
}
226246
}
227247
.sidesponsor-bsa {
228248
max-height: 40%;

0 commit comments

Comments
 (0)