UNPKG

@huluvu424242/honey-slideshow

Version:

Text to Speech component wich is reading texts from DOM elements.

24 lines (21 loc) 710 B
import { readTask, writeTask } from '@stencil/core/internal/client'; const startStatusTap = () => { const win = window; win.addEventListener('statusTap', () => { readTask(() => { const width = win.innerWidth; const height = win.innerHeight; const el = document.elementFromPoint(width / 2, height / 2); if (!el) { return; } const contentEl = el.closest('ion-content'); if (contentEl) { contentEl.componentOnReady().then(() => { writeTask(() => contentEl.scrollToTop(300)); }); } }); }); }; export { startStatusTap };