Methods
AddEvent(html_element, event_name, event_function)
Adds event to the element
Name | Type | Description |
---|---|---|
html_element | Node | Target element |
event_name | string | Target Event |
event_function | function | Callback Function |
- Source
Beautify(what, floats) → {string}
Beautifies the number, turns 9999999 into 9,999,999
Name | Type | Default | Description |
---|---|---|---|
what | number | Target number | |
floats | number | 0 | Chars after comma |
- Source
- Type:
- string
CatClick()
Function called when the kitten is clicked.
- Source
CheckCollision(div1, div2) → {boolean}
Checks collision of two elements
Name | Type | Description |
---|---|---|
div1 | HTMLElement | First element |
div2 | HTMLElement | Second element |
- Source
- Type:
- boolean
CompressBin(arr) → {number}
Compress a sequence like [0,1,1,0,1,0]... into a number like 54.
Name | Type | Description |
---|---|---|
arr | Array.<any> | Source data |
- Source
- Type:
- number
CompressLargeBin(arr) → {Array.<any>}
Compresses array. We have to compress in smaller chunks to avoid getting into scientific notation
Name | Type | Description |
---|---|---|
arr | Array.<any> | Source data |
- Source
- Type:
- Array.<any>
CupcakePrompt(title1, text1, showCancelButton1, closeOnConfirm1, inputPlaceholder1, inputError, onEnd, inputValue1) → {void}
Function to display a popup window with a text input prompt.
Name | Type | Description |
---|---|---|
title1 | string | The title of the window. |
text1 | string | The text displayed in the window. |
showCancelButton1 | boolean | Specifies whether the cancel button should be displayed. |
closeOnConfirm1 | boolean | Specifies whether the window should close after the confirm button is clicked. |
inputPlaceholder1 | string | The placeholder text displayed in the input field. |
inputError | string | The error message displayed when trying to submit an empty value. |
onEnd | function | The function called after the user enters a value. |
inputValue1 | string | The initial value displayed in the input field. |
- Source
- Type:
- void
KittenStart()
Function that starts the kitten game.
- Source
PlaySound(sound)
Plays sound from certian file
Name | Type | Description |
---|---|---|
sound | string | Path to the sound file |
- Source
UncompressBin(num) → {Array.<any>}
uncompress a number like 54 to a sequence like [0,1,1,0,1,0].
Name | Type | Description |
---|---|---|
num | number | Source data |
- Source
- Type:
- Array.<any>
UncompressLargeBin(arr) → {Array.<any>}
Uncomresses array
Name | Type | Description |
---|---|---|
arr | Array.<any> | Source data |
- Source
- Type:
- Array.<any>
b64_to_utf8(str) → {string}
Translates Base64 string to UTF8
Name | Type | Description |
---|---|---|
str | string | Target string |
- Source
- Type:
- string
caesarCipher(str, shift) → {string}
Encodes string with Caesar Cipher
Name | Type | Description |
---|---|---|
str | string | Target string |
shift | number | Cipher shift |
- Source
- Type:
- string
caesarDecipher(str, shift) → {string}
Decodes string with Caesar Cipher
Name | Type | Description |
---|---|---|
str | string | Source string |
shift | number | Cipher shift |
- Source
- Type:
- string
choose(arr) → {any}
Choosing random element from array
Name | Type | Description |
---|---|---|
arr | Array.<any> | Target array |
- Source
- Type:
- any
getRandomInt(min, max) → {number}
Gets random int in defined range
Name | Type | Description |
---|---|---|
min | number | Low bound |
max | number | High bound |
- Source
- Type:
- number
l(what) → {HTMLElement}
Gets element by ID (analog for $ from jQuery)
Name | Type | Description |
---|---|---|
what | string | Element ID |
- Source
- Type:
- HTMLElement
moveDiv()
Function to move the kitten to a random position on the screen.
- Source
readLocalFile(e) → {void}
Mod file opening event listner
Name | Type | Description |
---|---|---|
e | Event | Event element |
- Source
- Type:
- void
scopeEval(scope, script) → {any}
Evals the custom JS code with custom scope
Name | Type | Description |
---|---|---|
scope | Object | Object contains the scope |
script | string | String with js code |
- Source
- Type:
- any
shuffle(array) → {Array.<any>}
Shuffles the array
Name | Type | Description |
---|---|---|
array | Array.<any> | Target array |
- Source
- Type:
- Array.<any>
utf8_to_b64(str) → {string}
Translates UTF8 string to Base64
Name | Type | Description |
---|---|---|
str | string | Target string |
- Source
- Type:
- string