Last active
August 29, 2015 14:06
-
-
Save SamirBenzenine/ab2a80d9868fca18370d to your computer and use it in GitHub Desktop.
designer
This file contains 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
<link rel="import" href="../speech-mic/speech-mic.html"> | |
<link rel="import" href="../paper-input/paper-input.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; | |
box-sizing: border-box; | |
} | |
#speech_mic { | |
left: 580px; | |
top: 280px; | |
position: absolute; | |
} | |
#paper_input { | |
left: 300px; | |
top: 280px; | |
position: absolute; | |
} | |
</style> | |
<speech-mic id="speech_mic"></speech-mic> | |
<paper-input label="Type something..." willvalidate id="speechInput" layout vertical></paper-input> | |
</template> | |
<script> | |
Polymer({ | |
var speechInput = document.querySelector('#speechInput'); | |
var speechMic = document.querySelector('#speechMic'); | |
speechMic.addEventListener('speech-mic-result', function(e) { | |
speechInput.value = e.detail.transcript; | |
}); | |
}); | |
</script> | |
</polymer-element> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment