Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port banner from svelte.dev #4155

Merged
merged 1 commit into from
Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 44 additions & 3 deletions sites/kit.svelte.dev/src/routes/__layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
import { Icon, Icons, Nav, NavItem, PreloadingIndicator, SkipLink } from '@sveltejs/site-kit';
import Search from '$lib/search/Search.svelte';
import SearchBox from '$lib/search/SearchBox.svelte';

let h = 0;
let w = 0;
$: browser && document.documentElement.style.setProperty('--ukr-footer-height', `${h}px`);
</script>

<Icons />
Expand All @@ -14,7 +18,7 @@
{/if}

<SkipLink href="#main" />
<Nav {page} logo="/images/svelte-kit-horizontal.svg">
<Nav {page} logo="/stopwar.svg">
<svelte:fragment slot="nav-center">
{#if browser}
<!-- the <Nav> component renders this content inside a <ul>, so
Expand Down Expand Up @@ -43,8 +47,19 @@
</NavItem>
</svelte:fragment>
</Nav>

<main id="main">
<a target="_blank" rel="noopener noreferrer" href="https://www.stopputin.net/"
><div class="ukr" bind:clientHeight={h} bind:clientWidth={w}>
{#if w < 830}
<strong>We stand with Ukraine.</strong>
Donate →
{:else}
<strong>We stand with Ukraine.</strong>
Petition your leaders. Show your support.
{/if}
</div></a
>

<main id="main" style="padding-bottom: {h}px;">
<slot />

{#if browser}
Expand All @@ -57,6 +72,7 @@
position: relative;
margin: 0 auto;
padding-top: var(--nav-h);
overflow: scroll;
overflow-x: hidden;
}

Expand Down Expand Up @@ -119,4 +135,29 @@
:global(body) {
font-size: 1.6rem !important;
}

.ukr {
background-color: #0066cc;
color: white;
position: fixed;
bottom: 0;
width: 100vw;
text-align: center;
padding: 0.75em;
z-index: 999;
}
:global(.examples-container, .repl-outer, .tutorial-outer) {
height: calc(100vh - var(--nav-h) - var(--ukr-footer-height)) !important;
}
:global(.toggle) {
bottom: var(--ukr-footer-height) !important;
}
@media (max-width: 830px) {
:global(aside) {
z-index: 9999 !important;
}
}
.ukr strong {
color: #ffcc00;
}
</style>
1 change: 1 addition & 0 deletions sites/kit.svelte.dev/static/stopwar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.