From 02dafd6a2fdae1802764cbe6fa558b4882ad294b Mon Sep 17 00:00:00 2001 From: Corentin Thomasset Date: Sat, 6 Feb 2021 11:14:28 +0100 Subject: [PATCH] feat: first tool base --- .eslintrc.js | 4 +- assets/variables.scss | 1 + components/Tool.vue | 30 +++++++ components/ToolWrapper.vue | 61 +++++++++++++++ layouts/default.vue | 133 ++++++++++++++++++-------------- mixins/copyable.ts | 18 +++++ nuxt.config.js | 13 +++- package-lock.json | 41 +++++++++- package.json | 7 +- pages/crypto/TokenGenerator.vue | 79 +++++++++++++++++++ pages/index.vue | 75 +----------------- pages/inspire.vue | 15 ---- static/README.md | 11 --- static/humans.txt | 4 + static/robots.txt | 2 + 15 files changed, 326 insertions(+), 168 deletions(-) create mode 100644 components/Tool.vue create mode 100644 components/ToolWrapper.vue create mode 100644 mixins/copyable.ts create mode 100644 pages/crypto/TokenGenerator.vue delete mode 100644 pages/inspire.vue delete mode 100644 static/README.md create mode 100644 static/humans.txt create mode 100644 static/robots.txt diff --git a/.eslintrc.js b/.eslintrc.js index 5c067fcc..b0505f34 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -10,6 +10,8 @@ module.exports = { ], // add your custom rules here rules: { - 'space-before-function-paren': 'off' + 'space-before-function-paren': 'off', + 'object-curly-spacing': 'off', + 'no-undef': 'off' // will be catch by the tsc compiler } } diff --git a/assets/variables.scss b/assets/variables.scss index f60e6090..a76dcbf1 100644 --- a/assets/variables.scss +++ b/assets/variables.scss @@ -2,3 +2,4 @@ // // The variables you want to modify // $font-size-root: 20px; + diff --git a/components/Tool.vue b/components/Tool.vue new file mode 100644 index 00000000..28a30ec5 --- /dev/null +++ b/components/Tool.vue @@ -0,0 +1,30 @@ + diff --git a/components/ToolWrapper.vue b/components/ToolWrapper.vue new file mode 100644 index 00000000..0f39bf3b --- /dev/null +++ b/components/ToolWrapper.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/layouts/default.vue b/layouts/default.vue index 02d3826e..d1a29848 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -2,11 +2,21 @@ +
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis corporis cumque dolore esse eveniet + exercitationem explicabo ipsa libero necessitatibus numquam optio pariatur, perferendis placeat porro ullam vel + velit voluptas voluptates? +
+ + + + + + {{ item.icon }} - +
- - - - mdi-{{ `chevron-${miniVariant ? 'right' : 'left'}` }} - - - mdi-application - - - mdi-minus - - - - - mdi-menu - + + + + + + - + - - - - - - mdi-repeat - - - Switch drawer (click me) - - - - - © {{ new Date().getFullYear() }} - + + +
- + + diff --git a/mixins/copyable.ts b/mixins/copyable.ts new file mode 100644 index 00000000..144f2728 --- /dev/null +++ b/mixins/copyable.ts @@ -0,0 +1,18 @@ +const copyToClipboard = (text: string) => { + const input = document.createElement('textarea') + input.innerHTML = text + document.body.appendChild(input) + input.select() + const result = document.execCommand('copy') + document.body.removeChild(input) + return result +} + +export const copyable = { + methods: { + copy(text: string, toastText = 'Copied to clipboard !') { + copyToClipboard(text) + this.$toast.success(toastText) + } + } +} diff --git a/nuxt.config.js b/nuxt.config.js index fd43999b..8583b99f 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -1,8 +1,8 @@ import colors from 'vuetify/es5/util/colors' export default { - // Disable server-side rendering (https://go.nuxtjs.dev/ssr-mode) - ssr: false, + // Enable server-side rendering (https://go.nuxtjs.dev/ssr-mode) + ssr: true, // Target (https://go.nuxtjs.dev/config-target) target: 'static', @@ -50,17 +50,22 @@ export default { // Vuetify module configuration (https://go.nuxtjs.dev/config-vuetify) vuetify: { customVariables: ['~/assets/variables.scss'], + treeShake: true, theme: { dark: true, + options: { customProperties: true }, themes: { dark: { - primary: colors.blue.darken2, + primary: '#05e677', accent: colors.grey.darken3, secondary: colors.amber.darken3, info: colors.teal.lighten1, warning: colors.amber.base, error: colors.deepOrange.accent4, - success: colors.green.accent3 + success: colors.green.accent3, + background: '#324148', + foreground: '#28353b', + toolbar: '#243137' } } } diff --git a/package-lock.json b/package-lock.json index d8fcad44..577e5ad7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3968,9 +3968,9 @@ "dev": true }, "axios": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.0.tgz", - "integrity": "sha512-fmkJBknJKoZwem3/IKSSLpkdNXZeBu5Q7GA/aRsr2btgrptmSCxi2oFjZHqGdK9DoTil9PIHlPIZw2EcRJXRvw==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", "requires": { "follow-redirects": "^1.10.0" } @@ -11612,6 +11612,18 @@ "@nuxt/webpack": "2.14.12" } }, + "nuxt-property-decorator": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/nuxt-property-decorator/-/nuxt-property-decorator-2.9.1.tgz", + "integrity": "sha512-dE2GrrGKZMhv0dHAr+Lmj+JOQfjIouINgF58QNRDFNOZXMJrXxKO5zGqvCRwmx3hxqqwht7TXHdz9w1AnvL2IA==", + "dev": true, + "requires": { + "vue-class-component": "^7.2.6", + "vue-property-decorator": "^9.0.0", + "vuex-class": "^0.3.2", + "vuex-module-decorators": "^1.0.1" + } + }, "nwsapi": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", @@ -15823,6 +15835,12 @@ "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.12.tgz", "integrity": "sha512-uhmLFETqPPNyuLLbsKz6ioJ4q7AZHzD8ZVFNATNyICSZouqP2Sz0rotWQC8UNBF6VGSCs5abnKJoStA6JbCbfg==" }, + "vue-class-component": { + "version": "7.2.6", + "resolved": "https://registry.npmjs.org/vue-class-component/-/vue-class-component-7.2.6.tgz", + "integrity": "sha512-+eaQXVrAm/LldalI272PpDe3+i4mPis0ORiMYxF6Ae4hyuCh15W8Idet7wPUEs4N4YptgFHGys4UrgNQOMyO6w==", + "dev": true + }, "vue-client-only": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/vue-client-only/-/vue-client-only-2.0.0.tgz", @@ -16071,11 +16089,28 @@ "loader-utils": "^1.2.0" } }, + "vuetify-toast-snackbar": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/vuetify-toast-snackbar/-/vuetify-toast-snackbar-0.6.1.tgz", + "integrity": "sha512-F2bLPMXiw7qQgX68adSu0zQrMTKODN5JAzCP8AP/HGhz/Bz1z24QbvYcX0fyHnG/yP6PAPkpMCXsLQSq6HV0Ag==" + }, "vuex": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.0.tgz", "integrity": "sha512-W74OO2vCJPs9/YjNjW8lLbj+jzT24waTo2KShI8jLvJW8OaIkgb3wuAMA7D+ZiUxDOx3ubwSZTaJBip9G8a3aQ==" }, + "vuex-class": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/vuex-class/-/vuex-class-0.3.2.tgz", + "integrity": "sha512-m0w7/FMsNcwJgunJeM+wcNaHzK2KX1K1rw2WUQf7Q16ndXHo7pflRyOV/E8795JO/7fstyjH3EgqBI4h4n4qXQ==", + "dev": true + }, + "vuex-module-decorators": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vuex-module-decorators/-/vuex-module-decorators-1.0.1.tgz", + "integrity": "sha512-FLWZsXV5XAtl/bcKUyQFpnSBtpc3wK/7zSdy9oKbyp71mZd4ut5y2zSd219wWW9OG7WUOlVwac4rXFFDVnq7ug==", + "dev": true + }, "w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", diff --git a/package.json b/package.json index 42d55d7f..b3b5f49c 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "@nuxtjs/axios": "^5.12.2", "@nuxtjs/pwa": "^3.0.2", "core-js": "^3.6.5", - "nuxt": "^2.14.6" + "nuxt": "^2.14.6", + "vuetify-toast-snackbar": "^0.6.1" }, "devDependencies": { "@nuxt/types": "^2.14.6", @@ -36,8 +37,8 @@ "jest": "^26.5.0", "less": "^4.0.0", "less-loader": "^7.1.0", + "nuxt-property-decorator": "^2.9.1", "ts-jest": "^26.4.1", - "vue-jest": "^3.0.4", - "vue-property-decorator": "^9.1.2" + "vue-jest": "^3.0.4" } } diff --git a/pages/crypto/TokenGenerator.vue b/pages/crypto/TokenGenerator.vue new file mode 100644 index 00000000..48b40ba9 --- /dev/null +++ b/pages/crypto/TokenGenerator.vue @@ -0,0 +1,79 @@ + + + + + diff --git a/pages/index.vue b/pages/index.vue index 0b734e1e..f6296e1b 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -1,78 +1,7 @@ diff --git a/pages/inspire.vue b/pages/inspire.vue deleted file mode 100644 index 86232831..00000000 --- a/pages/inspire.vue +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/static/README.md b/static/README.md deleted file mode 100644 index cf004353..00000000 --- a/static/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# STATIC - -**This directory is not required, you can delete it if you don't want to use it.** - -This directory contains your static files. -Each file inside this directory is mapped to `/`. -Thus you'd want to delete this README.md before deploying to production. - -Example: `/static/robots.txt` is mapped as `/robots.txt`. - -More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#static). diff --git a/static/humans.txt b/static/humans.txt new file mode 100644 index 00000000..a4f5b0a3 --- /dev/null +++ b/static/humans.txt @@ -0,0 +1,4 @@ +/* TEAM */ +Developer: Corentin Thomasset +Site: https://github.com/CorentinTh +Twitter: @cthmsst diff --git a/static/robots.txt b/static/robots.txt new file mode 100644 index 00000000..eb053628 --- /dev/null +++ b/static/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: