Landing Pages | | Cell 1 | Search

This code sets up a screen for the domain act.com using the $TS.screen function, with specified options for zoom, width, and height. The options include a zoom level of 0.5, a width of 680 pixels, and a cropped height of 400 pixels.

Cell 0

$TS.screen('act.com', {zoom: .5, width: 680, 'crop-h': 400});

What the code could have been:

typescript
// Import the screen function
import { screen } from 'ts-screen';

/**
 * Sets the screen's act.com URL with specified options.
 *
 * @param url The URL of the application.
 * @param options The options for the screen.
 * @param options.zoom The zoom level of the screen.
 * @param options.width The width of the screen.
 * @param options['crop-h'] The crop height of the screen.
 */
function setScreen(url: string, options: { zoom: number; width: number; 'crop-h': number } = {}): void {
  // Use the screen function to set the screen
  screen(url, {
    // Set the zoom level
    zoom: options.zoom,
    // Set the width
    width: options.width,
    // Set the crop height
    'crop-h': options['crop-h'],
  });
}

// Call the setScreen function
setScreen('act.com', { zoom: 0.5, width: 680, 'crop-h': 400 });

Code Breakdown

Purpose

The code is used to set up a screen using the $TS.screen function.

Function Call

Options