aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/launch/purchase/card/+page.svelte
blob: 05d09025dfecb70866e9e0355cb4336ff40752f8 (plain) (blame)
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
<script>
	import { enhance } from '$app/forms';
	import { Lock, Card, Calendar, Spinner } from '$comp';

	export let data;

	let { username } = data.user;
	let loading;
</script>

<div class="container max-w-lg px-4 mx-auto space-y-5">
	<form
		method="POST"
		class="flex flex-wrap gap-5 w-full p-5 mt-20"
		use:enhance={() => {
			loading = true;
			return ({ update }) => update() && (loading = false);
		}}
	>
		<input type="hidden" name="username" value={username} />
		<label class="relative w-full flex flex-col">
			<span class="font-bold mb-3">Card number</span>
			<input
				class="rounded-md peer pl-12 pr-2 py-2 border-2 border-gray-200 placeholder-gray-300"
				type="text"
				name="number"
				placeholder="0000 0000 0000 0000"
			/>
			<Card />
		</label>

		<label class="relative flex-1 flex flex-col">
			<span class="font-bold mb-3">Expire date</span>
			<input
				class="rounded-md peer pl-12 pr-2 py-2 border-2 border-gray-200 placeholder-gray-300"
				type="text"
				name="expiry"
				placeholder="MM/YY"
			/>
			<Calendar />
		</label>

		<label class="relative flex-1 flex flex-col">
			<span class="font-bold flex items-center gap-3 mb-3">
				CVC/CVV
				<span class="relative group">
					<span
						class="hidden group-hover:flex justify-center items-center px-2 py-1 text-xs absolute -right-2 transform translate-x-full -translate-y-1/2 w-max top-1/2 bg-black text-white"
					>
						3-digit number on the back of your card</span
					>
				</span>
			</span>
			<input
				class="rounded-md peer pl-12 pr-2 py-2 border-2 border-gray-200 placeholder-gray-300"
				type="text"
				name="cvc"
				placeholder="&bull;&bull;&bull;"
			/>
			<Lock />
		</label>

		<div class="w-full flex mt-8">
			<button
				class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-xl"
				type="submit"
				disabled={loading}
			>
				{#if loading}
					<Spinner />
				{:else}
					Submit
				{/if}
			</button>
		</div>
	</form>
</div>