diff options
| author | Adam Soltys <[email protected]> | 2022-10-13 18:04:14 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-10-13 18:04:14 -0700 |
| commit | ffa0710e3f6895c6f7bea0e58e18c89047c7c4f7 (patch) | |
| tree | 3b5a3aa4fe75fe77e214df041205dc3d5a9c1663 /src/routes/launch | |
| parent | 1d6c3f68c6f9d992122e427a7cb24be13aa1e988 (diff) | |
| download | coinos-ui-ffa0710e3f6895c6f7bea0e58e18c89047c7c4f7.tar.gz coinos-ui-ffa0710e3f6895c6f7bea0e58e18c89047c7c4f7.zip | |
tickets
Diffstat (limited to 'src/routes/launch')
| -rw-r--r-- | src/routes/launch/+page.svelte | 37 | ||||
| -rw-r--r-- | src/routes/launch/purchase/+page.server.js | 24 | ||||
| -rw-r--r-- | src/routes/launch/purchase/+page.svelte | 20 |
3 files changed, 58 insertions, 23 deletions
diff --git a/src/routes/launch/+page.svelte b/src/routes/launch/+page.svelte index 04f53086..a2e14738 100644 --- a/src/routes/launch/+page.svelte +++ b/src/routes/launch/+page.svelte @@ -14,33 +14,46 @@ }); </script> -<div class="flex mt-20 px-8"> - <img src="/images/ticket.webp" class="mb-8 md:max-w-xl mx-auto border border-gray-400" /> -</div> -<div class="mx-auto flex items-center justify-center px-8"> - <div class="flex flex-col w-full bg-white rounded shadow-lg sm:w-3/4 md:w-1/2 lg:w-3/5"> +<div class="mx-auto flex items-center justify-center px-8 mt-20"> + <div class="flex flex-col w-full bg-white rounded shadow-lg sm:w-3/4 lg:w-3/5"> <div class="flex flex-col w-full md:flex-row"> <div class="flex flex-row justify-around p-4 font-bold leading-none text-gray-800 uppercase bg-gray-400 rounded md:flex-col md:items-center md:justify-center md:w-1/4" > <div class="md:text-3xl">Oct</div> - <div class="md:text-6xl">5</div> + <div class="md:text-6xl">26</div> <div class="md:text-xl">6 pm</div> </div> - <div class="p-4 font-normal text-gray-800 md:w-3/4"> + <div class="p-4 font-normal text-gray-800 md:w-3/4 space-y-5"> <h1 class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800"> Coinos Launch Party! </h1> <p class="leading-normal mb-2"> - Come join us at our launch party celebrating 10 years in business! We'll be introducing - our newly designed payments interface and afterwards we'll network and enjoy tasty food - and drinks from <a href="https://loftondenman.com/" class="underline">The Loft</a>! + Come join us at our launch party celebrating 10 years in business! + </p> + <div class="ml-8"> + <p><b>When</b></p> + <p>6pm on October 26</p> + </div> + <div class="ml-8"> + <p><b>Where</b></p> + <p>1184 Denman Street, #203</p> + <p>Vancouver, BC</p> + </div> + + <p> + We'll be introducing our newly designed payments interface and afterwards we'll network + and enjoy tasty food and drinks from <a href="https://loftondenman.com/" class="underline" + >The Loft</a + >! </p> + <p>We're charging a $6 entry fee to help us know how much space to reserve. There will be complimentary appies and prize giveaways!</p> + <div class="flex w-full my-8"> - <a href={link}> + <a href={link} class="mx-auto"> <button - class="bg-white text-black border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-2xl" + class="bg-white text-black border rounded-full px-8 py-4 font-bold hover:opacity-80 text-2xl" > Purchase Ticket </button> diff --git a/src/routes/launch/purchase/+page.server.js b/src/routes/launch/purchase/+page.server.js index f6314f7f..48c5c7d3 100644 --- a/src/routes/launch/purchase/+page.server.js +++ b/src/routes/launch/purchase/+page.server.js @@ -1,8 +1,26 @@ -export const load = ({ parent }) => parent(); +import { auth, get, post } from '$lib/utils'; +import tickets from "$lib/tickets"; + +export const load = () => get('/ticket'); export const actions = { default: async ({ cookies, request }) => { - let form = Object.fromEntries(await request.formData()); - console.log(form); + let { ticket } = Object.fromEntries(await request.formData()); + + let r = await post( + '/assets', + { + name: 'Launch Party Ticket', + ticker: 'LPT', + precision: 0, + asset_amount: '1', + token_amount: 0, + domain: 'coinos.io', + filename: tickets[ticket], + }, + auth(cookies) + ); + + console.log(r); } }; diff --git a/src/routes/launch/purchase/+page.svelte b/src/routes/launch/purchase/+page.svelte index df3048f3..b00b6baf 100644 --- a/src/routes/launch/purchase/+page.svelte +++ b/src/routes/launch/purchase/+page.svelte @@ -6,12 +6,15 @@ export let data; - let amount = 35000; + let amount = 25000; let { + address, account: { balance }, username } = data.user; + let { ticket } = data; + let invoice; let get = async (network) => { let { uuid } = await post('/invoice', { @@ -31,23 +34,24 @@ </script> <div class="mx-auto h-screen flex items-center justify-center px-8"> - <div class="p-4 font-normal text-gray-800 mx-auto mb-8"> + <div class="p-4 font-normal text-gray-800 mx-auto mb-8 space-y-5"> {#if balance > amount} <h1 class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800 text-center"> - Buy Your Launch Party Ticket? + Confirm Purchase </h1> - <div class="text-center text-4xl mb-12">{amount} sats</div> + <img src={`/tickets/${(ticket + 1).toString().padStart(2, '0')}.png`} class="my-8" /> - <div class="w-full flex"> - <form method="POST" use:enhance> + <form method="POST" use:enhance> + <input type="hidden" name="ticket" value={ticket} /> + <div class="w-full flex"> <button class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-2xl" > Count me in </button> - </form> - </div> + </div> + </form> {:else} <h1 class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800 text-center"> Ticket Price |
