Extensions add specific functionality to Items API. They rely on modules within LT being available.
--
Adds a semi-transparent overlay on top of the entire page. This is for users who have sensitivity to bright light, high contrast, or blue light.
Methods
hide() → {void}
Hides the blue light filter if it is currently visible. If the filter is already hidden, it does nothing.
- Since
- 3.0.0
- Returns:
- void
run(customColoropt, customZIndexopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
customColor | string | <optional> | A custom color value to use for the overlay. Recommend rgba. Defaults to rgba(250, 170, 140, 0.5) |
customZIndex | number | <optional> | A custom z-index value to use for the overlay. Defaults to 99999. |
- Since
- 0.9.0
Example
import { LT } from '@caspingus/lt/assessment';
LT.init(itemsApp); // Set up LT with the Items API application instance variable
LT.extensions.blueLightFilter.run();
show() → {void}
Shows the blue light filter if it is currently hidden. If the filter is already visible, it does nothing.
- Since
- 3.0.0
- Returns:
- void
toggle() → {boolean}
Shows or hides the blue light filter. Returns true if the blue light filter is currently visible, false otherwise.
- Since
- 3.0.0
- Returns:
- boolean