Cycle.js drivers and action components for a tablet robot face.
Try the demo at StackBlitz!
Note that this package was tested with Chrome browser (>= 65.0.3325.181) only.
API
FacialExpressionAction(sources)
FacialExpression action component.
Params:
- sources
- goal: a stream of
null
(as "cancel") or a string 'happy'
, 'sad'
,
'angry'
, 'focused'
, or 'confused'
(as the TabletFace driver's
EXPRESS
type command value). - DOM: Cycle.js DOMSource.
Return:
- sinks
- output: a stream for the TabletFace driver.
- status: depreciated.
- result: a stream of action results.
result.result
is always null
.
SpeechbubbleAction(sources)
Speechbubble action component.
Params:
- sources
- goal: a stream of
null
(as "cancel"),
{type: 'MESSAGE', value: 'Hello world'}
or 'Hello world'
(as
"message"), or {type: 'CHOICE', value: ['Hello', 'World']}
or ['Hello', 'World']
(as "multiple choice"). - DOM: Cycle.js DOMSource.
Return:
TwoSpeechbubblesAction(sources)
TwoSpeechbubbles, Robot and Human, action component.
Params:
- sources
- goal: a stream of
null
(as "cancel"),
{type: 'SET_MESSAGE', value: 'Hello world'}
or 'Hello world'
(as
"set message"), or {type: 'ASK_QUESTION', message: 'Blue pill or red pill?', choices: ['Blue', 'Red']}
(as "ask multiple choice"). - DOM: Cycle.js DOMSource.
Return:
makeTabletFaceDriver()
TabletFace driver factory.
Return:
- Driver the TabletFace Cycle.js driver function. It takes a stream of
Command
and returns DOM
, animationFinish
, and load
streams.