Skip to content

Commit

Permalink
gradient instagram icon. fixed inline svg multi
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnuraghavb committed Jan 9, 2022
1 parent f54ecd3 commit aeb7423
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 16 deletions.
12 changes: 11 additions & 1 deletion assets/icons/instagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion components/Action.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div
class="w-6 h-6"
:class="name == 'secondaryActions' ? null : 'action'"
v-html="require(`~/assets/icons/${item.icon}.svg?include`)"
v-html="getSVG(item)"
></div>
</div>
<div class="w-full">
Expand Down Expand Up @@ -50,8 +50,10 @@
</template>

<script>
import utils from '@/mixins/utils'
export default {
props: ['name', 'item', 'index', 'type', 'buttonBg', 'removeAction'],
mixins: [utils],
mounted() {
this.$refs.input.focus()
},
Expand Down
13 changes: 5 additions & 8 deletions components/Preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
name="author"
content="EnBizCard - An Open-Source Digital Business Card Generator"
/>
<meta name="url" content="https://enbizcard.vercel.app/" />
<meta name="url" content="https://enbizcard.vishnuraghav.com/" />
<meta name="designer" content="Vishnu Raghav" />
<meta
property="og:title"
Expand Down Expand Up @@ -252,12 +252,7 @@
:style="{ backgroundColor: item.color }"
:aria-label="item.name"
>
<div
class="icon"
v-html="
require(`~/assets/icons/${item.icon}.svg?include`)
"
></div>
<div class="icon" v-html="getSVG(item)"></div>
</a>
</div>
</div>
Expand Down Expand Up @@ -341,7 +336,7 @@
Created with
<a
class="textColor"
href="https://enbizcard.vercel.app/"
href="https://enbizcard.vishnuraghav.com/"
target="_blank"
rel="noopener noreferrer"
>EnBizCard</a
Expand All @@ -357,6 +352,7 @@
import MediaPlayer from './MediaPlayer'
import DocumentDownloader from './DocumentDownloader'
import ProductShowcase from './ProductShowcase'
import utils from '@/mixins/utils'
import { mapState } from 'vuex'
export default {
Expand All @@ -376,6 +372,7 @@ export default {
'hasLightBG',
'pubKeyIsValid',
],
mixins: [utils],
components: {
MediaPlayer,
DocumentDownloader,
Expand Down
22 changes: 22 additions & 0 deletions mixins/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export default {
methods: {
randomStr(len) {
let c = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
let s = ''
for (let i = 0; i < len; i++)
s += c.charAt(Math.floor(Math.random() * c.length))
return s
},
getSVG(item) {
let svg = require(`~/assets/icons/${item.icon}.svg?include`)
if (item.gradientIcon) {
for (let i = 1; i < 10; i++) {
let regex = new RegExp(`gradient${i}`, 'g')
if (regex.test(svg)) svg = svg.replace(regex, this.randomStr(7))
else break
}
return svg
} else return svg
},
},
}
1 change: 0 additions & 1 deletion nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ export default {
optipng: {
optimizationLevel: 7,
},
svgo: {},
},
/*
** Nuxt.js modules
Expand Down
21 changes: 16 additions & 5 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,9 @@ export default {
href: 'https://instagram.com/',
placeholder: 'username',
value: null,
color: '#c32aa3',
color: '#ffffff',
light: 1,
gradientIcon: 1,
label: 'Instagram username',
},
{
Expand Down Expand Up @@ -947,11 +949,11 @@ export default {
{
name: 'LinkedIn',
icon: 'linkedin',
href: 'https://linkedin.com/in/',
placeholder: 'username',
href: 'https://linkedin.com/',
placeholder: 'in/username or company/companyname',
value: null,
color: '#0077b5',
label: 'Linkedin username',
label: 'Linkedin username or companyname',
},
{
name: 'YouTube',
Expand Down Expand Up @@ -1191,6 +1193,15 @@ export default {
light: 1,
label: 'Cash App username',
},
{
name: 'Siilo',
icon: 'siilo',
href: 'https://app.siilo.com/qr/',
placeholder: 'userid',
value: null,
color: '#17233b',
label: 'Siilo userid',
},
],
},
featured: [
Expand Down Expand Up @@ -1527,7 +1538,7 @@ export default {
})
let guide = new Blob(
[
'<html><head><meta http-equiv="refresh" content="0; url=https://enbizcard.vercel.app/hosting-guide" /></head></html>',
'<html><head><meta http-equiv="refresh" content="0; url=https://enbizcard.vishnuraghav.com/hosting-guide" /></head></html>',
],
{
type: 'text/html',
Expand Down

0 comments on commit aeb7423

Please sign in to comment.