forked from vishnuraghavb/EnBizCard
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gradient instagram icon. fixed inline svg multi
- Loading branch information
vishnuraghavb
committed
Jan 9, 2022
1 parent
f54ecd3
commit aeb7423
Showing
6 changed files
with
57 additions
and
16 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -207,7 +207,6 @@ export default { | |
optipng: { | ||
optimizationLevel: 7, | ||
}, | ||
svgo: {}, | ||
}, | ||
/* | ||
** Nuxt.js modules | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters