From 9b6b3e7f2de101fdcef15d76f5fde2b89e647f68 Mon Sep 17 00:00:00 2001 From: MartinsOnuoha Date: Fri, 27 Oct 2023 15:41:17 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20chore(appfilter.vue):=20add=20dr?= =?UTF-8?q?opdown=20toggle=20icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- postcss.config.js | 1 + src/assets/styles/color-scheme.scss | 4 +- src/assets/styles/main.scss | 1 - src/assets/styles/variables.scss | 5 +- src/components/AppCategory/AppCategory.vue | 14 +- src/components/AppFilter/AppFilter.vue | 97 +++++---- src/components/AppFilter/_AppFilter.scss | 25 +++ src/components/AppHeader/HeaderActions.vue | 12 +- src/components/AppHeader/ToggleDarkMode.vue | 13 +- .../AppSideBanner/AppSideBanner.vue | 6 +- .../AppStatementCard/AppStatementCard.vue | 20 +- .../_AppStatementCard.dark.scss | 4 +- .../AppStatementCard/_AppStatementCard.scss | 3 +- src/components/Icons/MdiFilterMenu.vue | 8 + .../Icons/MdiFilterRemoveOutline.vue | 8 + src/components/Icons/MdiGithub.vue | 9 +- .../Icons/MdiMoonWaningCrescent.vue | 14 +- src/components/Icons/MdiWhiteBalanceSunny.vue | 8 +- src/main.ts | 3 +- src/router/index.ts | 2 +- src/stores/categories.db.ts | 5 +- src/stores/db.ts | 16 +- src/stores/statements.db.ts | 198 +++++++++++------- src/types/click-outside.d.ts | 2 +- src/views/HomeView.vue | 33 +-- src/views/_HomeView.dark.scss | 2 +- src/views/_HomeView.scss | 16 ++ 28 files changed, 320 insertions(+), 211 deletions(-) create mode 100644 src/components/AppFilter/_AppFilter.scss create mode 100644 src/components/Icons/MdiFilterMenu.vue create mode 100644 src/components/Icons/MdiFilterRemoveOutline.vue create mode 100644 src/views/_HomeView.scss diff --git a/package.json b/package.json index f5fcdcd7..1067109f 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false", "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", "format": "prettier --write src/", - "commit": "npm run type-check && npm run lint && npm run format && cz" + "commit": "npm run type-check && npm run lint && npm run format && git add . && cz" }, "dependencies": { "@vueuse/core": "^10.5.0", diff --git a/postcss.config.js b/postcss.config.js index 33ad091d..3b33f365 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,3 +1,4 @@ +// eslint-disable-next-line no-undef module.exports = { plugins: { tailwindcss: {}, diff --git a/src/assets/styles/color-scheme.scss b/src/assets/styles/color-scheme.scss index b9de2eca..f2a2937c 100644 --- a/src/assets/styles/color-scheme.scss +++ b/src/assets/styles/color-scheme.scss @@ -1,5 +1,5 @@ -body[color-scheme="dark"] { - @import "@/views/HomeView.dark"; +body[color-scheme='dark'] { + @import '@/views/HomeView.dark'; @import '@/components/AppCategory/_AppCategory.dark'; @import '@/components/AppStatementCard/_AppStatementCard.dark'; } diff --git a/src/assets/styles/main.scss b/src/assets/styles/main.scss index 6ad41ce6..273ea723 100644 --- a/src/assets/styles/main.scss +++ b/src/assets/styles/main.scss @@ -17,4 +17,3 @@ body { color: var(--color-ghostwhite); } } - diff --git a/src/assets/styles/variables.scss b/src/assets/styles/variables.scss index 086776d4..987b387a 100644 --- a/src/assets/styles/variables.scss +++ b/src/assets/styles/variables.scss @@ -1,6 +1,7 @@ :root { - --color-dark: #2E2E41; - --color-dark-light: #272C3A; + --color-dark: #2e2e41; + --color-dark-light: #272c3a; --color-dark-text: #242424; + --color-dark-icon: #4b5563; --color-ghostwhite: ghostwhite; } diff --git a/src/components/AppCategory/AppCategory.vue b/src/components/AppCategory/AppCategory.vue index fbd7f549..847035fa 100644 --- a/src/components/AppCategory/AppCategory.vue +++ b/src/components/AppCategory/AppCategory.vue @@ -1,27 +1,21 @@ - diff --git a/src/components/AppFilter/_AppFilter.scss b/src/components/AppFilter/_AppFilter.scss new file mode 100644 index 00000000..5c522cad --- /dev/null +++ b/src/components/AppFilter/_AppFilter.scss @@ -0,0 +1,25 @@ +.AppFilter { + font-family: 'Fira Mono', sans-serif; + @apply rounded-lg w-2/5 cursor-pointer relative bg-transparent border text-sm; + + input { + @apply w-full h-full p-3 rounded-lg relative; + &:focus { + @apply outline-amber-500; + } + } + + &__icon { + @apply absolute top-0 bottom-0 right-0 m-auto text-[var(--color-dark-icon)] w-10 flex justify-center items-center rounded-r-lg; + } + + &__dropdown { + @apply absolute top-10 z-10 bg-white border p-3 left-0 max-h-80 shadow-2xl rounded-lg overflow-y-scroll; + li { + @apply p-2 transition-all flex; + &:hover { + @apply bg-amber-100 rounded-lg; + } + } + } +} diff --git a/src/components/AppHeader/HeaderActions.vue b/src/components/AppHeader/HeaderActions.vue index 19e1e5fa..d9cf4a48 100644 --- a/src/components/AppHeader/HeaderActions.vue +++ b/src/components/AppHeader/HeaderActions.vue @@ -1,6 +1,6 @@ @@ -8,7 +8,13 @@ const GITHUB_URL = 'https://github.com/MartinsOnuoha/what-should-i-design'