Skip to content

Commit 7f22aea

Browse files
committed
docs: add SerpApi sponsor banner
1 parent 6305246 commit 7f22aea

4 files changed

Lines changed: 179 additions & 0 deletions

File tree

site/assets/scss/_styles_project.scss

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
:root,
1717
[data-bs-theme="light"] {
18+
--restish-sponsor-height: 3.5rem;
1819
--restish-pink: #ff4dbd;
1920
--restish-teal: #2dd4bf;
2021
--restish-amber: #fbbf24;
@@ -103,6 +104,125 @@
103104
box-shadow: 0 1px 0 rgba(23, 21, 17, 0.08);
104105
}
105106

107+
.restish-sponsor {
108+
background: linear-gradient(117deg, #377fea 0%, #6937ea 100%);
109+
color: #fff;
110+
}
111+
112+
.restish-sponsor__link {
113+
display: flex;
114+
align-items: center;
115+
gap: 1rem;
116+
width: calc(100% - 2rem);
117+
max-width: 86rem;
118+
min-height: var(--restish-sponsor-height);
119+
margin: 0 auto;
120+
padding: 0.65rem 0;
121+
color: #fff;
122+
text-decoration: none;
123+
}
124+
125+
.restish-sponsor__link:hover,
126+
.restish-sponsor__link:focus {
127+
color: #fff;
128+
text-decoration: none;
129+
}
130+
131+
.restish-sponsor__link:focus-visible {
132+
outline: 2px solid #fff;
133+
outline-offset: -3px;
134+
}
135+
136+
.restish-sponsor__label {
137+
flex: 0 0 auto;
138+
padding: 0.2rem 0.45rem;
139+
border: 1px solid rgba(255, 255, 255, 0.55);
140+
border-radius: 999px;
141+
font-size: 0.7rem;
142+
font-weight: 700;
143+
letter-spacing: 0.06em;
144+
line-height: 1;
145+
text-transform: uppercase;
146+
}
147+
148+
.restish-sponsor__logo {
149+
flex: 0 0 auto;
150+
width: 7.5rem;
151+
height: auto;
152+
}
153+
154+
.restish-sponsor__copy {
155+
display: flex;
156+
flex: 1 1 auto;
157+
flex-direction: column;
158+
min-width: 0;
159+
font-size: 0.82rem;
160+
line-height: 1.25;
161+
}
162+
163+
.restish-sponsor__copy strong {
164+
font-size: 0.95rem;
165+
}
166+
167+
.restish-sponsor__cta {
168+
flex: 0 0 auto;
169+
font-size: 0.82rem;
170+
font-weight: 700;
171+
white-space: nowrap;
172+
}
173+
174+
@media (min-width: 768px) {
175+
.restish-sponsor {
176+
position: fixed;
177+
top: 4rem;
178+
left: 0;
179+
z-index: 31;
180+
width: 100%;
181+
min-height: var(--restish-sponsor-height);
182+
}
183+
184+
.td-404 main,
185+
.td-main main {
186+
padding-top: calc(var(--td-main-padding-top) + 4rem + var(--restish-sponsor-height));
187+
}
188+
189+
.td-sidebar {
190+
margin-top: calc(4rem + var(--restish-sponsor-height));
191+
}
192+
193+
.td-sidebar__inner {
194+
top: calc(4rem + var(--restish-sponsor-height));
195+
}
196+
197+
.td-sidebar-toc {
198+
top: calc(4rem + var(--restish-sponsor-height));
199+
height: calc(100vh - 4rem - var(--restish-sponsor-height));
200+
margin-top: calc(4rem + var(--restish-sponsor-height));
201+
}
202+
203+
}
204+
205+
@media (max-width: 767.98px) {
206+
.restish-sponsor__link {
207+
gap: 0.7rem;
208+
min-height: 3.5rem;
209+
}
210+
211+
.restish-sponsor__label,
212+
.restish-sponsor__copy > span,
213+
.restish-sponsor__cta {
214+
display: none;
215+
}
216+
217+
.restish-sponsor__logo {
218+
width: 6.5rem;
219+
}
220+
221+
.restish-sponsor__copy strong {
222+
font-size: 0.82rem;
223+
}
224+
}
225+
106226
.td-content a {
107227
color: var(--restish-link-color);
108228
text-decoration-color: rgba(255, 95, 135, 0.35);
@@ -2538,6 +2658,21 @@ body.td-home .td-default main > section.restish-hero:first-of-type {
25382658
padding: clamp(3.75rem, 7vw, 5.75rem) clamp(1rem, 2vw, 1.75rem) clamp(1rem, 2vw, 1.75rem);
25392659
}
25402660

2661+
@media (min-width: 768px) {
2662+
body.td-home .td-default main > section.restish-hero:first-of-type {
2663+
padding-top: calc(clamp(3.75rem, 7vw, 5.75rem) + var(--restish-sponsor-height));
2664+
}
2665+
2666+
.td-content h1[id],
2667+
.td-content h2[id],
2668+
.td-content h3[id],
2669+
.td-content h4[id],
2670+
.td-content h5[id],
2671+
.td-content h6[id] {
2672+
scroll-margin-top: calc(5.5rem + var(--restish-sponsor-height));
2673+
}
2674+
}
2675+
25412676
.restish-hero__shell {
25422677
position: relative;
25432678
overflow: hidden;

site/layouts/_partials/navbar.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,4 @@
7474
</div>
7575
</div>
7676
</nav>
77+
{{ partial "sponsor-banner.html" . }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<aside class="restish-sponsor" aria-label="Sponsor">
2+
<a
3+
class="restish-sponsor__link"
4+
href="https://serpapi.com/?utm_source=restish"
5+
target="_blank"
6+
rel="sponsored noopener"
7+
>
8+
<span class="restish-sponsor__label">Sponsored by</span>
9+
<img
10+
class="restish-sponsor__logo"
11+
src="{{ "img/sponsors/serpapi-white.svg" | relURL }}"
12+
alt="SerpApi"
13+
>
14+
<span class="restish-sponsor__copy">
15+
<strong>SerpApi: Web Search API</strong>
16+
<span>Access Google Search, Maps, Shopping, and other search engine data with a simple API by SerpApi.</span>
17+
</span>
18+
<span class="restish-sponsor__cta" aria-hidden="true">Learn more&nbsp;&rarr;</span>
19+
</a>
20+
</aside>
Lines changed: 23 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)