diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index c43c056..8222c4b 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -20,8 +20,17 @@ jobs: chmod 600 ./deploy.key echo "${{ secrets.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts + - name: Create env file + run: | + touch .env + echo EMAIL_ACCESS_KEY=${{ secrets.EMAIL_ACCESS_KEY }} >> .env + echo EMAIL_BASE_URL=${{ secrets.EMAIL_BASE_URL }} >> .env + + - name: Verify .env file creation + run: cat .env + - name: Install PM2 run: npm i -g pm2 - name: Deploy - run: pm2 deploy ecosystem.config.cjs production + run: env $(cat .env | grep -v \"#\" | xargs) pm2 deploy ecosystem.config.cjs production diff --git a/ecosystem.config.cjs b/ecosystem.config.cjs index 8d05d01..eb6b782 100644 --- a/ecosystem.config.cjs +++ b/ecosystem.config.cjs @@ -10,6 +10,8 @@ module.exports = { watch: false, max_memory_restart: '1G', env: { + EMAIL_ACCESS_KEY: process.env.EMAIL_ACCESS_KEY, + EMAIL_BASE_URL: process.env.EMAIL_BASE_URL, NODE_ENV: 'production', PORT: 7281, }, @@ -27,6 +29,8 @@ module.exports = { 'post-deploy': 'npm run build && pm2 reload ecosystem.config.cjs --only embroidery-viewer-prod --env production && pm2 save', env: { + EMAIL_ACCESS_KEY: process.env.EMAIL_ACCESS_KEY, + EMAIL_BASE_URL: process.env.EMAIL_BASE_URL, PORT: 7281, NODE_ENV: 'production', }, diff --git a/src/lib/assets/app-with-frame.png b/src/lib/assets/app-with-frame.png new file mode 100644 index 0000000..5fbc22a Binary files /dev/null and b/src/lib/assets/app-with-frame.png differ diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 38404ed..d079386 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -28,7 +28,7 @@ diff --git a/src/routes/+page.js b/src/routes/+page.js index b0adabb..6f0c725 100644 --- a/src/routes/+page.js +++ b/src/routes/+page.js @@ -1,3 +1,4 @@ + /** @type {import('./$types').PageLoad} */ export function load() { return { diff --git a/src/routes/+page.server.js b/src/routes/+page.server.js new file mode 100644 index 0000000..da0676f --- /dev/null +++ b/src/routes/+page.server.js @@ -0,0 +1,33 @@ +import { EMAIL_ACCESS_KEY, EMAIL_BASE_URL } from '$env/static/private'; + +/** @type {import('./$types').Actions} */ +export const actions = { + default: async ({ request }) => { + const formData = await request.formData(); + console.log(formData); + + const response = await fetch(`${EMAIL_BASE_URL}/submit`, { + method: 'POST', + body: JSON.stringify({ + accessKey: EMAIL_ACCESS_KEY, + subject: 'Contato - Embroidery Viewer Beta Testers!', + name: formData.get('name'), + email: formData.get('email'), + }), + headers: { 'Content-Type': 'application/json' } + }); + + const json = await response.json(); + if (json.error === undefined) { + return { + message: 'Name and email sent successfully! We\'ll contact you soon!', + textColor: 'green' + }; + } else { + return { + message: 'Something went wrong!', + textColor: 'red' + }; + } + } +}; diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 15ce0fd..78ad512 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,15 +1,85 @@ +
+
+
+ Embroidery Viewer App Screenshot +
+ +
+

πŸš€ Be a Beta Tester

+

+ We’re launching the Embroidery Viewer Android App β€” and you can be one of the first to try it! +

+

+ Enjoy a smooth, ad-free experience to visualize PES, JEF, PEC, and VP3 embroidery files right from your phone. + Help us improve it and get early access before everyone else. +

+ + +
{ + loading = true; + return async ({ result }) => { + loading = false; + feedbackMessage = result.data; + if (result.type === 'success') await invalidateAll(); + applyAction(result); + }; + }}> + +
+

πŸš€ Join the Beta for Embroidery Viewer

+
+ + + + + + + + + {#if feedbackMessage != null} +

+ {feedbackMessage.message} +

+ {/if} +
+
+
+
+

{$t('home.main.title')}

@@ -51,14 +121,156 @@
diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte index 15b021e..d1486ed 100644 --- a/src/routes/about/+page.svelte +++ b/src/routes/about/+page.svelte @@ -30,7 +30,7 @@ @media (max-width: 768px) { section { - width: 100%; + width: 90%; } } diff --git a/src/routes/donate/+page.svelte b/src/routes/donate/+page.svelte index 6c24740..cc39ad7 100644 --- a/src/routes/donate/+page.svelte +++ b/src/routes/donate/+page.svelte @@ -164,7 +164,7 @@ @media (max-width: 768px) { .donate-container { - width: 100%; + width: 90%; } .donation-options { diff --git a/src/routes/mobile-app/privacy-policy/+page.svelte b/src/routes/mobile-app/privacy-policy/+page.svelte index def636e..f2cbb50 100644 --- a/src/routes/mobile-app/privacy-policy/+page.svelte +++ b/src/routes/mobile-app/privacy-policy/+page.svelte @@ -28,7 +28,7 @@ @media (max-width: 768px) { section { - width: 100%; + width: 90%; } } diff --git a/src/routes/privacy-policy/+page.svelte b/src/routes/privacy-policy/+page.svelte index 98815d5..bf635f6 100644 --- a/src/routes/privacy-policy/+page.svelte +++ b/src/routes/privacy-policy/+page.svelte @@ -28,7 +28,7 @@ @media (max-width: 768px) { section { - width: 100%; + width: 90%; } } diff --git a/src/routes/terms-of-service/+page.svelte b/src/routes/terms-of-service/+page.svelte index f67fac4..6f66673 100644 --- a/src/routes/terms-of-service/+page.svelte +++ b/src/routes/terms-of-service/+page.svelte @@ -28,7 +28,7 @@ @media (max-width: 768px) { section { - width: 100%; + width: 90%; } } diff --git a/src/routes/viewer/+page.svelte b/src/routes/viewer/+page.svelte index b53e7b9..8dff613 100644 --- a/src/routes/viewer/+page.svelte +++ b/src/routes/viewer/+page.svelte @@ -147,7 +147,7 @@ @media only screen and (max-device-width: 768px) { #form { - width: 100%; + width: 90%; } }