-
Notifications
You must be signed in to change notification settings - Fork 1
/
SupportButton.svelte
86 lines (79 loc) · 1.86 KB
/
SupportButton.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!--
Copyright © 2022 The Radicle Design System Contributors
This file is part of radicle-design-system, distributed under the GPLv3
with Radicle Linking Exception. For full terms see the included
LICENSE file.
-->
<script lang="ts">
export let style: string | undefined = undefined;
</script>
<style>
.support {
white-space: nowrap;
background: var(--color-background);
color: var(--color-foreground-level-6);
cursor: pointer;
display: flex;
align-items: center;
height: 40px;
outline-style: none;
padding: 0 12px;
user-select: none;
position: relative;
border-radius: 0.5rem;
border: 1px solid transparent;
background-clip: padding-box;
transform-style: preserve-3d;
}
.support:after {
content: "";
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
transform: translateZ(-1px);
margin: -1px;
border-radius: inherit;
background: linear-gradient(
90deg,
var(--color-primary),
var(--color-positive),
var(--color-caution),
var(--color-negative),
var(--color-primary)
);
background-size: 200% 200%;
}
.support:hover {
border: solid 1px transparent;
color: var(--color-foreground);
}
.support:hover:after {
content: "";
position: absolute;
border-radius: inherit;
background: linear-gradient(
90deg,
var(--color-primary),
var(--color-positive),
var(--color-caution),
var(--color-negative),
var(--color-primary)
);
background-size: 200% auto;
animation: shine 2s linear infinite;
}
/* motion */
@keyframes shine {
to {
background-position: 200% center;
}
}
.support:active {
color: var(--color-foreground-level-5);
}
</style>
<button class="support" on:click {style}>
<p class="typo-text-bold">Support</p>
</button>