Skip to content

Commit 353d94e

Browse files
authored
port banner from svelte.dev (#4155)
1 parent f1d9b5b commit 353d94e

File tree

2 files changed

+45
-3
lines changed

2 files changed

+45
-3
lines changed

sites/kit.svelte.dev/src/routes/__layout.svelte

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
import { Icon, Icons, Nav, NavItem, PreloadingIndicator, SkipLink } from '@sveltejs/site-kit';
66
import Search from '$lib/search/Search.svelte';
77
import SearchBox from '$lib/search/SearchBox.svelte';
8+
9+
let h = 0;
10+
let w = 0;
11+
$: browser && document.documentElement.style.setProperty('--ukr-footer-height', `${h}px`);
812
</script>
913

1014
<Icons />
@@ -14,7 +18,7 @@
1418
{/if}
1519

1620
<SkipLink href="#main" />
17-
<Nav {page} logo="/images/svelte-kit-horizontal.svg">
21+
<Nav {page} logo="/stopwar.svg">
1822
<svelte:fragment slot="nav-center">
1923
{#if browser}
2024
<!-- the <Nav> component renders this content inside a <ul>, so
@@ -43,8 +47,19 @@
4347
</NavItem>
4448
</svelte:fragment>
4549
</Nav>
46-
47-
<main id="main">
50+
<a target="_blank" rel="noopener noreferrer" href="https://www.stopputin.net/"
51+
><div class="ukr" bind:clientHeight={h} bind:clientWidth={w}>
52+
{#if w < 830}
53+
<strong>We stand with Ukraine.</strong>
54+
Donate →
55+
{:else}
56+
<strong>We stand with Ukraine.</strong>
57+
Petition your leaders. Show your support.
58+
{/if}
59+
</div></a
60+
>
61+
62+
<main id="main" style="padding-bottom: {h}px;">
4863
<slot />
4964

5065
{#if browser}
@@ -57,6 +72,7 @@
5772
position: relative;
5873
margin: 0 auto;
5974
padding-top: var(--nav-h);
75+
overflow: scroll;
6076
overflow-x: hidden;
6177
}
6278
@@ -119,4 +135,29 @@
119135
:global(body) {
120136
font-size: 1.6rem !important;
121137
}
138+
139+
.ukr {
140+
background-color: #0066cc;
141+
color: white;
142+
position: fixed;
143+
bottom: 0;
144+
width: 100vw;
145+
text-align: center;
146+
padding: 0.75em;
147+
z-index: 999;
148+
}
149+
:global(.examples-container, .repl-outer, .tutorial-outer) {
150+
height: calc(100vh - var(--nav-h) - var(--ukr-footer-height)) !important;
151+
}
152+
:global(.toggle) {
153+
bottom: var(--ukr-footer-height) !important;
154+
}
155+
@media (max-width: 830px) {
156+
:global(aside) {
157+
z-index: 9999 !important;
158+
}
159+
}
160+
.ukr strong {
161+
color: #ffcc00;
162+
}
122163
</style>
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)