Members

(constant) API

Sample Api where the images will be requested

(constant) COLORS

List of colors

(constant) POSITION_AND_SIZE

Default position and size

(constant) createId

Function that creates an id

(async, constant) get_images

Function that makes a request to the selected api.

(constant) randomArrayElement

Returns a random element from an array

(constant) randomNumberBetween

Generates a random number between a range

Methods

Button(children, onClick, id)

Component that is a basic button

Parameters:
NameTypeDescription
childrenany

Children of the component

onClickfunction

Function to be executed when clicking on the button.

idstring

Button id

Returns:
  • Basic button component

MoveableComponent(img, color, id, top, left, width, height, error, limitBottom, limitRight)

Component to be resized, which can be a div or an image.

Parameters:
NameTypeDescription
imgstring

Url of the image to render

colorstring

If the element is a div, it will have a random color.

idnumber

Id of the element to render

topnumber

Position of the top element

leftnumber

Poicion of the element left

widthnumber

Width of the element to be rendered

heightnumber

Height of the element to be rendered

errorboolean

Indicates if there was an error in the image request

limitBottomnumber

Lower limit to which the element can be displaced

limitRightnumber

Horizontal limit to where the element can be displaced

Returns:
  • Component to resize moveable

Spinner()

Component that is a spinner indicating the charge of some element.

Returns:
  • Spinner component