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

Popup styling uniformisation #95

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion src/lib/AddOverlay.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
} from '@svelte-put/cloudflare-turnstile';
import { PUBLIC_CLOUDFLARE_TURNSTILE_SITE_KEY } from '$env/static/public';
import { SvelteToast, toast } from '@zerodevx/svelte-toast';
import './toast.css';

let momentDescription = '';
let captchaToken = '';
Expand All @@ -31,7 +32,9 @@
'Your story was successfully submitted. It will appear publicly on the map once it has been approved by our moderators.',
{
theme: {
'--toastBarHeight': 0
'--toastBackground': 'black',
'--toastBarHeight': 0,
'--toastColor': 'var(--color-pink)',
},

duration: 5000
Expand Down
61 changes: 2 additions & 59 deletions src/lib/DonatePopup.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
import { writable } from 'svelte/store';
import './toast.css';

const showToast = writable(true);

Expand All @@ -24,62 +25,4 @@
></button>
</div>
</div>
{/if}

<style>
.toast-container {
position: fixed;
bottom: 0px;
left: 9px;
right: 70px;
margin: 0;
padding: 0;
list-style-type: none;
pointer-events: none;
z-index: 9999;
}
.toast {
width: fit-content;
min-height: 3.5rem;
margin-bottom: 0.5rem;
padding: 0;
background: black;
color: #fff;
box-shadow:
0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06);
border: 1px solid var(--color-pink);
border-radius: 0.125rem;
display: flex;
align-items: center;
overflow: hidden;
pointer-events: all;
cursor: pointer;
z-index: 999;
position: relative;
}
.toast-message {
padding: 0.75rem 3rem 0.75rem 0.5rem;
flex: 1;
}
.toast-message a {
color: var(--color-pink);
text-decoration: unset;
}
.toast-message a span {
text-decoration: underline;
}
.toast-close {
position: absolute;
top: 4px;
right: 4px;
background: none;
border: none;
color: var(--color-pink);
cursor: pointer;
font: 1rem sans-serif;
}
.toast-close::after {
content: '✕';
}
</style>
{/if}
62 changes: 62 additions & 0 deletions src/lib/toast.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.toast-container {
position: fixed;
bottom: 0px;
left: 9px;
right: 70px;
margin: 0;
padding: 0;
list-style-type: none;
pointer-events: none;
z-index: 9999;
}

.toast {
width: fit-content;
min-height: 3.5rem;
margin-bottom: 0.5rem;
padding: 0;
background: black;
color: var(--color-pink);
box-shadow:
0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06);
border: 1px solid var(--color-pink);
border-radius: 0.125rem;
display: flex;
align-items: center;
overflow: hidden;
pointer-events: all;
cursor: pointer;
z-index: 999;
position: relative;
}

.toast-message {
padding: 0.75rem 3rem 0.75rem 0.5rem;
flex: 1;
}

.toast-message a {
color: var(--color-pink);
text-decoration: unset;
}

.toast-message a span {
text-decoration: underline;
}

.toast-close {
position: absolute;
top: 4px;
right: 4px;
background: none;
border: none;
color: var(--color-pink);
cursor: pointer;
font: 1rem sans-serif;
}

.toast-close::after {
content: '✕';
}

Loading