Quark
#
Modules #
quark/actionquark/appquark/bubblesquark/bufferquark/checkboxquark/cssquark/ctrquark/dialogquark/eventquark/fontquark/fsquark/hashquark/httpquark/indexquark/jsonbquark/keyboardquark/mediaquark/navquark/netquark/osquark/pathquark/pkgquark/screenquark/stepperquark/storagequark/testquark/typesquark/utilquark/viewquark/windowquark/wsquark/_bufferquark/_commonquark/_eventquark/_extquark/_md5quark/_sha1quark/_sha256quark/_utilquark/_watching
Quark v1.3.0 Documentation
Table of Contents
quark/action #
KeyframeIn #
@typeKeyframeIn=StyleSheet|CSSNameExp
ActionIn #
@typeActionIn=Action|KeyframeIn[]| {playing?:boolean;loop?:number;speed?:number;spawn?:ActionIn[];seq?:ActionIn[];keyframe?:KeyframeIn[];
}
Class: Keyframe #
Keyframe #
@extendsStyleSheet
keyframe.index #
Get Keyframe index in the keyframe action
@getindex:number
keyframe.time #
Get Keyframe time poing
@gettime:number
keyframe.curve #
Get transition curve
@getcurve:types.Curve
keyframe.itemsCount #
Get StyleSheet items count
@getitemsCount:number
keyframe.apply(view) #
apply style to view
keyframe.fetch(view) #
fetch style from view
Class: Action #
Action #
Action base type, this is an abstract type without a constructor
@abstract
action.duration #
Get action playtime long
@getduration:number
action.playing #
Set/Get action playing state, if set then play() or stop() is called
playing:boolean
action.loop #
Set/Get action loop, the zero means not loop
loop:number
action.speed #
Set/Get action speed
speed:number
action.play() #
To play action
@returnthis
action.stop() #
To stop action
@returnthis
action.seek(time) #
Jump to target time, after calling it, it will reset the internal looped
action.seekPlay(time) #
Jump to the target time and start playing. The internal looped will be reset after calling
action.seekStop(time) #
Jump to the target time and stop playing. The internal looped will be reset after calling
action.before(action) #
Add a sibling action to the front of itself.
The current action needs to have a parent action else it will be invalid.
action.after(action) #
Add a sibling action to the back of itself.
The current action needs to have a parent action, otherwise it will be invalid.
action.remove() #
Deleting myself from the parent
@returnvoid
action.append(child) #
Add sub-actions to the end. Note: {KeyframeAction} cannot add sub-actions
action.clear() #
Clear all sub-actions or keyframes. After clearing, the action will stop immediately.
@returnvoid
action.constructor(win) #
@paramwin:Window
Class: SpawnAction #
SpawnAction #
@extendsAction
Class: SequenceAction #
SequenceAction #
@extendsAction
Class: KeyframeAction #
KeyframeAction #
@extendsAction
keyframeaction.time #
get play time
@gettime:number
keyframeaction.frame #
get playing frame index
@getframe:number
keyframeaction.length #
get count of frames
@getlength:number
keyframeaction.indexed #
Get the {Keyframe} for index
@getindexed:Keyframe
keyframeaction.addFrame(time,curve?) #
By time and curve add keyframe,and return it
@paramtime:UintKeyframe time point@paramcurve?:types.CurveInNocurveuse'ease'as default
Can use 'linear'、'ease'、'easeIn'、'easeOut'、'easeInOut' as params
@returnKeyframe
keyframeaction.addFrameWithCss(cssExp,time?,curve?) #
Add keyframes by the cssExp stylesheet name expression and return keyframes
@paramcssExp:CSSNameExpcss exp@paramtime?:UintKeyframe time point, Default as zero@paramcurve?:types.CurveInIf not passed,curveDefault as'ease'@returnKeyframe
keyframeaction.add(styleOrCssExp,time?,curve?) #
Add keyframes through cssExp stylesheet name expression or target property table,
and return keyframes
@paramstyleOrCssExp:KeyframeInstyle sheet or css exp@paramtime?:UintKeyframe time point, Default as zero@paramcurve?:types.CurveInIf not passed,curveDefault as'ease'@returnKeyframe
createAction(win,arg,parent?) #
- Create an action through the
jsonparameter. If theargpassed in isAction,
skip the creation process and return directly.
If the parent action is passed in, append the newly created action to the end ofparentafter creation. - If the passed in parameter is an
Array, create aKeyframeActionand use thisArrayto create the correspondingKeyframe - If the passed in parameter has a
seqattribute, create aSequenceAction - If the passed in parameter has a
spawnattribute, create aSpawnAction - If there is no
seqorspawnin the passed in parameter, create aKeyframeAction
If the object's internal attributekeyframeisArray, use thisArrayto create aKeyframe
For example:
var act1 = createAction(win, [
{ time:0, x:0 },
{ time:1000, x:100 },
]);
var act1 = createAction(win, {
keyframe: [
{ time:0, x:0, curve: 'linear', },
{ time:1000, x:100 },
]
});
// Creating `SequenceAction` and have two `KeyframeAction`
var act2 = createAction(win, {
loop: 999999,
seq: [
{
keyframe: [
{ time:0, x: 0 },
{ time:1000, x: 100 },
]
},
[
{ time:0, x: 100 },
{ time:1000, x: 0 },
]
]
})
ActionCb #
@callbackActionCb(e)@parame:ActionEvent
transition(view,to,fromOrCb?,cb?) #
Create a view style transition action by the style and play this action,
and callback after completion
Callback: cb()
For example:
// The transition is completed and callback is made after 1 second
transition(view, {
time: 1000,
y: 100,
x: 100,
}, ()={
console.log('view transition end');
})
// Use a linear transition
transition(view, {
time: 1000,
curve: 'linear',
y: 100,
x: 100,
}, 1000)
@paramview:View@paramto:KeyframeIn@paramfromOrCb?:KeyframeIn|ActionCb@paramcb?:ActionCb@returnKeyframeAction