Powerful DOM management & manipulation library pack
- β‘οΈ Ultra-fast DOM manipulation
- π§© Modular architecture
- ποΈ Agate.UX: advanced UX/interaction sub-component
- π§° Generic API for flexible usage
- π¨ Virtual UI/UX scaling & orientation
- π±οΈ Pointer events with virtual coordinates
- π οΈ Custom CSS properties for advanced layouts
npm install dom.ts
# or
yarn add dom.ts
API documentation coming soon!
- Comprehensive API Reference
- Usage Examples
- TypeScript Support
Agate.UX is a next-gen sub-component for advanced UI/UX, designed for the "2REmembrance" generation (2025+).
- Orientation-based transforms:
calc(var(--orient, 0) * <A>)
where<A>
can be100grad
,0.25turn
,90deg
, etc. - Self-centering elements:
translate(-50%, -50%)
withtransform-origin: 0px 0px;
- Drag & center combined:
translate(calc(var(--drag-x, 0px) - 50%), calc(var(--drag-y, 0px) - 50%))
How it works?
- Client-Space: page coordinate system
- Oriented-Space: virtual screen
- Algorithm-Space: internal logic
- 90deg-based (0Β°, 90Β°, 180Β°, 270Β°)
- Variable/Matrix-based
- Client-Space Pointer Position
- Oriented-Space Pointer Position
- Algorithm-Space Pointer Position
- Virtual UI/UX scaling
- Virtual screen orientation
- Pointer events adapted to virtual coordinates
- New and improved CSS rules
- API for fixed/independent oriented UI
Special versions of getBoundingClientRect
, clientX
, and clientY
with virtual scaling support.
Scaling methods:
- CSS
zoom
(recommended) - CSS
scale
(legacy) rem
/em
units
Custom ag-pointer*
event wrappers with enhancements for virtualized UIs.
Oriented-Space | Client-Space | Implementation-Dependent |
---|---|---|
--os-inset-x |
--cs-inset-x |
--im-inset-x |
--os-inset-y |
--cs-inset-y |
--im-inset-y |
--os-drag-x |
--cs-drag-x |
--im-drag-x |
--os-drag-y |
--cs-drag-y |
--im-drag-y |
--os-size-x |
--cs-size-x |
--im-size-x |
--os-size-y |
--cs-size-y |
--im-size-y |
--os-self-size-x |
--cs-self-size-x |
--im-self-size-x |
--os-self-size-y |
--cs-self-size-y |
--im-self-size-y |
--os-offset-x |
--cs-offset-x |
--im-offset-x |
--os-offset-y |
--cs-offset-y |
--im-offset-y |
- Transforms:
self-size-x
/self-size-y
=100%
(client-space) - Insets/Sizing:
self-size-x
/self-size-y
= offset parent size - Transforms: default to client-space unless transformed
- Inline/Block: sizes/insets may swap in different writing modes
- By layout:
- Fixed/absolute (insets)
- CSS Houdini (layout worklets)
- By orientation:
inline
/block
withwriting-mode
/direction
transform
-based (rotate
)- Mixed/combined approaches
- Use
inset
for semi-static,translate
for dynamic (drag/animation) positioning.
Pull requests, issues, and suggestions are welcome! See CONTRIBUTING.md for guidelines.