|
@@ -3,18 +3,19 @@
|
|
*/
|
|
*/
|
|
|
|
|
|
class Svg {
|
|
class Svg {
|
|
- constructor (icons) {
|
|
|
|
- this.icons = icons;
|
|
|
|
|
|
+ constructor (options) {
|
|
|
|
+ this.icons = options.icons;
|
|
|
|
+ this.iconColor = options.iconColor;
|
|
}
|
|
}
|
|
|
|
|
|
get (type) {
|
|
get (type) {
|
|
// Some SVG icons don't change icon size using viewBox. Ex.: Material Icons
|
|
// Some SVG icons don't change icon size using viewBox. Ex.: Material Icons
|
|
- // To fix these cases a optional index was added to icon object
|
|
|
|
|
|
+ // To fix these cases a optional index was added to icon object when change icon
|
|
|
|
+ // size is necessary
|
|
|
|
|
|
return `
|
|
return `
|
|
- <svg xmlns:xlink="http://www.w3.org/1999/xlink" width="${this.icons[type][3] || '100%'}" height="${this.icons[type][3] || '100%'}" version="1.1" viewBox="${this.icons[type][0]}">
|
|
|
|
- <use xlink:href="#dplayer-${type}"></use>
|
|
|
|
- <path class="dplayer-fill" d="${this.icons[type][1]}" id="dplayer-${type}"></path>
|
|
|
|
|
|
+ <svg xmlns="http://www.w3.org/2000/svg" width="${this.icons[type][2] || '100%'}" height="${this.icons[type][2] || '100%'}" version="1.1" viewBox="${this.icons[type][0]}">
|
|
|
|
+ <path class="dplayer-fill" style="fill:${this.iconColor}" d="${this.icons[type][1]}" id="dplayer-${type}"></path>
|
|
</svg>
|
|
</svg>
|
|
`;
|
|
`;
|
|
}
|
|
}
|