Skip to content

@get-advantage/advantage / advantage/ui-layer / AdvantageUILayer

Class: AdvantageUILayer

advantage/ui-layer.AdvantageUILayer

Represents the UI layer for an Advantage high-impact format. This class extends the HTMLElement class and provides methods for manipulating the UI content and styles.

Hierarchy

  • HTMLElement

    AdvantageUILayer

Constructors

constructor

new AdvantageUILayer(): AdvantageUILayer

Creates an instance of AdvantageUILayer. Attaches a shadow root to the element and initializes the necessary elements.

Returns

AdvantageUILayer

Overrides

HTMLElement.constructor

Defined in

src/advantage/ui-layer.ts:17

Properties

#container

Private #container: HTMLDivElement

Defined in

src/advantage/ui-layer.ts:10


#content

Private #content: HTMLDivElement

Defined in

src/advantage/ui-layer.ts:11


#root

Private #root: ShadowRoot

Defined in

src/advantage/ui-layer.ts:8


#styleSheet

Private #styleSheet: CSSStyleSheet | HTMLStyleElement

Defined in

src/advantage/ui-layer.ts:9


slotName

slotName: string = "advantage-ui-content"

Defined in

src/advantage/ui-layer.ts:12

Methods

changeContent

changeContent(content): void

Changes the content of the UI layer.

Parameters

NameTypeDescription
contentstring | HTMLElementThe new content to be displayed. It can be either a string or an HTMLElement.

Returns

void

Defined in

src/advantage/ui-layer.ts:44


insertCSS

insertCSS(CSS): void

Inserts CSS styles into the UI layer.

Parameters

NameTypeDescription
CSSstringThe CSS styles to be inserted.

Returns

void

Defined in

src/advantage/ui-layer.ts:57