From 820f45a080ef31bcffc82c1dd1c20af8d4350475 Mon Sep 17 00:00:00 2001 From: RSurya99 Date: Sun, 30 Jan 2022 14:25:15 +0700 Subject: [PATCH] feat: add plugin aos --- mixins/aos.js | 9 +++++++++ nuxt.config.js | 2 +- package.json | 1 + pages/index.vue | 10 ++++++++-- yarn.lock | 21 ++++++++++++++++++++- 5 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 mixins/aos.js diff --git a/mixins/aos.js b/mixins/aos.js new file mode 100644 index 0000000..283cac2 --- /dev/null +++ b/mixins/aos.js @@ -0,0 +1,9 @@ +// mixins/aos.js +import AOS from 'aos' +import 'aos/dist/aos.css' + +export default { + mounted() { + AOS.init({ disable: 'phone' }) + }, +} diff --git a/nuxt.config.js b/nuxt.config.js index 7d1d3c9..65fdb48 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -18,7 +18,7 @@ export default { }, ], }, - css: ['@/assets/css/main.css'], + css: ['@/assets/css/main.css', 'aos/dist/aos.css'], plugins: ['~/plugins/smooth-scroll.js', '~/plugins/mdi.js'], components: true, buildModules: ['@nuxtjs/eslint-module', '@nuxt/postcss8'], diff --git a/package.json b/package.json index aea1764..a9c59b8 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "dependencies": { "@tailwindcss/aspect-ratio": "^0.4.0", "@tailwindcss/forms": "^0.4.0", + "aos": "^2.3.4", "chart.js": "2.9.4", "core-js": "^3.19.3", "nuxt": "^2.15.8", diff --git a/pages/index.vue b/pages/index.vue index 7f70088..92f2ec5 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -1,11 +1,15 @@