tiny-essentials 1.20.3 → 1.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/README.md +13 -11
  2. package/dist/_/numbers.cjs +136 -0
  3. package/dist/_/numbers.d.mts +24 -0
  4. package/dist/_/numbers.mjs +102 -0
  5. package/dist/v1/TinyAdvancedRaffle.min.js +1 -0
  6. package/dist/v1/TinyArrayPaginator.min.js +1 -0
  7. package/dist/v1/TinyBasicsEs.min.js +1 -1
  8. package/dist/v1/TinyCookieConsent.min.js +1 -0
  9. package/dist/v1/TinyDayNightCycle.min.js +1 -0
  10. package/dist/v1/TinyEssentials.min.js +1 -1
  11. package/dist/v1/TinyGamepad.min.js +1 -0
  12. package/dist/v1/TinyI18.min.js +1 -0
  13. package/dist/v1/TinyInventory.min.js +1 -0
  14. package/dist/v1/TinyInventoryTrader.min.js +1 -0
  15. package/dist/v1/TinyLocalStorage.min.js +1 -1
  16. package/dist/v1/TinyNeedBar.min.js +1 -0
  17. package/dist/v1/TinyRateLimiter.min.js +1 -1
  18. package/dist/v1/TinySmartScroller.min.js +1 -1
  19. package/dist/v1/TinyToastNotify.min.js +1 -1
  20. package/dist/v1/TinyUploadClicker.min.js +1 -1
  21. package/dist/v1/basics/array.cjs +21 -0
  22. package/dist/v1/basics/array.d.mts +8 -0
  23. package/dist/v1/basics/array.mjs +18 -0
  24. package/dist/v1/basics/clock.cjs +127 -11
  25. package/dist/v1/basics/clock.d.mts +26 -0
  26. package/dist/v1/basics/clock.mjs +96 -1
  27. package/dist/v1/basics/index.cjs +2 -8
  28. package/dist/v1/basics/index.d.mts +3 -8
  29. package/dist/v1/basics/index.mjs +2 -3
  30. package/dist/v1/basics/simpleMath.cjs +46 -0
  31. package/dist/v1/basics/simpleMath.d.mts +27 -0
  32. package/dist/v1/basics/simpleMath.mjs +42 -0
  33. package/dist/v1/build/TinyAdvancedRaffle.cjs +7 -0
  34. package/dist/v1/build/TinyAdvancedRaffle.d.mts +3 -0
  35. package/dist/v1/build/TinyAdvancedRaffle.mjs +2 -0
  36. package/dist/v1/build/TinyArrayPaginator.cjs +7 -0
  37. package/dist/v1/build/TinyArrayPaginator.d.mts +3 -0
  38. package/dist/v1/build/TinyArrayPaginator.mjs +2 -0
  39. package/dist/v1/build/TinyCookieConsent.cjs +7 -0
  40. package/dist/v1/build/TinyCookieConsent.d.mts +3 -0
  41. package/dist/v1/build/TinyCookieConsent.mjs +2 -0
  42. package/dist/v1/build/TinyDayNightCycle.cjs +7 -0
  43. package/dist/v1/build/TinyDayNightCycle.d.mts +3 -0
  44. package/dist/v1/build/TinyDayNightCycle.mjs +2 -0
  45. package/dist/v1/build/TinyGamepad.cjs +7 -0
  46. package/dist/v1/build/TinyGamepad.d.mts +3 -0
  47. package/dist/v1/build/TinyGamepad.mjs +2 -0
  48. package/dist/v1/build/TinyI18.cjs +7 -0
  49. package/dist/v1/build/TinyI18.d.mts +3 -0
  50. package/dist/v1/build/TinyI18.mjs +2 -0
  51. package/dist/v1/build/TinyInventory.cjs +7 -0
  52. package/dist/v1/build/TinyInventory.d.mts +3 -0
  53. package/dist/v1/build/TinyInventory.mjs +2 -0
  54. package/dist/v1/build/TinyInventoryTrader.cjs +7 -0
  55. package/dist/v1/build/TinyInventoryTrader.d.mts +3 -0
  56. package/dist/v1/build/TinyInventoryTrader.mjs +2 -0
  57. package/dist/v1/build/TinyNeedBar.cjs +7 -0
  58. package/dist/v1/build/TinyNeedBar.d.mts +3 -0
  59. package/dist/v1/build/TinyNeedBar.mjs +2 -0
  60. package/dist/v1/css/TinyCookieConsent.min.css +1 -0
  61. package/dist/v1/index.cjs +20 -8
  62. package/dist/v1/index.d.mts +12 -8
  63. package/dist/v1/index.mjs +11 -3
  64. package/dist/v1/libs/TinyAdvancedRaffle.cjs +1654 -0
  65. package/dist/v1/libs/TinyAdvancedRaffle.d.mts +851 -0
  66. package/dist/v1/libs/TinyAdvancedRaffle.mjs +1477 -0
  67. package/dist/v1/libs/TinyArrayPaginator.cjs +132 -0
  68. package/dist/v1/libs/TinyArrayPaginator.d.mts +78 -0
  69. package/dist/v1/libs/TinyArrayPaginator.mjs +119 -0
  70. package/dist/v1/libs/TinyCookieConsent.cjs +278 -0
  71. package/dist/v1/libs/TinyCookieConsent.d.mts +142 -0
  72. package/dist/v1/libs/TinyCookieConsent.mjs +248 -0
  73. package/dist/v1/libs/TinyDayNightCycle.cjs +1389 -0
  74. package/dist/v1/libs/TinyDayNightCycle.d.mts +673 -0
  75. package/dist/v1/libs/TinyDayNightCycle.mjs +1232 -0
  76. package/dist/v1/libs/TinyGamepad.cjs +2690 -0
  77. package/dist/v1/libs/TinyGamepad.d.mts +1286 -0
  78. package/dist/v1/libs/TinyGamepad.mjs +2386 -0
  79. package/dist/v1/libs/TinyHtml.d.mts +2 -2
  80. package/dist/v1/libs/TinyI18.cjs +946 -0
  81. package/dist/v1/libs/TinyI18.d.mts +418 -0
  82. package/dist/v1/libs/TinyI18.mjs +873 -0
  83. package/dist/v1/libs/TinyInventory.cjs +1788 -0
  84. package/dist/v1/libs/TinyInventory.d.mts +871 -0
  85. package/dist/v1/libs/TinyInventory.mjs +1650 -0
  86. package/dist/v1/libs/TinyInventoryTrader.cjs +242 -0
  87. package/dist/v1/libs/TinyInventoryTrader.d.mts +95 -0
  88. package/dist/v1/libs/TinyInventoryTrader.mjs +212 -0
  89. package/dist/v1/libs/TinyLocalStorage.cjs +14 -1
  90. package/dist/v1/libs/TinyLocalStorage.mjs +8 -1
  91. package/dist/v1/libs/TinyNeedBar.cjs +272 -0
  92. package/dist/v1/libs/TinyNeedBar.d.mts +223 -0
  93. package/dist/v1/libs/TinyNeedBar.mjs +241 -0
  94. package/dist/v1/libs/TinyRateLimiter.cjs +0 -13
  95. package/dist/v1/libs/TinyRateLimiter.d.mts +0 -8
  96. package/dist/v1/libs/TinyRateLimiter.mjs +0 -12
  97. package/dist/v1/libs/TinySmartScroller.cjs +0 -51
  98. package/dist/v1/libs/TinySmartScroller.d.mts +0 -36
  99. package/dist/v1/libs/TinySmartScroller.mjs +0 -46
  100. package/dist/v1/libs/TinyToastNotify.cjs +2 -2
  101. package/dist/v1/libs/TinyToastNotify.mjs +2 -2
  102. package/dist/v1/libs/TinyUploadClicker.cjs +1 -1
  103. package/docs/v1/Ai-Tips.md +51 -0
  104. package/docs/v1/Personal-Ai-Prompts(portuguese).md +134 -0
  105. package/docs/v1/Personal-Ai-Prompts.md +113 -0
  106. package/docs/v1/README.md +24 -0
  107. package/docs/v1/basics/array.md +17 -0
  108. package/docs/v1/basics/clock.md +51 -11
  109. package/docs/v1/basics/simpleMath.md +73 -0
  110. package/docs/v1/libs/TinyAdvancedRaffle.md +674 -0
  111. package/docs/v1/libs/TinyArrayPaginator.md +150 -0
  112. package/docs/v1/libs/TinyCookieConsent.md +152 -0
  113. package/docs/v1/libs/TinyDayNightCycle.md +711 -0
  114. package/docs/v1/libs/TinyGamepad.md +980 -0
  115. package/docs/v1/libs/TinyI18.md +515 -0
  116. package/docs/v1/libs/TinyInventory.md +777 -0
  117. package/docs/v1/libs/TinyInventoryTrader.md +114 -0
  118. package/docs/v1/libs/TinyNeedBar.md +226 -0
  119. package/package.json +7 -5
  120. package/dist/v1/basics/html_deprecated.cjs +0 -124
  121. package/dist/v1/basics/html_deprecated.d.mts +0 -40
  122. package/dist/v1/basics/html_deprecated.mjs +0 -97
  123. package/dist/v1/css/TinyDraggerExample.css +0 -21
  124. package/dist/v1/css/TinyNotify.css +0 -350
  125. package/dist/v1/css/aiMarker.css +0 -4
  126. package/docs/v1/basics/html_deprecated.md +0 -127
@@ -1,350 +0,0 @@
1
- :root {
2
- --notify-width: clamp(280px, 90vw, 400px);
3
- --notify-spacing: 1rem;
4
- --notify-z-index: 1000;
5
- --notify-transition: opacity 0.3s ease, transform 0.3s ease;
6
- --notify-padding: 1rem;
7
- --notify-border-radius: 0.75rem;
8
- --notify-font-size: 1rem;
9
- --notify-font-family: sans-serif;
10
- --notify-color-bg: #ffffff;
11
- --notify-color-text: #333333;
12
- --notify-color-shadow: rgba(0, 0, 0, 0.1);
13
- --notify-close-size: 1.25rem;
14
- --notify-close-color: #444;
15
- --notify-close-color-hover: #000;
16
- --notif-center-remove-transition: opacity 0.3s ease, transform 0.3s ease;
17
- --notif-center-bg-transition: background 0.2s ease;
18
- --notif-center-transform: transform 0.3s ease;
19
- --notif-center-width: clamp(300px, 90vw, 400px);
20
- --notif-center-height: 100vh;
21
- --notif-center-bg: rgba(255, 255, 255, 0.85);
22
- --notif-center-blur: 12px;
23
- --notif-center-shadow: rgba(0, 0, 0, 0.2);
24
- --notif-center-x-padding: 1rem;
25
- --notif-center-y-padding: 1rem;
26
- --notif-center-z-index: 1050;
27
- --notif-border: #000;
28
- --notif-unread-border: #bd0b0b;
29
- --notif-border-unread: ;
30
- --notif-item-close: #666;
31
- --notif-item-close-hover: #000;
32
- --notif-item-bg: #ffffff;
33
- --notif-item-unread-bg: #ffffff;
34
- --notif-item-text: #222;
35
- --notif-item-radius: 0.75rem;
36
- --notif-item-padding: 1rem;
37
- --notif-item-shadow: rgba(0, 0, 0, 0.1);
38
- --notif-close-size: 1.5rem;
39
- --notif-close-color: #444;
40
- --notif-close-color-hover: #000;
41
- --notif-bell-size: 3rem;
42
- --notif-bell-bg: #ffffff;
43
- --notif-bell-color: #333;
44
- --notif-bell-shadow: rgba(0, 0, 0, 0.2);
45
- --notif-bell-z-index: 1040;
46
- --notif-bell-radius: 50%;
47
- --notif-bell-hover-bg: #f0f0f0;
48
- --notif-badge-bg: #d32f2f;
49
- --notif-badge-color: #ffffff;
50
- --notif-badge-size: 1.25rem;
51
- --notif-badge-font-size: 0.75rem;
52
- --notif-badge-border: none;
53
- }
54
-
55
- /* Notification container */
56
- .notify-container {
57
- position: fixed;
58
- display: flex;
59
- gap: var(--notify-spacing);
60
- width: var(--notify-width);
61
- z-index: var(--notify-z-index);
62
- pointer-events: none;
63
- }
64
- .notify-container.left {
65
- left: var(--notify-spacing);
66
- align-items: flex-start;
67
- }
68
- .notify-container.right {
69
- right: var(--notify-spacing);
70
- align-items: flex-end;
71
- }
72
- .notify-container.center {
73
- left: 50%;
74
- transform: translateX(-50%);
75
- align-items: center;
76
- }
77
- .notify-container.top {
78
- flex-direction: column;
79
- top: var(--notify-spacing);
80
- }
81
- .notify-container.top .notify.enter {
82
- transform: translateY(-10px);
83
- }
84
- .notify-container.top .notify.exit {
85
- transform: translateY(-10px);
86
- }
87
- .notify-container.bottom {
88
- flex-direction: column-reverse;
89
- bottom: var(--notify-spacing);
90
- }
91
- .notify-container.bottom .notify.enter {
92
- transform: translateY(10px);
93
- }
94
- .notify-container.bottom .notify.exit {
95
- transform: translateY(10px);
96
- }
97
- .notify-container .notify {
98
- position: relative;
99
- background-color: var(--notify-color-bg);
100
- color: var(--notify-color-text);
101
- box-shadow: 0 4px 8px var(--notify-color-shadow);
102
- border-radius: var(--notify-border-radius);
103
- padding: var(--notify-padding);
104
- font-size: var(--notify-font-size);
105
- font-family: var(--notify-font-family);
106
- width: 100%;
107
- pointer-events: auto;
108
- transition: var(--notify-transition);
109
- opacity: 1;
110
- }
111
- .notify-container .notify .avatar {
112
- width: 2rem;
113
- height: 2rem;
114
- border-radius: 50%;
115
- object-fit: cover;
116
- float: left;
117
- margin-right: 0.5rem;
118
- }
119
- .notify-container .notify .close {
120
- position: absolute;
121
- top: 0.5rem;
122
- right: 0.75rem;
123
- background: transparent;
124
- border: none;
125
- font-size: var(--notify-close-size);
126
- cursor: pointer;
127
- line-height: 1;
128
- color: var(--notify-close-color);
129
- padding: 0;
130
- margin: 0;
131
- }
132
- .notify-container .notify .close:hover {
133
- color: var(--notify-close-color-hover);
134
- }
135
- .notify-container .notify.clickable {
136
- cursor: pointer;
137
- }
138
- .notify-container .notify.clickable:hover {
139
- background-color: var(--notify-color-bg-hover, rgba(0, 0, 0, 0.05));
140
- }
141
- .notify-container .notify.enter {
142
- opacity: 0;
143
- }
144
- .notify-container .notify.show {
145
- opacity: 1;
146
- transform: translateY(0);
147
- }
148
- .notify-container .notify.exit {
149
- opacity: 0;
150
- }
151
-
152
- /* Notification center */
153
- .notify-overlay {
154
- position: fixed;
155
- inset: 0;
156
- background-color: rgba(0, 0, 0, 0.35);
157
- display: flex;
158
- justify-content: flex-end;
159
- align-items: flex-start;
160
- padding: 1rem;
161
- z-index: var(--notif-center-z-index);
162
- transition: var(--notif-center-bg-transition);
163
- }
164
- .notify-overlay.hidden {
165
- background-color: transparent;
166
- pointer-events: none;
167
- }
168
- .notify-overlay .notify-center {
169
- position: fixed;
170
- top: 0;
171
- right: 0;
172
- width: var(--notif-center-width);
173
- height: var(--notif-center-height);
174
- background-color: var(--notif-center-bg);
175
- backdrop-filter: blur(var(--notif-center-blur));
176
- box-shadow: -4px 0 12px var(--notif-center-shadow);
177
- padding-top: var(--notif-center-y-padding);
178
- padding-bottom: var(--notif-center-y-padding);
179
- padding-left: var(--notif-center-x-padding);
180
- padding-right: var(--notif-center-x-padding);
181
- display: flex;
182
- flex-direction: column;
183
- z-index: var(--notif-center-z-index);
184
- transform: translateX(100%);
185
- transition: var(--notif-center-transform);
186
- }
187
- .notify-overlay .notify-center.open {
188
- transform: translateX(0%);
189
- }
190
- .notify-overlay .notify-center .header {
191
- display: flex;
192
- justify-content: space-between;
193
- align-items: center;
194
- }
195
- .notify-overlay .notify-center .options {
196
- display: flex;
197
- }
198
- .notify-overlay .notify-center .options > button {
199
- background: none;
200
- border: none;
201
- font-size: var(--notif-close-size);
202
- color: var(--notif-close-color);
203
- cursor: pointer;
204
- }
205
- .notify-overlay .notify-center .options > button > svg {
206
- align-items: center;
207
- display: flex;
208
- }
209
- .notify-overlay .notify-center .options > button:hover {
210
- color: var(--notif-close-color-hover);
211
- }
212
- .notify-overlay .notify-center .list {
213
- flex: 1;
214
- overflow-y: auto;
215
- display: flex;
216
- flex-direction: column;
217
- gap: 1rem;
218
- scrollbar-width: thin;
219
- scrollbar-color: #999 transparent;
220
- }
221
- .notify-overlay .notify-center .list::-webkit-scrollbar {
222
- width: 6px;
223
- }
224
- .notify-overlay .notify-center .list::-webkit-scrollbar-thumb {
225
- background: #aaa;
226
- border-radius: 3px;
227
- }
228
- .notify-overlay .notify-center .item {
229
- display: flex;
230
- justify-content: space-between;
231
- align-items: flex-start;
232
- background-color: var(--notif-item-bg);
233
- color: var(--notif-item-text);
234
- border-radius: var(--notif-item-radius);
235
- padding: var(--notif-item-padding);
236
- box-shadow: 0 2px 6px var(--notif-item-shadow);
237
- font-size: 0.95rem;
238
- transition: var(--notif-center-remove-transition);
239
- border-left-style: solid;
240
- border-left-color: var(--notif-border);
241
- }
242
- .notify-overlay .notify-center .item .avatar {
243
- width: 40px;
244
- height: 40px;
245
- flex-shrink: 0;
246
- border-radius: 50%;
247
- background-size: cover;
248
- background-position: center;
249
- margin-right: 10px;
250
- }
251
- .notify-overlay .notify-center .item.unread {
252
- background-color: var(--notif-item-unread-bg);
253
- border-left-color: var(--notif-unread-border);
254
- }
255
- .notify-overlay .notify-center .item.removing {
256
- opacity: 0;
257
- transform: translateY(-10px);
258
- pointer-events: none !important;
259
- }
260
- .notify-overlay .notify-center .item.clickable {
261
- cursor: pointer;
262
- }
263
- .notify-overlay .notify-center .item.clickable:hover {
264
- background-color: var(--notif-hover, rgba(0, 0, 0, 0.05));
265
- }
266
- .notify-overlay .notify-center .item .content {
267
- flex-grow: 1;
268
- display: flex;
269
- flex-direction: column;
270
- }
271
- .notify-overlay .notify-center .item .title {
272
- font-weight: bold;
273
- margin-bottom: 0.25rem;
274
- }
275
- .notify-overlay .notify-center .item .message {
276
- font-size: 0.95rem;
277
- }
278
- .notify-overlay .notify-center .item .notify-close {
279
- background: none;
280
- border: none;
281
- font-size: 1.25rem;
282
- line-height: 1;
283
- color: var(--notif-item-close);
284
- cursor: pointer;
285
- padding: 0.25rem;
286
- }
287
- .notify-overlay .notify-center .item .notify-close:hover {
288
- color: var(--notif-item-close-hover);
289
- }
290
-
291
- @media (max-width: 600px) {
292
- .notify-center {
293
- border-radius: 0;
294
- width: 100vw;
295
- padding: 0px !important;
296
- }
297
- .notify-center .header {
298
- padding-top: var(--notif-center-y-padding);
299
- }
300
- .notify-center .header,
301
- .notify-center .list {
302
- padding-left: var(--notif-center-x-padding);
303
- padding-right: var(--notif-center-x-padding);
304
- }
305
- }
306
- /* Notification bell */
307
- .notify-bell {
308
- position: fixed;
309
- bottom: 1.5rem;
310
- right: 1.5rem;
311
- width: var(--notif-bell-size);
312
- height: var(--notif-bell-size);
313
- background-color: var(--notif-bell-bg);
314
- color: var(--notif-bell-color);
315
- border: none;
316
- border-radius: var(--notif-bell-radius);
317
- box-shadow: 0 4px 8px var(--notif-bell-shadow);
318
- display: flex;
319
- align-items: center;
320
- justify-content: center;
321
- cursor: pointer;
322
- z-index: var(--notif-bell-z-index);
323
- font-size: 1.4rem;
324
- transition: var(--notif-center-bg-transition);
325
- }
326
- .notify-bell:hover {
327
- background-color: var(--notif-bell-hover-bg);
328
- }
329
- .notify-bell .badge {
330
- position: absolute;
331
- top: 0;
332
- right: 0;
333
- transform: translate(25%, -25%);
334
- background-color: var(--notif-badge-bg);
335
- color: var(--notif-badge-color);
336
- border: var(--notif-badge-border);
337
- border-radius: 999px;
338
- min-width: var(--notif-badge-size);
339
- height: var(--notif-badge-size);
340
- font-size: var(--notif-badge-font-size);
341
- font-weight: bold;
342
- display: flex;
343
- align-items: center;
344
- justify-content: center;
345
- padding: 0 0.3em;
346
- pointer-events: none;
347
- }
348
- .notify-bell .badge[data-value="0"] {
349
- display: none;
350
- }
@@ -1,4 +0,0 @@
1
- body.detect-made-by-ai .made-by-ai {
2
- color: yellow;
3
- text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
4
- }
@@ -1,127 +0,0 @@
1
- ### 🚀 `areHtmlElsColliding()`
2
-
3
- Check if two DOM elements are **colliding on the screen**! Perfect for games, draggable elements, UI interactions, and more.
4
-
5
- This function checks whether **two HTML elements are overlapping** (colliding) within the viewport. It uses their bounding boxes (`getBoundingClientRect()`) to perform a simple AABB (Axis-Aligned Bounding Box) collision detection.
6
-
7
- Combine it with `mousemove`, `drag`, or animation listeners for dynamic collision detection in real-time!
8
-
9
- It compares the bounding rectangles of both elements:
10
-
11
- * ✅ Checks if **rect1** is NOT entirely to the left, right, above, or below **rect2**.
12
- * ✅ If none of these are true, then the elements are overlapping.
13
-
14
- #### 🧠 Syntax
15
-
16
- ```javascript
17
- areHtmlElsColliding(elem1, elem2);
18
- ```
19
-
20
- #### 🎯 Parameters
21
-
22
- | Parameter | Type | Description |
23
- | --------- | --------- | ----------------------- |
24
- | `elem1` | `Element` | The first DOM element. |
25
- | `elem2` | `Element` | The second DOM element. |
26
-
27
- #### 🔁 Return
28
-
29
- | Type | Description |
30
- | --------- | ------------------------------------------------------------------ |
31
- | `boolean` | ✅ `true` if elements are colliding. <br>❌ `false` if they are not. |
32
-
33
- #### 📦 Example
34
-
35
- ```javascript
36
- const box1 = document.getElementById('box1');
37
- const box2 = document.getElementById('box2');
38
-
39
- if (areHtmlElsColliding(box1, box2)) {
40
- console.log('🎯 Collision detected!');
41
- } else {
42
- console.log('❌ No collision.');
43
- }
44
- ```
45
-
46
- #### 🚧 Limitations
47
-
48
- * Only works with **axis-aligned elements** (rectangular shapes).
49
- * Does not handle rotated elements or complex shapes.
50
-
51
- ---
52
-
53
- ### 🔲 `getHtmlElBordersWidth(el)`
54
-
55
- 📏 Returns the total **border width** of an element using `border{Side}Width` values from computed styles.
56
-
57
- ```js
58
- getHtmlElBordersWidth(el: Element): HtmlElBoxSides
59
- ```
60
-
61
- * `el`: The target DOM element.
62
- * **Returns**: An object containing total horizontal/vertical border widths, and each side individually.
63
-
64
- ---
65
-
66
- ### 🔳 `getHtmlElBorders(el)`
67
-
68
- 📐 Returns the total **border size** of an element using `border{Side}` shorthand values from computed styles.
69
-
70
- ```js
71
- getHtmlElBorders(el: Element): HtmlElBoxSides
72
- ```
73
-
74
- * `el`: The target DOM element.
75
- * **Returns**: An object with total horizontal/vertical border sizes and all four sides.
76
-
77
- ---
78
-
79
- ### ➖ `getHtmlElMargin(el)`
80
-
81
- 📏 Returns the total **margin** of an element using `margin{Side}` from computed styles.
82
-
83
- ```js
84
- getHtmlElMargin(el: Element): HtmlElBoxSides
85
- ```
86
-
87
- * `el`: The target DOM element.
88
- * **Returns**: An object containing margin values for each side and totals for horizontal (`x`) and vertical (`y`).
89
-
90
- ---
91
-
92
- ### ➕ `getHtmlElPadding(el)`
93
-
94
- 🧩 Returns the total **padding** of an element using `padding{Side}` from computed styles.
95
-
96
- ```js
97
- getHtmlElPadding(el: Element): HtmlElBoxSides
98
- ```
99
-
100
- * `el`: The target DOM element.
101
- * **Returns**: Padding values for all sides and summed horizontal (`x`) and vertical (`y`) values.
102
-
103
- ---
104
-
105
- ### 👁️ `isInViewport(element)`
106
-
107
- 🔍 Checks if an element is **partially visible** in the current viewport.
108
-
109
- ```js
110
- isInViewport(element: HTMLElement): boolean
111
- ```
112
-
113
- * `element`: The DOM element to check.
114
- * **Returns**: `true` if the element is at least partially visible; `false` otherwise.
115
-
116
- ---
117
-
118
- ### ✅ `isScrolledIntoView(element)`
119
-
120
- 📦 Checks if an element is **fully visible** (top and bottom) within the viewport.
121
-
122
- ```js
123
- isScrolledIntoView(element: HTMLElement): boolean
124
- ```
125
-
126
- * `element`: The DOM element to check.
127
- * **Returns**: `true` if the entire element is within the viewport; `false` otherwise.