Skip to main content

@auvious/layout / Layout

Class: Layout

Dynamic optimal animated grid layout based on ratios

Table of contents​

Constructors​

Properties​

Methods​

Constructors​

constructor​

• new Layout(options?): Layout

Parameters​

NameType
optionsPartial<ILayoutOptions>

Returns​

Layout

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​

NameType
jobany

Returns​

Promise<void>


float​

▸ float(div, options?): void

set or reset a floating element

Parameters​

NameType
divHTMLElement
optionsPartial<{ 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​

NameType
divHTMLElement
rationumber

Returns​

void


getRemovalPending​

▸ getRemovalPending(elm): IBox

Parameters​

NameType
elmHTMLElement

Returns​

IBox


render​

▸ render(animate?): Promise<void>

Parameters​

NameTypeDefault value
animatebooleanfalse

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​

NameTypeDescription
divHTMLElementthe box to control
rationumberthe 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​

NameType
divHTMLElement

Returns​

void


update​

▸ update(options): void

mainly resize parent container, but also update top, left offset and margin

Parameters​

NameTypeDescription
optionsPartial<ILayoutOptions>update stuff, top and left are for offsetting

Returns​

void