12345678910111213141516171819202122232425262728293031323334 |
- const removeChildren = (element) => {
- if (!element) {
- return
- }
- while (element.firstChild) {
- element.removeChild(element.firstChild)
- }
- }
- AFRAME.registerComponent('customize-buttons-in-capture-preview', {
- init() {
- console.log('customizeButtonsInCapturePreviewComponent.init')
- this.downloadButton = document.querySelector('#downloadButton')
- this.actionButton = document.querySelector('#actionButton')
- removeChildren(this.downloadButton)
- removeChildren(this.actionButton)
- this.downloadButton.classList.remove('icon-button')
- this.downloadButton.classList.add('capture-preview-button')
- this.actionButton.classList.add('capture-preview-button')
- this.downloadButton.innerHTML = `<svg width="47" height="47" viewBox="0 0 47 47" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M38.4545 0H34.1818V12.8182C34.1818 13.9975 33.2247 14.9545 32.0455 14.9545H12.8182C11.6389 14.9545 10.6818 13.9975 10.6818 12.8182V0H4.27273C1.91205 0 0 1.91205 0 4.27273V42.7273C0 45.088 1.91205 47 4.27273 47H42.7273C45.088 47 47 45.088 47 42.7273V8.54545L38.4545 0ZM38.4545 42.7273H8.54545V29.9091C8.54545 27.5484 10.4575 25.6364 12.8182 25.6364H34.1818C36.5425 25.6364 38.4545 27.5484 38.4545 29.9091V42.7273Z" fill="white"/>
- <path d="M29.5931 0H25.2412V10.4444H29.5931V0Z" fill="white"/>
- </svg>
- <span>Сохранить</span>`
- this.actionButton.innerHTML = `<svg width="47" height="47" viewBox="0 0 47 47" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path fill-rule="evenodd" clip-rule="evenodd" d="M45.0333 11.462C46.2925 10.2028 46.9999 8.49503 46.9999 6.71429C46.9999 4.93355 46.2925 3.22574 45.0333 1.96657C43.7741 0.707397 42.0663 0 40.2856 0C38.5049 0 36.7971 0.707397 35.5379 1.96657C34.2787 3.22574 33.5713 4.93355 33.5713 6.71429C33.5713 7.19067 33.6219 7.66184 33.7202 8.1206L11.7785 19.0915C11.6773 18.9752 11.5717 18.862 11.462 18.7523C10.2028 17.4932 8.49503 16.7858 6.71429 16.7858C4.93355 16.7858 3.22574 17.4932 1.96657 18.7523C0.707397 20.0115 0 21.7193 0 23.5C0 25.2808 0.707397 26.9886 1.96657 28.2478C3.22574 29.5069 4.93355 30.2143 6.71429 30.2143C8.49503 30.2143 10.2028 29.5069 11.462 28.2478C11.5717 28.138 11.6772 28.0249 11.7785 27.9086L33.7202 38.8795C33.6219 39.3382 33.5713 39.8094 33.5713 40.2857C33.5713 42.0664 34.2787 43.7742 35.5379 45.0334C36.7971 46.2926 38.5049 47 40.2856 47C42.0663 47 43.7741 46.2926 45.0333 45.0334C46.2925 43.7742 46.9999 42.0664 46.9999 40.2857C46.9999 38.505 46.2925 36.7972 45.0333 35.538C43.7741 34.2788 42.0663 33.5714 40.2856 33.5714C38.5049 33.5714 36.7971 34.2788 35.5379 35.538C35.4282 35.6476 35.3228 35.7606 35.2216 35.8768L13.2798 24.9059C13.378 24.4473 13.4286 23.9763 13.4286 23.5C13.4286 23.0238 13.378 22.5528 13.2798 22.0942L35.2217 11.1232C35.3229 11.2394 35.4283 11.3524 35.5379 11.462C36.7971 12.7212 38.5049 13.4286 40.2856 13.4286C42.0663 13.4286 43.7741 12.7212 45.0333 11.462Z" fill="white"/>
- </svg>
- <span>Поделиться</span>`
- },
- })
|