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
Markdown
### ๐ 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