-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathNotices.svelte
48 lines (40 loc) · 983 Bytes
/
Notices.svelte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<script context="module">
export const notices = {}
</script>
<script>
export let position = 'top'
let container
let positionClass
$: positionClass = position === 'top' ? 'is-top' : 'is-bottom'
export function insert(el) {
container.insertAdjacentElement('afterbegin', el)
}
</script>
<style lang="scss">
.notices {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: hidden;
padding: 3em;
z-index: 1000;
pointer-events: none;
display: flex;
&.is-top {
flex-direction: column;
}
&.is-bottom {
flex-direction: column-reverse;
}
:global([class*='has-background-'] .text) {
color: transparent !important;
filter: invert(1) brightness(2.5) grayscale(1) contrast(9);
background: inherit;
background-clip: text !important;
-webkit-background-clip: text !important;
}
}
</style>
<div class="notices {positionClass}" bind:this={container} />