@cycle-robot-drivers/screen
Advanced tools
Comparing version 0.0.27 to 0.0.28
@@ -274,12 +274,11 @@ "use strict"; | ||
var eyes = new EyeController(); | ||
var id = "face-" + String(Math.random()).substr(2); | ||
return function (command$) { | ||
var load$ = xstream_1.default.create(); | ||
var intervalID = setInterval(function () { | ||
if (!document.querySelector("#" + id)) { | ||
console.debug("Waiting for #" + id + " to appear..."); | ||
if (!document.querySelector(".face")) { | ||
console.debug("Waiting for .face to appear..."); | ||
return; | ||
} | ||
clearInterval(intervalID); | ||
var element = document.querySelector("#" + id); | ||
var element = document.querySelector(".face"); | ||
eyes.setElements({ | ||
@@ -330,3 +329,3 @@ leftEye: element.querySelector('.left.eye'), | ||
}); | ||
var vdom$ = xstream_1.default.of(dom_1.div("#" + id + ".face", { style: styles.face }, [ | ||
var vdom$ = xstream_1.default.of(dom_1.div(".face", { style: styles.face }, [ | ||
dom_1.div('.eye.left', { | ||
@@ -333,0 +332,0 @@ style: Object.assign({}, styles.eye, styles.left), |
@@ -269,12 +269,11 @@ import xs from 'xstream'; | ||
var eyes = new EyeController(); | ||
var id = "face-" + String(Math.random()).substr(2); | ||
return function (command$) { | ||
var load$ = xs.create(); | ||
var intervalID = setInterval(function () { | ||
if (!document.querySelector("#" + id)) { | ||
console.debug("Waiting for #" + id + " to appear..."); | ||
if (!document.querySelector(".face")) { | ||
console.debug("Waiting for .face to appear..."); | ||
return; | ||
} | ||
clearInterval(intervalID); | ||
var element = document.querySelector("#" + id); | ||
var element = document.querySelector(".face"); | ||
eyes.setElements({ | ||
@@ -325,3 +324,3 @@ leftEye: element.querySelector('.left.eye'), | ||
}); | ||
var vdom$ = xs.of(div("#" + id + ".face", { style: styles.face }, [ | ||
var vdom$ = xs.of(div(".face", { style: styles.face }, [ | ||
div('.eye.left', { | ||
@@ -328,0 +327,0 @@ style: Object.assign({}, styles.eye, styles.left), |
{ | ||
"name": "@cycle-robot-drivers/screen", | ||
"version": "0.0.27", | ||
"version": "0.0.28", | ||
"description": "Cycle.js drivers for rendering a robot face", | ||
@@ -5,0 +5,0 @@ "author": "Michael Jae-Yoon Chung", |
@@ -270,5 +270,5 @@ import xs from 'xstream'; | ||
* [TabletFace](https://github.com/mjyc/tablet-robot-face) driver factory. | ||
* | ||
* | ||
* @param options possible key includes | ||
* | ||
* | ||
* * styles {object} A group of optional face style parameters: | ||
@@ -281,3 +281,3 @@ * * faceColor {string} (default: 'whitesmoke') | ||
* * eyelidColor {string} (default: 'whitesmoke') | ||
* | ||
* | ||
* @return {Driver} the TabletFace Cycle.js driver function. It takes a stream | ||
@@ -347,3 +347,2 @@ * of `Command` and returns `DOM`, animationFinish`, and `load` streams. | ||
const eyes = new EyeController(); | ||
const id = `face-${String(Math.random()).substr(2)}`; | ||
@@ -353,4 +352,4 @@ return function(command$) { | ||
const intervalID = setInterval(() => { | ||
if (!document.querySelector(`#${id}`)) { | ||
console.debug(`Waiting for #${id} to appear...`); | ||
if (!document.querySelector(`.face`)) { | ||
console.debug(`Waiting for .face to appear...`); | ||
return; | ||
@@ -360,3 +359,3 @@ } | ||
const element = document.querySelector(`#${id}`); | ||
const element = document.querySelector(`.face`); | ||
eyes.setElements({ | ||
@@ -415,3 +414,3 @@ leftEye: element.querySelector('.left.eye'), | ||
const vdom$ = xs.of( | ||
div(`#${id}.face`, {style: styles.face}, [ | ||
div(`.face`, {style: styles.face}, [ | ||
div('.eye.left', { | ||
@@ -418,0 +417,0 @@ style: (Object as any).assign({}, styles.eye, styles.left), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
209427
3940