Constructor
new Frame(propertiesopt)
Name | Type | Default | Description |
---|---|---|---|
properties ? |
any |
{}
|
properties |
Example
const frame = new Scene.Frame({
display: "none"
transform: {
translate: "50px",
scale: "5, 5",
}
});
Methods
clone() → {Frame}
clone frame.
Example
frame.clone();
Returns:
An instance of clone
- Type
- Frame
get(…args)
get property value
Name | Type | Attributes | Description |
---|---|---|---|
args |
Number | String | PropertyObject |
<repeatable> |
property name or value |
Example
frame.get("display") // => "none", "block", ....
frame.get("transform", "translate") // => "10px,10px"
getNames() → {string[][]}
Gets the names of properties.
Example
// one parameter
frame.set({
display: "none",
transform: {
translate: "10px, 10px",
scale: "1",
},
});
// [["display"], ["transform", "translate"], ["transform", "scale"]]
console.log(frame.getNames());
Returns:
the names of properties.
- Type
- string[][]
has(…args)
check that has property.
Name | Type | Attributes | Description |
---|---|---|---|
args |
String |
<repeatable> |
property name |
Example
frame.has("property", "display") // => true or false
merge(frame) → {Frame}
merge one frame to other frame.
Name | Type | Description |
---|---|---|
frame |
Frame | target frame. |
Example
frame.merge(frame2);
Returns:
An instance itself
- Type
- Frame
remove(…args) → {Frame}
remove property value
Name | Type | Attributes | Description |
---|---|---|---|
args |
String |
<repeatable> |
property name |
Example
frame.remove("display")
Returns:
An instance itself
- Type
- Frame
set(…args) → {Frame}
set property
Name | Type | Attributes | Description |
---|---|---|---|
args |
Number | String | PropertyObject |
<repeatable> |
property names or values |
Example
// one parameter
frame.set({
display: "none",
transform: {
translate: "10px, 10px",
scale: "1",
},
filter: {
brightness: "50%",
grayscale: "100%"
}
});
// two parameters
frame.set("transform", {
translate: "10px, 10px",
scale: "1",
});
// three parameters
frame.set("transform", "translate", "50px");
Returns:
An instance itself
- Type
- Frame
toCSS() → {string}
Specifies an css text that coverted the frame.
Returns:
cssText
- Type
- string
toCSSObject() → {object}
Specifies an css object that coverted the frame.
Returns:
cssObject
- Type
- object