()
| 113 | } |
| 114 | |
| 115 | _didRender() { |
| 116 | const svg = this.shadowRoot.getElementById('svg'); |
| 117 | this._clearNode(svg); |
| 118 | const s = this.getBoundingClientRect(); |
| 119 | const elev = Math.min(Math.max(1, this.elevation), 5); |
| 120 | const w = s.width + ((elev - 1) * 2); |
| 121 | const h = s.height + ((elev - 1) * 2); |
| 122 | svg.setAttribute("width", w); |
| 123 | svg.setAttribute("height", h); |
| 124 | wired.rectangle(svg, 0, 0, s.width, s.height); |
| 125 | for (var i = 1; i < elev; i++) { |
| 126 | (wired.line(svg, (i * 2), s.height + (i * 2), s.width + (i * 2), s.height + (i * 2))).style.opacity = (75 - (i * 10)) / 100; |
| 127 | (wired.line(svg, s.width + (i * 2), s.height + (i * 2), s.width + (i * 2), i * 2)).style.opacity = (75 - (i * 10)) / 100; |
| 128 | (wired.line(svg, (i * 2), s.height + (i * 2), s.width + (i * 2), s.height + (i * 2))).style.opacity = (75 - (i * 10)) / 100; |
| 129 | (wired.line(svg, s.width + (i * 2), s.height + (i * 2), s.width + (i * 2), i * 2)).style.opacity = (75 - (i * 10)) / 100; |
| 130 | } |
| 131 | this.classList.remove('pending'); |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | customElements.define('wired-button', WiredButton); |
no test coverage detected