From ea4193e6482da4bbc697071ded91f4bf3959d529 Mon Sep 17 00:00:00 2001 From: Driss Chelouati Date: Mon, 26 Sep 2022 23:27:03 +0100 Subject: [PATCH 01/16] feat: add basic nav [wip], add hero [wip] --- .eslintrc | 1 + playground/app.vue | 263 +----- playground/assets/img/logo.svg | 18 + playground/assets/img/mountains.svg | 764 ++++++++++++++++++ playground/components/Hero.vue | 58 ++ playground/components/Navigation.vue | 136 ++++ playground/composables/useDarkmode.ts | 32 + .../composables/useWindowScrollFixed.ts | 16 + playground/nuxt.config.ts | 9 + playground/pages/api.vue | 3 + playground/pages/index.vue | 269 ++++++ 11 files changed, 1312 insertions(+), 257 deletions(-) create mode 100644 playground/assets/img/logo.svg create mode 100644 playground/assets/img/mountains.svg create mode 100644 playground/components/Hero.vue create mode 100644 playground/components/Navigation.vue create mode 100644 playground/composables/useDarkmode.ts create mode 100644 playground/composables/useWindowScrollFixed.ts create mode 100644 playground/pages/api.vue create mode 100644 playground/pages/index.vue diff --git a/.eslintrc b/.eslintrc index adaea51..0facac4 100644 --- a/.eslintrc +++ b/.eslintrc @@ -20,6 +20,7 @@ "error", { "whitelist": ["^ninja-(.*)$"] } ], + "tailwindcss/classnames-order": "off", "prettier-vue/prettier": [ "error", { diff --git a/playground/app.vue b/playground/app.vue index 3c207aa..0a7dc7f 100644 --- a/playground/app.vue +++ b/playground/app.vue @@ -1,264 +1,13 @@ - - + \ No newline at end of file diff --git a/playground/assets/img/logo.svg b/playground/assets/img/logo.svg new file mode 100644 index 0000000..a95788d --- /dev/null +++ b/playground/assets/img/logo.svg @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/playground/assets/img/mountains.svg b/playground/assets/img/mountains.svg new file mode 100644 index 0000000..66b7caf --- /dev/null +++ b/playground/assets/img/mountains.svg @@ -0,0 +1,764 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/playground/components/Hero.vue b/playground/components/Hero.vue new file mode 100644 index 0000000..69335c7 --- /dev/null +++ b/playground/components/Hero.vue @@ -0,0 +1,58 @@ + diff --git a/playground/components/Navigation.vue b/playground/components/Navigation.vue new file mode 100644 index 0000000..84582a0 --- /dev/null +++ b/playground/components/Navigation.vue @@ -0,0 +1,136 @@ + + + diff --git a/playground/composables/useDarkmode.ts b/playground/composables/useDarkmode.ts new file mode 100644 index 0000000..1068e1e --- /dev/null +++ b/playground/composables/useDarkmode.ts @@ -0,0 +1,32 @@ +import { + createSharedComposable, + usePreferredDark, + useToggle +} from '@vueuse/core' + +const sharedDarkmode = createSharedComposable(() => { + const preferredDark = usePreferredDark() + const colorSchema = useCookie<'light' | 'dark' | undefined>('color-schema', { + default: () => undefined + }) + + const isDark = computed({ + get() { + return colorSchema.value + ? colorSchema.value === 'dark' + : preferredDark.value + }, + set(v: boolean) { + colorSchema.value = v ? 'dark' : 'light' + } + }) + + const toggleDark = useToggle(isDark) + + return { + isDark, + toggleDark + } +}) + +export const useDarkmode = () => sharedDarkmode() diff --git a/playground/composables/useWindowScrollFixed.ts b/playground/composables/useWindowScrollFixed.ts new file mode 100644 index 0000000..fe4e019 --- /dev/null +++ b/playground/composables/useWindowScrollFixed.ts @@ -0,0 +1,16 @@ +import { useWindowScroll } from '@vueuse/core' + +export function useWindowScrollFixed() { + const { x, y } = useWindowScroll() + + onMounted(() => { + x.value = 0 + y.value = 0 + nextTick(() => { + x.value = window.pageXOffset + y.value = window.pageYOffset + }) + }) + + return { x, y } +} diff --git a/playground/nuxt.config.ts b/playground/nuxt.config.ts index 338f593..a03d0db 100644 --- a/playground/nuxt.config.ts +++ b/playground/nuxt.config.ts @@ -6,6 +6,15 @@ export default defineNuxtConfig({ toaster: {}, app: { head: { + link: [ + // + { rel: 'preconnect', href: 'https://fonts.googleapis.com' }, + { rel: 'preconnect', href: 'https://fonts.gstatic.com' }, + { + rel: 'stylesheet', + href: 'https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900?family=Elsie+Swash+Caps:wght@400;900&display=swap' + } + ], script: [ { src: 'https://cdn.tailwindcss.com' diff --git a/playground/pages/api.vue b/playground/pages/api.vue new file mode 100644 index 0000000..2e3d649 --- /dev/null +++ b/playground/pages/api.vue @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/playground/pages/index.vue b/playground/pages/index.vue new file mode 100644 index 0000000..cddaa7d --- /dev/null +++ b/playground/pages/index.vue @@ -0,0 +1,269 @@ + + + + + From ac27b6875577141122a2f1e74107133303249ed5 Mon Sep 17 00:00:00 2001 From: Driss Chelouati Date: Tue, 27 Sep 2022 11:06:13 +0100 Subject: [PATCH 02/16] feat: polish navigation, add toast UI examples for hero --- .npmrc | 2 + package.json | 2 +- playground/app.vue | 6 +- playground/assets/img/logo-text.svg | 12 + playground/assets/img/logo.svg | 15 +- playground/components/Hero.vue | 41 +++- playground/components/Navigation.vue | 6 +- playground/components/toast/ActionButtons.vue | 18 ++ .../components/toast/IconSoloDanger.vue | 40 ++++ playground/components/toast/IconSuccess.vue | 17 ++ playground/components/toast/LabelInfo.vue | 19 ++ playground/components/toast/LabelSuccess.vue | 23 ++ .../components/toast/UserReplyClose.vue | 34 +++ pnpm-lock.yaml | 216 +++++++++--------- 14 files changed, 326 insertions(+), 125 deletions(-) create mode 100644 .npmrc create mode 100644 playground/assets/img/logo-text.svg create mode 100644 playground/components/toast/ActionButtons.vue create mode 100644 playground/components/toast/IconSoloDanger.vue create mode 100644 playground/components/toast/IconSuccess.vue create mode 100644 playground/components/toast/LabelInfo.vue create mode 100644 playground/components/toast/LabelSuccess.vue create mode 100644 playground/components/toast/UserReplyClose.vue diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..cfe5d6d --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +strict-peer-dependencies=false +shamefully-hoist=true \ No newline at end of file diff --git a/package.json b/package.json index 2604753..5eb4e9c 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@antfu/eslint-config": "^0.27.0", "@nuxt/module-builder": "latest", "@nuxt/schema": "^3.0.0-rc.11", - "eslint": "8.23.1", + "eslint": "8.24.0", "eslint-config-prettier": "8.5.0", "eslint-plugin-prettier-vue": "4.2.0", "eslint-plugin-tailwindcss": "3.6.1", diff --git a/playground/app.vue b/playground/app.vue index 0a7dc7f..e10d7b3 100644 --- a/playground/app.vue +++ b/playground/app.vue @@ -1,5 +1,9 @@ + +