Last active
November 25, 2020 16:14
-
-
Save arunjeetsingh/c9a57a62a6096d367ac1c88aedfe1aa6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"outputSpeech": { | |
"type": "SSML", | |
"ssml": "<speak>Watch as I move this plane based on your position!</speak>" | |
}, | |
"directives": [ | |
{ | |
"type": "Alexa.Presentation.APL.RenderDocument", | |
"document": { | |
"type": "APL", | |
"version": "1.5", | |
"extensions": [ | |
{ | |
"name": "SmartMotion", | |
"uri": "alexaext:smartmotion:10" | |
}, | |
{ | |
"name": "EntitySensing", | |
"uri": "alexaext:entitysensing:10" | |
} | |
], | |
"settings": { | |
"SmartMotion": { | |
"deviceStateName": "DeviceState", | |
"wakeWordResponse": "turnToWakeWord" | |
}, | |
"EntitySensing": { | |
"primaryUserName": "PrimaryUser" | |
} | |
}, | |
"mainTemplate": { | |
"parameters": [ | |
"payload" | |
], | |
"items": [ | |
{ | |
"type": "Container", | |
"width": "300vw", | |
"height": "100vh", | |
"bind": [ | |
{ | |
"name": "InitialTranslateX", | |
"value": -1280 | |
}, | |
{ | |
"name": "CurrentTranslateX", | |
"value": "${InitialTranslateX}" | |
}, | |
{ | |
"name": "PrimaryUserRelativeAngle", | |
"value": 0 | |
}, | |
{ | |
"name": "TargetTranslateX", | |
"value": 0 | |
} | |
], | |
"items": [ | |
{ | |
"type": "Image", | |
"source": "https://aruntalkstech.s3.amazonaws.com/EchoShow10Demo/plane.jpg", | |
"width": "100%", | |
"height": "100%", | |
"scale": "none", | |
"align": "left", | |
"transform": [ | |
{ | |
"translateX": "${CurrentTranslateX}" | |
} | |
], | |
"handleTick": [ | |
{ | |
"when": "${environment.extension.EntitySensing}", | |
"minimumDelay": 100, | |
"commands": [ | |
{ | |
"type": "SetValue", | |
"property": "PrimaryUserRelativeAngle", | |
"value": "${Math.floor(PrimaryUser.poise.relativeAngle)}" | |
}, | |
{ | |
"type": "SetValue", | |
"property": "TargetTranslateX", | |
"value": "${InitialTranslateX + (PrimaryUserRelativeAngle * 10)}" | |
} | |
] | |
}, | |
{ | |
"when": "${environment.extension.EntitySensing}", | |
"minimumDelay": 20, | |
"commands": [ | |
{ | |
"when": "${TargetTranslateX > CurrentTranslateX}", | |
"type": "SetValue", | |
"property": "CurrentTranslateX", | |
"value": "${CurrentTranslateX + 10}" | |
}, | |
{ | |
"when": "${TargetTranslateX < CurrentTranslateX}", | |
"type": "SetValue", | |
"property": "CurrentTranslateX", | |
"value": "${CurrentTranslateX - 10}" | |
} | |
] | |
} | |
] | |
} | |
] | |
} | |
] | |
} | |
}, | |
"datasources": {} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment