UNPKG

tiny-essentials

Version:

Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.

43 lines (30 loc) โ€ข 1.27 kB
### ๐Ÿ” What's New? #### ๐Ÿ“ฆ `TinyAfterScrollWatcher` This new utility makes it easier to respond when scrolling stops โ€” perfect for optimizing animations, loading events, or interface feedback. * ๐Ÿง  Detects when scrolling *ends* on an element or the window. * โฑ๏ธ Configurable inactivity timeout (default: 100ms). * ๐Ÿ“š Queue-based callback system for multiple triggers. ```js const watcher = new TinyAfterScrollWatcher(window); watcher.onScroll(() => { watcher.doAfterScroll(() => { console.log('[customBox] Scroll stopped!'); }); }) ``` Use cases: * Lazy-loading content * UI transitions after scroll * Analytics or tracking user movement --- ### ๐ŸŽจ New Inline Style Getter `style()` now uses the elementโ€™s actual `style` attribute instead of `getComputedStyle`, allowing much more precise control over inline styles. #### Example: ```js TinyHtml.setStyle(element, 'backgroundColor', 'skyblue'); TinyHtml.getStyle(element, 'backgroundColor'); // "skyblue" ``` * ๐Ÿงฉ Supports `camelCase` and `kebab-case`. * ๐Ÿ”„ Unified with alias converter system (`cssPropAliases`). * ๐Ÿงผ Returns only **inline-defined** values (not computed ones). **Full Changelog**: https://github.com/JasminDreasond/Tiny-Essentials/compare/1.16.0...1.16.1