Appearance
Loading Screen
LIQA is designed to have a full user journey encapsulated in a single web component. The loading screen is the first step in the user journey. The loading screen is displayed for the end-user during 2 consequent processes:
- LIQA resources are being loaded
- LIQA AI is being initialized
Use the guide below to understand and customize this part of the user flow. If the default integration is left unchanged, the default option will be used. See all available options below.
Display Loading Screen default
Simply insert the <hautai-liqa>
tag into the markup of your application.
How it works
Once the <hautai-liqa>
tag is inserted into the markup of your application, LIQA starts the user session immediately. At this moment:
- The user immediately receives a request for the camera access.
- The user immediately sees the LIQA loading screen.
Additional guidance
The time that the loading screen is displayed depends on the user's device computational power and the network speed. If you find the time that the loading screen is displayed as too long, please, consider the following options:
- Check that the exact device meets the system requirements.
- Consider the option for preloading LIQA resources in advance.
- Consider the option for skipping the loading screen and displaying some educational/engaging content until LIQA is ready to operate.
Skip Loading Screen
- Insert the
<hautai-liqa>
tag into the markup of your application and pass thehidden
attribute to the<hautai-liqa>
tag:
tsx
tsx<
hautai-liqa license ="LICENSE_KEY_PROVIDED_BY_HAUT.AI"hidden > </hautai-liqa >
tsx<
hautai-liqa license ="LICENSE_KEY_PROVIDED_BY_HAUT.AI"hidden > </hautai-liqa >
tsx
tsxexport function
App () { const [isLiqaHidden ,setIsLiqaHidden ] =React .useState (true) return <hautai-liqa license ="LICENSE_KEY_PROVIDED_BY_HAUT.AI"hidden ={isLiqaHidden } ></hautai-liqa > }
tsxexport function
App () { const [isLiqaHidden ,setIsLiqaHidden ] =React .useState (true) return <hautai-liqa license ="LICENSE_KEY_PROVIDED_BY_HAUT.AI"hidden ={isLiqaHidden } ></hautai-liqa > }
vue
<hautai-liqa
license="LICENSE_KEY_PROVIDED_BY_HAUT.AI"
:hidden="isLiqaHidden"
></hautai-liqa>
<hautai-liqa
license="LICENSE_KEY_PROVIDED_BY_HAUT.AI"
:hidden="isLiqaHidden"
></hautai-liqa>
html
<hautai-liqa
license="LICENSE_KEY_PROVIDED_BY_HAUT.AI"
[hidden]="isLiqaHidden"
></hautai-liqa>
<hautai-liqa
license="LICENSE_KEY_PROVIDED_BY_HAUT.AI"
[hidden]="isLiqaHidden"
></hautai-liqa>
svelte
<hautai-liqa
license="LICENSE_KEY_PROVIDED_BY_HAUT.AI"
hidden={isLiqaHidden}
></hautai-liqa>
<hautai-liqa
license="LICENSE_KEY_PROVIDED_BY_HAUT.AI"
hidden={isLiqaHidden}
></hautai-liqa>
- Subscribe to the
"ready"
event to receive a notification when LIQA loading and initialization processes are finished in the background and LIQA is ready to start the user interaction session:
js
jsconst
liqa =document .querySelector ("hautai-liqa")liqa .addEventListener ("ready",handleLiqaReady )
jsconst
liqa =document .querySelector ("hautai-liqa")liqa .addEventListener ("ready",handleLiqaReady )
tsx
tsxexport function
App () { constref =React .useRef () const [isLiqaReady ,setIsLiqaReady ] =React .useState (false)React .useEffect (() => {ref .current .addEventListener ("ready",handleLiqaReady ) return () =>ref .current .removeEventListener ("ready",handleLiqaReady ) }) return ( <hautai-liqa ref ={ref }license ="LICENSE_KEY_PROVIDED_BY_HAUT.AI"hidden ={!isLiqaReady } ></hautai-liqa > ) }
tsxexport function
App () { constref =React .useRef () const [isLiqaReady ,setIsLiqaReady ] =React .useState (false)React .useEffect (() => {ref .current .addEventListener ("ready",handleLiqaReady ) return () =>ref .current .removeEventListener ("ready",handleLiqaReady ) }) return ( <hautai-liqa ref ={ref }license ="LICENSE_KEY_PROVIDED_BY_HAUT.AI"hidden ={!isLiqaReady } ></hautai-liqa > ) }
vue
<hautai-liqa
license="LICENSE_KEY_PROVIDED_BY_HAUT.AI"
@ready="handleLiqaReady"
:hidden="!isLiqaReady"
></hautai-liqa>
<hautai-liqa
license="LICENSE_KEY_PROVIDED_BY_HAUT.AI"
@ready="handleLiqaReady"
:hidden="!isLiqaReady"
></hautai-liqa>
html
<hautai-liqa
license="LICENSE_KEY_PROVIDED_BY_HAUT.AI"
(ready)="handleLiqaReady()"
[hidden]="!isLiqaReady"
></hautai-liqa>
<hautai-liqa
license="LICENSE_KEY_PROVIDED_BY_HAUT.AI"
(ready)="handleLiqaReady()"
[hidden]="!isLiqaReady"
></hautai-liqa>
svelte
<hautai-liqa
license="LICENSE_KEY_PROVIDED_BY_HAUT.AI"
on:ready="{handleLiqaReady}"
hidden={!isLiqaReady}
></hautai-liqa>
<hautai-liqa
license="LICENSE_KEY_PROVIDED_BY_HAUT.AI"
on:ready="{handleLiqaReady}"
hidden={!isLiqaReady}
></hautai-liqa>
- Remove the
hidden
attribute from the<hautai-liqa>
tag once LIQA is indicated that it is ready to start the session.
How it works
As for other components, the "hidden" attribute in the LIQA tag indicates that the browser should not render the contents of the element. However, it does not affect the loading of LIQA resources and the initialization of LIQA AI.
- Being
hidden
, LIQA continues to load the resources and initialize the AI in the background. - Being
hidden
, LIQA does not display the loading screen to the user. - Being
hidden
, LIQA does not request camera access from the user and waits for thehidden
attribute to be removed. - Once the
hidden
attribute is removed, LIQA starts the user session immediately as in the default integration.
Important information about LIQA visibility in viewport
The "hidden" behavior also applies when the
<hautai-liqa>
tag is not visible in the viewport, for example, LIQA is located far down on a long-long web page.If
<hautai-liqa>
is presented in the viewport and nohidden
attribute is set on it, LIQA is considered visible even if it is overlayed or fully covered by other objects. In this case, the user session immediately as in the default integration.