From 15dffb3a0216c0eccc06b2fc449c423aba6811b2 Mon Sep 17 00:00:00 2001 From: secondl1ght <85003930+secondl1ght@users.noreply.github.com> Date: Thu, 21 Jul 2022 22:22:30 -0600 Subject: add register and login pages, DRY up more, add $comp, add new components --- src/components/HowItWorksCard.svelte | 3 +- src/components/Icon.svelte | 6 ++++ src/components/Image.svelte | 6 ++++ src/components/LandingHeader.svelte | 10 +++--- src/components/LandingHero.svelte | 17 +++------ src/components/LandingInfoCard.svelte | 15 ++++---- src/components/PrimaryButton.svelte | 4 +-- src/components/RegisterOrLogin.svelte | 65 +++++++++++++++++++++++++++++++++++ src/components/index.js | 3 ++ src/routes/index.svelte | 8 +---- src/routes/login.svelte | 5 +++ src/routes/register.svelte | 5 +++ static/icons/eye.svg | 4 +++ tailwind.config.cjs | 3 +- vite.config.js | 8 ++++- 15 files changed, 126 insertions(+), 36 deletions(-) create mode 100644 src/components/Icon.svelte create mode 100644 src/components/Image.svelte create mode 100644 src/components/RegisterOrLogin.svelte create mode 100644 src/routes/login.svelte create mode 100644 src/routes/register.svelte create mode 100644 static/icons/eye.svg diff --git a/src/components/HowItWorksCard.svelte b/src/components/HowItWorksCard.svelte index 6f94efcb..519cdcdc 100644 --- a/src/components/HowItWorksCard.svelte +++ b/src/components/HowItWorksCard.svelte @@ -1,11 +1,12 @@
- {image} +

{step}

{description} diff --git a/src/components/Icon.svelte b/src/components/Icon.svelte new file mode 100644 index 00000000..58a61033 --- /dev/null +++ b/src/components/Icon.svelte @@ -0,0 +1,6 @@ + + +{icon} diff --git a/src/components/Image.svelte b/src/components/Image.svelte new file mode 100644 index 00000000..b7db2b92 --- /dev/null +++ b/src/components/Image.svelte @@ -0,0 +1,6 @@ + + +{image} diff --git a/src/components/LandingHeader.svelte b/src/components/LandingHeader.svelte index c6cd4095..d6d55863 100644 --- a/src/components/LandingHeader.svelte +++ b/src/components/LandingHeader.svelte @@ -1,6 +1,7 @@

@@ -9,11 +10,7 @@ > The easiest - rays + way to accept Bitcoin in your store.

- + goto('/register')} />

- tablet-pos +
diff --git a/src/components/LandingInfoCard.svelte b/src/components/LandingInfoCard.svelte index 2b2dd2a1..c67d3fcc 100644 --- a/src/components/LandingInfoCard.svelte +++ b/src/components/LandingInfoCard.svelte @@ -1,4 +1,6 @@
- {#if image} - {image} - {/if} +

{title}

diff --git a/src/components/PrimaryButton.svelte b/src/components/PrimaryButton.svelte index 3caeb07d..4b33142b 100644 --- a/src/components/PrimaryButton.svelte +++ b/src/components/PrimaryButton.svelte @@ -4,5 +4,5 @@ + >{title} + diff --git a/src/components/RegisterOrLogin.svelte b/src/components/RegisterOrLogin.svelte new file mode 100644 index 00000000..48e8096a --- /dev/null +++ b/src/components/RegisterOrLogin.svelte @@ -0,0 +1,65 @@ + + +

+ + + + +
+
+

{page}

+ +
+
+ + +
+ +
+ + + +
+ + {#if page === 'Register'} +

+ We recommend a long, random password generated with a password manager. +

+ {:else} + + {/if} + + +
+ +

+ {page === 'Register' ? 'Already have an account?' : "Don't have an account?"} + {page === 'Register' ? 'Sign in' : 'Register'} + +

+
+
+
diff --git a/src/components/index.js b/src/components/index.js index 448db45d..d96a8656 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -5,3 +5,6 @@ export { default as HowItWorksCard } from './HowItWorksCard.svelte'; export { default as FaqCard } from './FaqCard.svelte'; export { default as PrimaryButton } from './PrimaryButton.svelte'; export { default as SecondaryButton } from './SecondaryButton.svelte'; +export { default as Icon } from './Icon.svelte'; +export { default as Image } from './Image.svelte'; +export { default as RegisterOrLogin } from './RegisterOrLogin.svelte'; diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 8912e41e..cda885a3 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -1,11 +1,5 @@ + + diff --git a/src/routes/register.svelte b/src/routes/register.svelte new file mode 100644 index 00000000..69ec5fd2 --- /dev/null +++ b/src/routes/register.svelte @@ -0,0 +1,5 @@ + + + diff --git a/static/icons/eye.svg b/static/icons/eye.svg new file mode 100644 index 00000000..ca6243ff --- /dev/null +++ b/static/icons/eye.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tailwind.config.cjs b/tailwind.config.cjs index 06e852ab..0d4dc4e3 100644 --- a/tailwind.config.cjs +++ b/tailwind.config.cjs @@ -4,7 +4,8 @@ module.exports = { theme: { extend: { colors: { - secondary: '#858A92' + secondary: '#858A92', + input: '#F5F7FA' } } }, diff --git a/vite.config.js b/vite.config.js index 87470505..bb04f608 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,8 +1,14 @@ import { sveltekit } from '@sveltejs/kit/vite'; +import path from 'path'; /** @type {import('vite').UserConfig} */ const config = { - plugins: [sveltekit()] + plugins: [sveltekit()], + resolve: { + alias: { + $comp: path.resolve('src/components/index.js') + } + } }; export default config; -- cgit v1.2.3