diff --git a/icon-finder-light.png b/icon-finder-light.png new file mode 100644 index 0000000..12a001c Binary files /dev/null and b/icon-finder-light.png differ diff --git a/icon-finder.png b/icon-finder.png new file mode 100644 index 0000000..32633c0 Binary files /dev/null and b/icon-finder.png differ diff --git a/icon-finder2.png b/icon-finder2.png new file mode 100644 index 0000000..76a7fbc Binary files /dev/null and b/icon-finder2.png differ diff --git a/package.json b/package.json index 9b3af1c..f159d92 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iconexplorer.app", - "version": "0.0.1", + "version": "2.0.0", "description": "Searchable Quasar SVG icons", "productName": "Quasar Framework SVG icons", "author": "Jeff Galbraith ", diff --git a/public/favicon.ico b/public/favicon.ico index ae7bbdb..47d0eac 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/icon-finder-light.png b/public/icon-finder-light.png new file mode 100644 index 0000000..12a001c Binary files /dev/null and b/public/icon-finder-light.png differ diff --git a/public/icons/favicon-128x128.png b/public/icons/favicon-128x128.png index 1401176..0414a7d 100644 Binary files a/public/icons/favicon-128x128.png and b/public/icons/favicon-128x128.png differ diff --git a/public/icons/favicon-16x16.png b/public/icons/favicon-16x16.png index 679063a..81394c9 100644 Binary files a/public/icons/favicon-16x16.png and b/public/icons/favicon-16x16.png differ diff --git a/public/icons/favicon-32x32.png b/public/icons/favicon-32x32.png index fd1fbc6..9a03a21 100644 Binary files a/public/icons/favicon-32x32.png and b/public/icons/favicon-32x32.png differ diff --git a/public/icons/favicon-96x96.png b/public/icons/favicon-96x96.png index e93b80a..c91ebb1 100644 Binary files a/public/icons/favicon-96x96.png and b/public/icons/favicon-96x96.png differ diff --git a/quasar.conf.js b/quasar.conf.js index a690734..b1012a5 100644 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -116,7 +116,8 @@ module.exports = configure(function (ctx) { plugins: [ 'Dark', 'LoadingBar', - 'Notify' + 'Notify', + 'Loading' ] }, diff --git a/src/App.vue b/src/App.vue index 38442ee..125d355 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,8 +4,13 @@ diff --git a/src/assets/profile.png b/src/assets/profile.png new file mode 100644 index 0000000..87e1385 Binary files /dev/null and b/src/assets/profile.png differ diff --git a/src/assets/store.js b/src/assets/store.js new file mode 100644 index 0000000..855ca95 --- /dev/null +++ b/src/assets/store.js @@ -0,0 +1,120 @@ +import { inject, provide, reactive, computed } from 'vue' +import { storeKey } from './symbols.js' + +export function useStore () { + return inject(storeKey) +} + +export function provideStore () { + const makeReactive = process.env.SERVER !== true ? reactive : val => val + const store = makeReactive({ + importedIcons: null, + filter: '', + iconSet: null, + iconSize: '128px', + cart: {}, + leftDrawerOpen: false, + rightDrawerOpen: false, + showIconDialog: false + }) + + /* + cart looks like this: + { + packageName: { + iconSet: { + iconName: path, + ... + }, + ... + } + } + */ + + store.addItem = function (packageName, iconSet, name, path) { + const item = store.findItem(packageName, iconSet, name) + if (!item) { + if (!store.cart[ packageName ]) store.cart[ packageName ] = {} + if (!store.cart[ packageName ][ iconSet ]) store.cart[ packageName ][ iconSet ] = {} + store.cart[ packageName ][ iconSet ][ name ] = path + + return true + } + return false + } + + store.removeItem = function (packageName, iconSet, name) { + if (store.cart[ packageName ]) { + if (store.cart[ packageName ][ iconSet ]) { + if (store.cart[ packageName ][ iconSet ][ name ]) { + delete store.cart[ packageName ][ iconSet ][ name ] + // should parents be removed? + if (Object.keys(store.cart[ packageName ][ iconSet ]).length === 0) { + delete store.cart[ packageName ][ iconSet ] + if (Object.keys(store.cart[ packageName ]).length === 0) { + delete store.cart[ packageName ] + } + } + return true + } + } + } + return false + } + + store.removeAll = function () { + const keys = Object.keys(store.cart) + for (let index = 0; index < keys.length; ++index) { + delete store.cart[ keys[ index ] ] + } + } + + // returns store item or null + store.findItem = function (packageName, iconSet, name) { + if (store.cart[ packageName ]) { + if (store.cart[ packageName ][ iconSet ]) { + if (store.cart[ packageName ][ iconSet ][ name ]) { + return store.cart[ packageName ][ iconSet ][ name ] + } + } + } + + return null // not found + } + + // When not SSR, this becomes reactive (when injected into store) + // but, on server, it's not reactive and need '.value' when accessing it + // should not be a problem because adding/removing from the cart is user initiated + store.selectedIconsFlattened = computed(() => { + const icons = []; + for (const packageName in store.cart) { + for (const iconSet in store.cart[ packageName ]) { + for (const iconName in store.cart[ packageName ][ iconSet ]) { + const path = store.cart[ packageName ][ iconSet ][ iconName ] + icons.push({ + packageName, + iconSet, + iconName, + path + }) + } + } + } + + return icons + }) + + store.isCartIcon = function (name) { + for (let index = 0; index < store.selectedIconsFlattened.length; ++index) { + if (store.selectedIconsFlattened[ index ].iconName === name) { + return true + } + } + return false + } + + provide( + storeKey, + store + ) +} diff --git a/src/assets/symbols.js b/src/assets/symbols.js new file mode 100644 index 0000000..967854c --- /dev/null +++ b/src/assets/symbols.js @@ -0,0 +1,6 @@ +const hasSymbol = typeof Symbol === 'function' + && typeof Symbol.toStringTag === 'symbol' + +export const storeKey = hasSymbol === true + ? Symbol('_store_') + : '_store_' diff --git a/src/components/SvgIconViewer.vue b/src/components/SvgIconViewer.vue new file mode 100644 index 0000000..65b9f60 --- /dev/null +++ b/src/components/SvgIconViewer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/src/css/app.sass b/src/css/app.sass index cdd2286..0284adc 100644 --- a/src/css/app.sass +++ b/src/css/app.sass @@ -1,5 +1,8 @@ // app global css in Sass form +.font-mono + font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace + .intersetion-icon-box padding: 2px width: 100% diff --git a/src/index.template.html b/src/index.template.html index 026f21e..d82eecc 100644 --- a/src/index.template.html +++ b/src/index.template.html @@ -24,9 +24,9 @@ - - - + + + diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index fd23b05..cea7969 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -1,5 +1,5 @@ + + diff --git a/src/pages/Index.vue b/src/pages/Index.vue index abeaf59..8bbac77 100644 --- a/src/pages/Index.vue +++ b/src/pages/Index.vue @@ -2,104 +2,198 @@ - -
- - {{ currentName }} - -
-
- -
- - - - Copy name to clipboard - - - Copy SVG to clipboard - - -
- - -
- - - + + Copy SVG name to clipboard + + Name + + + + Copy SVG inlined to clipboard + + Inline + + + + Copy SVG import to clipboard + + Import + + + + Copy QIcon with SVG name to clipboard + + QIcon + + + + Copy QBtn with SVG name to clipboard + -
Totals: {{ filteredCount }}/{{ iconCount }}
+ QBtn +
+ + + Copy raw SVG to clipboard + + Raw + +
+
+
+ +
+ + + +
+
+ +
+
Totals: {{ filteredCount }}/{{ iconCount }}
-
- -
- -
- {{ name }} -
- - {{ name }} - -
-
-
+