Skip to content

Commit 10b3c86

Browse files
committed
refactor(fab): Small adjustments to FAB option buttons
- Also add Kofi link
1 parent 5c61971 commit 10b3c86

File tree

2 files changed

+77
-18
lines changed

2 files changed

+77
-18
lines changed

components/Icons/Kofi.vue

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<template>
2+
<svg
3+
xmlns="http://www.w3.org/2000/svg"
4+
width="24"
5+
height="24"
6+
viewBox="0 0 24 24"
7+
fill="none"
8+
stroke="currentColor"
9+
stroke-width="2"
10+
stroke-linecap="round"
11+
stroke-linejoin="round"
12+
class="icon icon-tabler icons-tabler-outline icon-tabler-coffee"
13+
>
14+
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
15+
<path
16+
d="M3 14c.83 .642 2.077 1.017 3.5 1c1.423 .017 2.67 -.358 3.5 -1c.83 -.642 2.077 -1.017 3.5 -1c1.423 -.017 2.67 .358 3.5 1"
17+
/>
18+
<path d="M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2" />
19+
<path d="M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2" />
20+
<path d="M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z" />
21+
<path d="M16.746 16.726a3 3 0 1 0 .252 -5.555" />
22+
</svg>
23+
</template>

components/ThemeManager.vue

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,35 @@
1212
:aria-label="`Set ${t.id} theme`"
1313
:data-ds-btn-metadata="t.id"
1414
@click.stop="changeTheme(t.id)"
15+
class="theme-manager__buttons-item"
1516
>
1617
<component :is="t.icon" />
1718
</button>
18-
<button @click.stop="openSettings" data-ds-btn-metadata="more" aria-label="Open theme settings">
19+
20+
<button
21+
@click.stop="openSettings"
22+
data-ds-btn-metadata="more"
23+
aria-label="Open theme settings"
24+
class="theme-manager__buttons-item"
25+
>
1926
<IconSettings />
2027
</button>
28+
29+
<a
30+
@click.stop
31+
data-ds-btn-metadata="kofi"
32+
aria-label="Go to KO-FI page"
33+
class="theme-manager__buttons-item"
34+
href="https://ko-fi.com/http417"
35+
target="_blank"
36+
rel="noopener noreferrer"
37+
>
38+
<IconKofi />
39+
</a>
40+
41+
<!-- <a href="https://ko-fi.com/http417" target="_blank" rel="noopener noreferrer">
42+
<IconKofi />
43+
</a> -->
2144
</div>
2245
</div>
2346

@@ -33,6 +56,7 @@ import { useClickOutsideWatcher } from '@/composables/useClickOutsideWatcher'
3356
import { THEMES } from '@/utils/storage'
3457
import CustomizationSettings from '@/components/CustomizationSettings.vue'
3558
import IconSettings from '@/components/Icons/IconSettings.vue'
59+
import IconKofi from '@/components/Icons/Kofi.vue'
3660
import IconRoller from '@/components/Icons/IconRoller.vue'
3761
import IconSun from '@/components/Icons/IconSun.vue'
3862
import IconMoon from '@/components/Icons/IconMoon.vue'
@@ -97,7 +121,10 @@ $blur-backdrop: blur(1rem);
97121
background-image: var(--c-bg-gradient);
98122
backdrop-filter: $blur-backdrop;
99123
cursor: pointer;
100-
transition: transform $trans, background $trans, color $trans;
124+
transition:
125+
transform $trans,
126+
background $trans,
127+
color $trans;
101128
width: var(--roller-size);
102129
height: var(--roller-size);
103130
@@ -119,26 +146,25 @@ $blur-backdrop: blur(1rem);
119146
}
120147
121148
&__buttons {
149+
opacity: 0;
122150
display: grid;
123151
place-items: center;
124-
gap: 0.5rem;
125-
width: var(--roller-size);
126-
padding: 0.2rem;
152+
padding-block: 0.3rem;
153+
width: calc(var(--roller-size) + 0.8rem);
127154
background-image: var(--c-bg-gradient);
128155
backdrop-filter: $blur-backdrop;
129156
border: $border-accent;
130157
border-radius: 20vw;
131-
opacity: 0;
132158
pointer-events: none;
133159
clip-path: polygon(0 0, 100% 0, 100% 0, 0% 0);
134-
transition: opacity $trans, clip-path $trans;
135-
136-
svg {
137-
width: calc(var(--roller-size) * 0.685);
138-
height: calc(var(--roller-size) * 0.685);
139-
}
140-
141-
button {
160+
transition:
161+
opacity $trans,
162+
clip-path $trans;
163+
164+
&-item {
165+
padding-block: 0.4rem !important;
166+
margin: 0 !important;
167+
display: block !important;
142168
position: relative;
143169
aspect-ratio: 1 / 1;
144170
font-family: var(--fontFamily), var(--fontFamilyDefault);
@@ -149,7 +175,15 @@ $blur-backdrop: blur(1rem);
149175
border-radius: 50vw;
150176
cursor: pointer;
151177
transform: scale(0);
152-
transition: transform 0.3s $easeInOutBack, color $trans;
178+
transition:
179+
transform 0.3s $easeInOutBack,
180+
color $trans;
181+
182+
svg {
183+
--svg-size: calc(var(--roller-size) * 0.685);
184+
width: var(--svg-size);
185+
height: var(--svg-size);
186+
}
153187
154188
// Tooltip optimization
155189
&::after {
@@ -167,7 +201,9 @@ $blur-backdrop: blur(1rem);
167201
border-radius: 50vw;
168202
opacity: 0;
169203
transform: translate(-50%, 0%) scale(0);
170-
transition: opacity $trans, transform $trans;
204+
transition:
205+
opacity $trans,
206+
transform $trans;
171207
z-index: 2;
172208
pointer-events: none;
173209
@@ -193,10 +229,10 @@ $blur-backdrop: blur(1rem);
193229
pointer-events: all;
194230
clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
195231
196-
button {
232+
&-item {
197233
transform: scale(1);
198234
// Staggered animation using SCSS loop
199-
@for $i from 1 through 4 {
235+
@for $i from 1 through 5 {
200236
&:nth-child(#{$i}) {
201237
transition-delay: #{$i * 0.05}s;
202238
}

0 commit comments

Comments
 (0)