From 21ab3a9a1e3df286ab03acdc59fc2cdc2ba5b6a7 Mon Sep 17 00:00:00 2001 From: Kawsar Ahmed Date: Sun, 28 Jul 2024 12:16:56 +0600 Subject: [PATCH] Modal about (#5) * Custom port * Format * Modal for about * logo * Brand title and about modal * Release test * test * Update * Create release on PR * Fetch version --- .github/workflows/release.yml | 19 +++++++++++++++++ README.md | 2 +- package.json | 2 +- postcss.config.js | 8 +++---- src/app.d.ts | 2 +- src/index.test.ts | 8 +++---- src/lib/app.css | 7 +++++++ src/lib/elements/About.svelte | 16 ++++++++++++++ src/lib/elements/BrandTitle.svelte | 3 +++ src/lib/elements/Modal.svelte | 23 +++++++++++++++++++++ src/lib/utils/tools.ts | 2 +- src/lib/utils/tooltip.ts | 8 +++---- src/routes/(app)/+layout.svelte | 17 +++++++++++++-- src/routes/(app)/history/[id]/+page.svelte | 4 ++-- src/routes/auth/+layout.svelte | 3 ++- static/giphy.gif | Bin 0 -> 3849070 bytes svelte.config.js | 19 ++++++++++++----- tests/test.ts | 8 +++---- vite.config.ts | 9 +++++--- 19 files changed, 127 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 src/lib/elements/About.svelte create mode 100644 src/lib/elements/BrandTitle.svelte create mode 100644 src/lib/elements/Modal.svelte create mode 100644 static/giphy.gif diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d764c1f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,19 @@ +on: + pull_request: + branches: ['master'] + +jobs: + create-release-on-push: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: read + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: rymndhng/release-on-push-action@master + with: + bump_version_scheme: minor + tag_prefix: 'v' + release_name: 'Release ' + max_commits: 20 diff --git a/README.md b/README.md index ffe90e2..94f14c6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # Determine Paper Cost - ## Tech Stack ```bash @@ -13,6 +12,7 @@ Tools ```bash + ``` ## After Cloning this project diff --git a/package.json b/package.json index 05a852f..16b37fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "paper-cost", - "version": "0.0.1", + "version": "1.2.0", "private": true, "scripts": { "dev": "vite dev", diff --git a/postcss.config.js b/postcss.config.js index 2e7af2b..35237eb 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,6 +1,6 @@ export default { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, + plugins: { + tailwindcss: {}, + autoprefixer: {} + } } diff --git a/src/app.d.ts b/src/app.d.ts index f59b884..bf6daa3 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -9,4 +9,4 @@ declare global { } } -export {}; +export {} diff --git a/src/index.test.ts b/src/index.test.ts index e07cbbd..c9ccff9 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -1,7 +1,7 @@ -import { describe, it, expect } from 'vitest'; +import { describe, it, expect } from 'vitest' describe('sum test', () => { it('adds 1 + 2 to equal 3', () => { - expect(1 + 2).toBe(3); - }); -}); + expect(1 + 2).toBe(3) + }) +}) diff --git a/src/lib/app.css b/src/lib/app.css index b5c61c9..9f1f7e5 100644 --- a/src/lib/app.css +++ b/src/lib/app.css @@ -1,3 +1,10 @@ @tailwind base; @tailwind components; @tailwind utilities; + +.brand-name { + background-image: url('./giphy.gif'); + background-position: top; + background-clip: text; + -webkit-background-clip: text; +} diff --git a/src/lib/elements/About.svelte b/src/lib/elements/About.svelte new file mode 100644 index 0000000..471c9bd --- /dev/null +++ b/src/lib/elements/About.svelte @@ -0,0 +1,16 @@ + + +
+ logo +

Paper Cost

+ +

Developed by

+
+

Sheba Queue

+

Kawsar Ahmed

+

+880 1915983757

+
+

Version: {version}

+
diff --git a/src/lib/elements/BrandTitle.svelte b/src/lib/elements/BrandTitle.svelte new file mode 100644 index 0000000..a07ef9a --- /dev/null +++ b/src/lib/elements/BrandTitle.svelte @@ -0,0 +1,3 @@ +

+ Molla Printing & Packaging +

diff --git a/src/lib/elements/Modal.svelte b/src/lib/elements/Modal.svelte new file mode 100644 index 0000000..8dd7721 --- /dev/null +++ b/src/lib/elements/Modal.svelte @@ -0,0 +1,23 @@ + + +
+
+ + +
+
diff --git a/src/lib/utils/tools.ts b/src/lib/utils/tools.ts index fac69e0..71fd219 100644 --- a/src/lib/utils/tools.ts +++ b/src/lib/utils/tools.ts @@ -18,7 +18,7 @@ export const [send, receive] = crossfade({ const transform = style.transform === 'none' ? '' : style.transform return { - duration: 300, + duration: params.duration, easing: params.easing, css: (t) => ` transform: ${transform} scale(${t}); diff --git a/src/lib/utils/tooltip.ts b/src/lib/utils/tooltip.ts index 0e616c2..348dc33 100644 --- a/src/lib/utils/tooltip.ts +++ b/src/lib/utils/tooltip.ts @@ -1,6 +1,6 @@ -import tippy from 'tippy.js'; -import 'tippy.js/dist/tippy.css'; -import 'tippy.js/animations/scale.css'; +import tippy from 'tippy.js' +import 'tippy.js/dist/tippy.css' +import 'tippy.js/animations/scale.css' tippy('[data-tippy]', { content: (reference) => reference.getAttribute('data-tippy') || '', @@ -9,4 +9,4 @@ tippy('[data-tippy]', { arrow: true, delay: 100, animation: 'scale' -}); +}) diff --git a/src/routes/(app)/+layout.svelte b/src/routes/(app)/+layout.svelte index 9aa2980..2fbaf70 100644 --- a/src/routes/(app)/+layout.svelte +++ b/src/routes/(app)/+layout.svelte @@ -10,6 +10,9 @@ import { supabase } from '$lib/db/supabaseClient' import { Toaster } from 'svelte-sonner' import Icon from '@iconify/svelte' + import Modal from '$lib/elements/Modal.svelte' + import BrandTitle from '$lib/elements/BrandTitle.svelte' + import About from '$lib/elements/About.svelte' //Import Mixpanel SDK mixpanel.init(PUBLIC_MIX_TOKEN, { @@ -19,6 +22,7 @@ }) let showSettings = false + let showAbout = false const handleLogout = async () => { await supabase.auth.signOut() @@ -40,10 +44,15 @@ {/if} + {#if showAbout} + + + + {/if}
@@ -85,7 +94,11 @@ class="absolute w-20 right-3 bottom-11 flex flex-col items-start divide-y divide-orange-400 gap-1 bg-slate-50 p-2 rounded" > - +
{/if} diff --git a/src/routes/(app)/history/[id]/+page.svelte b/src/routes/(app)/history/[id]/+page.svelte index cf23784..b2fe73c 100644 --- a/src/routes/(app)/history/[id]/+page.svelte +++ b/src/routes/(app)/history/[id]/+page.svelte @@ -14,7 +14,7 @@ History -
+

Cost Details

{#if history} @@ -30,7 +30,7 @@
-
+
{#if history.papers.length} {#each history.papers as { length, width, thickness, rate, id }} diff --git a/src/routes/auth/+layout.svelte b/src/routes/auth/+layout.svelte index 6557597..da7d983 100644 --- a/src/routes/auth/+layout.svelte +++ b/src/routes/auth/+layout.svelte @@ -2,6 +2,7 @@ import { page } from '$app/stores' import { PUBLIC_MIX_TOKEN } from '$env/static/public' import '$lib/app.css' + import BrandTitle from '$lib/elements/BrandTitle.svelte' import '@fontsource/jost' //Import Mixpanel SDK @@ -16,7 +17,7 @@