(name, title)
| 526 | |
| 527 | // Topbar icon (theme-aware) used for image tools + video actions |
| 528 | function makeTopIcon(name, title) { |
| 529 | const b = document.createElement('button'); |
| 530 | b.className = 'material-icons'; |
| 531 | b.textContent = name; |
| 532 | b.title = title; |
| 533 | |
| 534 | const dark = document.documentElement.classList.contains('dark-mode'); |
| 535 | |
| 536 | Object.assign(b.style, { |
| 537 | width: '32px', |
| 538 | height: '32px', |
| 539 | borderRadius: '8px', |
| 540 | display: 'flex', |
| 541 | alignItems: 'center', |
| 542 | justifyContent: 'center', |
| 543 | border: dark ? '1px solid rgba(255,255,255,.25)' : '1px solid rgba(0,0,0,.15)', |
| 544 | background: dark ? 'rgba(255,255,255,.14)' : 'rgba(0,0,0,.08)', |
| 545 | cursor: 'pointer', |
| 546 | fontSize: '20px', |
| 547 | lineHeight: '1', |
| 548 | color: dark ? '#f5f5f5' : '#111', |
| 549 | boxShadow: dark ? '0 1px 2px rgba(0,0,0,.6)' : '0 1px 1px rgba(0,0,0,.08)' |
| 550 | }); |
| 551 | |
| 552 | b.addEventListener('mouseenter', () => { |
| 553 | const darkNow = document.documentElement.classList.contains('dark-mode'); |
| 554 | b.style.background = darkNow ? 'rgba(255,255,255,.22)' : 'rgba(0,0,0,.14)'; |
| 555 | }); |
| 556 | b.addEventListener('mouseleave', () => { |
| 557 | const darkNow = document.documentElement.classList.contains('dark-mode'); |
| 558 | b.style.background = darkNow ? 'rgba(255,255,255,.14)' : 'rgba(0,0,0,.08)'; |
| 559 | }); |
| 560 | |
| 561 | return b; |
| 562 | } |
| 563 | |
| 564 | function setNavVisibility(overlay, showPrev, showNext) { |
| 565 | const prev = overlay.querySelector('.nav-left'); |
no outgoing calls
no test coverage detected