Skip to content

Commit da506b3

Browse files
committed
style: replace j2only-slider with quasar slider
1 parent e23dc94 commit da506b3

File tree

4 files changed

+125
-47
lines changed

4 files changed

+125
-47
lines changed

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"@fedimint/core-web": "^0.0.10",
2424
"@getalby/bitcoin-connect": "^3.7.0",
2525
"@getalby/lightning-tools": "^5.1.2",
26-
"@j2only/slide-unlock": "^0.5.11",
2726
"@nostr-dev-kit/ndk": "^2.12.2",
2827
"@quasar/extras": "^1.16.17",
2928
"@vueuse/core": "^12.8.2",

pnpm-lock.yaml

-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/VerifyPayment.vue

+117-25
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,63 @@
11
<template>
2-
<div>
3-
<div class="text-h6 q-mb-md">Verify Payment Details</div>
2+
<div class="payment-verification">
43

5-
<q-card flat bordered>
4+
<q-card flat class="glass-effect q-mb-lg">
65
<q-card-section>
76
<div class="row q-mb-sm">
8-
<div class="col-4 text-weight-medium">Amount</div>
9-
<div class="col">{{ decodedInvoice.amount }} sats</div>
7+
<div class="col-4 text-weight-medium text-white-8">Amount</div>
8+
<div class="col text-white text-weight-bold">{{ decodedInvoice.amount }} sats</div>
109
</div>
1110

1211
<div class="row q-mb-sm">
13-
<div class="col-4 text-weight-medium">Description</div>
14-
<div class="col">{{ decodedInvoice.description }}</div>
12+
<div class="col-4 text-weight-medium text-white-8">Description</div>
13+
<div class="col text-white text-weight-bold">{{ decodedInvoice.description }}</div>
1514
</div>
1615

1716
<div class="row q-mb-sm">
18-
<div class="col-4 text-weight-medium">Payment Hash</div>
19-
<div class="col text-wrap">{{ decodedInvoice.paymentHash }}</div>
17+
<div class="col-4 text-weight-medium text-white-8">Payment Hash</div>
18+
<div class="col text-white text-weight-bold text-wrap">{{ decodedInvoice.paymentHash }}</div>
2019
</div>
2120

2221
<div class="row q-mb-sm">
23-
<div class="col-4 text-weight-medium">Expires</div>
24-
<div class="col">{{ formatExpiry }}</div>
22+
<div class="col-4 text-weight-medium text-white-8">Expires</div>
23+
<div class="col text-white text-weight-bold">{{ formatExpiry }}</div>
2524
</div>
2625
</q-card-section>
2726
</q-card>
2827

29-
<SlideUnlock
30-
ref="slideUnlock"
31-
:auto-width="true"
32-
:circle="true"
33-
text="Slide to Pay"
34-
success-text="Payment Confirmed!"
35-
@completed="$emit('pay')"
36-
class="q-mt-md"
37-
/>
28+
<div class="q-mt-md payment-slider-container">
29+
<q-slide-item
30+
@left="$emit('pay')"
31+
@action="onSlideAction"
32+
left-color="transparent"
33+
class="no-border payment-slider"
34+
>
35+
<template v-slot:left>
36+
<div class="full-height full-width row justify-end items-center">
37+
<q-icon name="check" size="32px" color="white" />
38+
</div>
39+
</template>
40+
41+
<div class="payment-slider-content">
42+
<div class="slider-handle">
43+
<q-icon name="bolt" color="white" size="20px" />
44+
</div>
45+
<div class="slider-text">Slide to Pay</div>
46+
</div>
47+
</q-slide-item>
48+
</div>
3849
</div>
3950
</template>
4051

4152
<script setup lang="ts">
42-
import { computed, ref } from 'vue'
53+
import { computed} from 'vue'
4354
import type { Bolt11Invoice } from 'src/components/models'
44-
import SlideUnlock from '@j2only/slide-unlock'
4555
4656
const props = defineProps<{
4757
decodedInvoice: Bolt11Invoice
4858
}>()
4959
60+
5061
defineEmits<{
5162
cancel: []
5263
pay: []
@@ -58,13 +69,94 @@ const formatExpiry = computed(() => {
5869
return date.toLocaleString()
5970
})
6071
61-
const slideUnlock = ref<InstanceType<typeof SlideUnlock> | null>(null)
72+
function onSlideAction({ side, reset }: { side: 'left' | 'right' | 'top' | 'bottom'; reset: () => void }) {
73+
if (side === 'left') {
74+
// If it's being slid to the left but not completed
75+
setTimeout(() => {
76+
reset()
77+
}, 300)
78+
}
79+
}
6280
</script>
6381

6482
<style scoped>
6583
.text-wrap {
6684
word-break: break-all;
6785
}
68-
</style>
6986
70-
<style></style>
87+
.payment-verification {
88+
padding-bottom: 20px;
89+
}
90+
91+
.text-white-8 {
92+
color: rgba(255, 255, 255, 0.8);
93+
}
94+
95+
/* Payment Slider Styling */
96+
.payment-slider-container {
97+
position: relative;
98+
width: 100%;
99+
border-radius: 30px;
100+
overflow: hidden;
101+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
102+
}
103+
104+
.payment-slider {
105+
height: 56px;
106+
background: rgba(255, 255, 255, 0.1);
107+
border-radius: 30px;
108+
}
109+
110+
.payment-slider :deep(.q-slide-item__left .q-icon) {
111+
opacity: 0;
112+
transition: opacity 0.2s;
113+
}
114+
115+
.payment-slider:active :deep(.q-slide-item__left .q-icon) {
116+
opacity: 1;
117+
}
118+
119+
.payment-slider :deep(.q-slide-item__left) {
120+
/* Remove the gradient background */
121+
background: transparent !important;
122+
}
123+
124+
.payment-slider-content {
125+
position: relative;
126+
display: flex;
127+
align-items: center;
128+
justify-content: center;
129+
width: 100%;
130+
height: 56px;
131+
padding-left: 56px;
132+
}
133+
134+
.slider-handle {
135+
position: absolute;
136+
left: 6px;
137+
top: 8px;
138+
width: 40px;
139+
height: 40px;
140+
border-radius: 50%;
141+
background: linear-gradient(145deg, var(--q-primary), #8000ff);
142+
display: flex;
143+
align-items: center;
144+
justify-content: center;
145+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
146+
border: 1px solid rgba(255, 255, 255, 0.2);
147+
z-index: 2;
148+
}
149+
150+
.slider-text {
151+
color: rgba(255, 255, 255, 0.9);
152+
font-weight: 500;
153+
font-size: larger;
154+
letter-spacing: 0.5px;
155+
z-index: 1;
156+
}
157+
158+
/* Animation for successful slide */
159+
.q-slide-item__content {
160+
transition: transform 0.3s;
161+
}
162+
</style>

src/pages/SendPage.vue

+8-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<div class="q-px-md">
1616
<!-- Payment input section -->
1717
<template v-if="!decodedInvoice">
18-
<q-card flat bordered class="bg-dark q-mb-md">
18+
<q-card flat class="glass-effect q-mb-md">
1919
<q-card-section>
2020
<div class="text-subtitle2 text-grey q-mb-sm">
2121
Enter Lightning Invoice or Address
@@ -39,7 +39,7 @@
3939

4040
<!-- Amount input section (for lightning address) -->
4141
<q-slide-transition>
42-
<q-card v-if="amountRequired" flat bordered class="bg-dark q-mb-md">
42+
<q-card v-if="amountRequired" flat bordered class="glass-effect q-mb-md">
4343
<q-card-section>
4444
<div class="text-subtitle2 text-grey q-mb-sm">Payment Details</div>
4545

@@ -269,6 +269,12 @@ async function payInvoice() {
269269
</script>
270270

271271
<style scoped>
272+
.entry-container {
273+
width: 100%;
274+
max-width: 500px;
275+
border-radius: 16px;
276+
}
277+
272278
.custom-input :deep(.q-field__control) {
273279
background-color: rgba(255, 255, 255, 0.05);
274280
}

0 commit comments

Comments
 (0)