@code-dot-org/dance-party
Advanced tools
Comparing version 1.0.6 to 1.0.7
{ | ||
"name": "@code-dot-org/dance-party", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/main.js", |
@@ -152,7 +152,10 @@ module.exports = class DanceAPI { | ||
}, | ||
ai: value => { | ||
nativeAPI.ai(value); | ||
ai: params => { | ||
nativeAPI.ai(params); | ||
}, | ||
aiText: value => { | ||
nativeAPI.aiText(value); | ||
}, | ||
}; | ||
} | ||
}; |
@@ -584,2 +584,5 @@ const constants = require('./constants'); | ||
draw: function ({bpm}) { | ||
// Provide a default value for bpm of song when not provided so that | ||
// sparkles effect is drawn even in preview mode. | ||
bpm = bpm || 120; | ||
p5.background('#2b1e45'); | ||
@@ -586,0 +589,0 @@ let velocity = Math.floor((bpm / 90) * 3); |
@@ -1122,3 +1122,21 @@ /* eslint-disable no-unused-vars, curly, eqeqeq */ | ||
// Called when executing the AI block. | ||
async ai(value) { | ||
ai(params) { | ||
console.log('handle AI:', params); | ||
if (params) { | ||
if (params.backgroundEffect && params.backgroundColor) { | ||
this.setBackgroundEffect( | ||
params.backgroundEffect, | ||
params.backgroundColor | ||
); | ||
} | ||
if (params.foregroundEffect) { | ||
this.setForegroundEffect(params.foregroundEffect); | ||
} | ||
} | ||
} | ||
// Called when executing the free-text AI block. | ||
async aiText(value) { | ||
console.log('AI:', value); | ||
@@ -1133,6 +1151,3 @@ | ||
this.setBackgroundEffect( | ||
params.backgroundEffect, | ||
params.backgroundColor | ||
); | ||
this.setBackgroundEffect(params.backgroundEffect, params.backgroundColor); | ||
@@ -1139,0 +1154,0 @@ this.setForegroundEffect(params.foregroundEffect); |
Sorry, the diff of this file is too big to display
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
20665724
113373