Layout
@auvious/layout / Exports / Layout
Class: Layout
Dynamic optimal animated grid layout based on ratios
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new Layout(options?
)
Parameters
Name | Type |
---|---|
options | Partial <ILayoutOptions > |
Properties
busy
• busy: boolean
= false
floating
• floating: Float
focuser
• focuser: Focus
options
• options: ILayoutOptions
pendingRemoval
• pendingRemoval: Map
<HTMLElement
, IBox
>
queue
• queue: any
[] = []
tiles
• tiles: Tiles
Methods
enqueue
▸ enqueue(job
): Promise
<void
>
Parameters
Name | Type |
---|---|
job | any |
Returns
Promise
<void
>
float
▸ float(div
, options?
): void
set or reset a floating element
Parameters
Name | Type |
---|---|
div | HTMLElement |
options | Partial <{ bottom : number ; height : number ; left : number ; ratio : number ; right : number ; top : number }> |
Returns
void
focus
▸ focus(div
, ratio
): void
make a box larger than the rest
Parameters
Name | Type |
---|---|
div | HTMLElement |
ratio | number |
Returns
void
getRemovalPending
▸ getRemovalPending(elm
): IBox
Parameters
Name | Type |
---|---|
elm | HTMLElement |
Returns
IBox
render
▸ render(animate?
): Promise
<void
>
Parameters
Name | Type | Default value |
---|---|---|
animate | boolean | false |
Returns
Promise
<void
>
tile
▸ tile(div
, ratio
): void
position a new element in the tiles layout or update the ratio of one already in
Parameters
Name | Type | Description |
---|---|---|
div | HTMLElement | the box to control |
ratio | number | the ratio width/height to wish for |
Returns
void
unfloat
▸ unfloat(): void
unset floating element
Returns
void
unfocus
▸ unfocus(): void
remove focus from a box
Returns
void
untile
▸ untile(div
): void
remove element from layout but not from dom
Parameters
Name | Type |
---|---|
div | HTMLElement |
Returns
void
update
▸ update(options
): void
mainly resize parent container, but also update top, left offset and margin
Parameters
Name | Type | Description |
---|---|---|
options | Partial <ILayoutOptions > | update stuff, top and left are for offsetting |
Returns
void