NovaOS's UI tools (not toolkit, just UI tools)
Methods
center(element)
Centers an element on the screen.
Parameters
-
element
HTMLElementThe element to center.
Source
crtheme(hex)
Changes the theme of the UI to a color.
Parameters
-
hex
stringThe hex color to set the theme to.
Source
cv(varName, varValue)
Changes a CSS variable value.
Parameters
-
varName
stringThe name of the CSS variable to change.
-
varValue
stringThe value to set the CSS variable to.
Source
dest(dr1, animopt)
Fades out an element with a custom animation duration.
Parameters
-
dr1
StringA reference to an existing element, in JQUERY format
-
anim
Number<optional>
170The duration of the animation in milliseconds.
Source
hexdark(hex) → {Boolean}
Determines if a HEX Colour is dark or light
Parameters
-
hex
String
Returns
-
BooleanTrue if the colour is dark, false if the colour is light
Source
hextool(hex, percent) → {String}
Adjusts brightness of a HEX Colour by a specific percent value
Parameters
-
hex
String -
percent
Number
Returns
-
StringAdjusted HEX Colour
Source
hextorgb(hex) → {String}
Converts a HEX Colour to RGB
Parameters
-
hex
String
Returns
-
StringRGB Colour
Source
hide(dr1, animopt) → {void}
Hides an element.
Parameters
-
dr1
StringA reference to an existing element, in JQUERY format
-
anim
Number<optional>
210The duration of the animation in milliseconds.
Returns
-
void
Source
hidecls(className)
Hides an element with a custom animation duration.
Parameters
-
className
StringThe Classname of the element to hide.
Source
masschange(classn, val)
Mass changes the text content of elements with a specific class.
Parameters
-
classn
StringThe class of the elements to change.
-
val
StringThe value to set the text content to.
Source
play(filename, volumeopt) → {void}
Plays an audio file from an HTTP server.
Parameters
-
filename
StringThe path to the audio file.
-
volume
Number<optional>
1The volume to play the audio at.
Returns
-
void
Source
show(dr1, animopt) → {void}
Shows an element.
Parameters
-
dr1
StringA reference to an existing element, in JQUERY format
-
anim
Number<optional>
210The duration of the animation in milliseconds.
Returns
-
void
Source
showcls(className)
Shows an element with a custom animation duration.
Parameters
-
className
StringThe Classname of the element to show.
Source
showfi(dr1, animopt) → {void}
Fades in an an element with a custom animation duration.
Parameters
-
dr1
StringA reference to an existing element, in JQUERY format
-
anim
Number<optional>
170The duration of the animation in milliseconds.
Returns
-
void
Source
sw(d1, d2)
Fades between two elements.
Parameters
-
d1
stringThe ID of the first element.
-
d2
stringThe ID of the second element.
Source
sw2(d1, d2)
Fades between two elements.
Parameters
-
d1
StringA reference to an existing element, in JQUERY format
-
d2
StringA reference to an existing element, in JQUERY format
Source
theme(background1, background2, shade1, shade2, accent)
Changes the theme of the UI.
Parameters
-
background1
stringThe primary background color.
-
background2
stringThe secondary background color.
-
shade1
stringThe primary shade color.
-
shade2
stringThe secondary shade color.
-
accent
stringThe accent color.
Source
toggle(elementId, time3opt) → {void}
Toggles the visibility of an element.
Parameters
-
elementId
StringThe ID of the element to toggle.
-
time3
Number<optional>
210The duration of the animation in milliseconds.
Returns
-
void