()
| 7 | const PLATFORM_WINDOWS_CLASS = 'platform-windows'; |
| 8 | |
| 9 | export function init(): void { |
| 10 | document.documentElement.classList.add(PLATFORM_LINUX_CLASS); |
| 11 | const button = document.createElement('button'); |
| 12 | button.className = 'component-docs-ui'; |
| 13 | |
| 14 | const loop = [ |
| 15 | PLATFORM_LINUX_CLASS, |
| 16 | PLATFORM_MAC_CLASS, |
| 17 | PLATFORM_WINDOWS_CLASS, |
| 18 | ]; |
| 19 | |
| 20 | function toggleFonts(): void { |
| 21 | for (const className of loop) { |
| 22 | document.documentElement.classList.toggle(className, className === loop[0]); |
| 23 | } |
| 24 | loop.push(loop.shift() as string); |
| 25 | button.innerText = 'Turn on ' + loop[0] + ' fonts'; |
| 26 | } |
| 27 | |
| 28 | window.addEventListener('load', () => { |
| 29 | toggleFonts(); |
| 30 | |
| 31 | button.style.position = 'fixed'; |
| 32 | button.style.bottom = '10px'; |
| 33 | button.style.right = '250px'; |
| 34 | button.style.width = '250px'; |
| 35 | button.style.fontSize = '16px'; |
| 36 | button.style.padding = '5px'; |
| 37 | button.style.cursor = 'pointer'; |
| 38 | |
| 39 | button.addEventListener('click', event => { |
| 40 | event.preventDefault(); |
| 41 | toggleFonts(); |
| 42 | }); |
| 43 | |
| 44 | document.body.appendChild(button); |
| 45 | }); |
| 46 | } |
nothing calls this directly
no test coverage detected