mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
fix: assign viewBox property to svg waves (#1247)
This commit is contained in:
parent
61d60fd173
commit
300b5b9ef3
@ -4,6 +4,7 @@ import { randomIntFromInterval } from './numbers'
|
||||
export interface WaveProperties {
|
||||
width?: number
|
||||
height?: number
|
||||
viewBox?: string
|
||||
color?: string
|
||||
fill?: boolean
|
||||
layerCount?: number
|
||||
@ -53,6 +54,7 @@ export class SvgWaves {
|
||||
return {
|
||||
width: 99,
|
||||
height: 99,
|
||||
viewBox: '0 0 99 99',
|
||||
color: WaveColors.Pink,
|
||||
fill: true,
|
||||
layerCount: 4,
|
||||
@ -107,8 +109,7 @@ export class SvgWaves {
|
||||
|
||||
generateSvg(): Element {
|
||||
const svg = document.createElementNS(SvgWaves.xmlns, 'svg')
|
||||
svg.setAttribute('width', this.properties.width.toString())
|
||||
svg.setAttribute('height', this.properties.height.toString())
|
||||
svg.setAttribute('viewBox', this.properties.viewBox.toString())
|
||||
svg.setAttribute('fill', this.properties.fill ? undefined : 'transparent')
|
||||
svg.setAttribute('xmlns', SvgWaves.xmlns)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user