├── .babelrc
├── .gitignore
├── .postcssrc
├── .vscode
└── launch.json
├── LICENSE
├── README.md
├── docs
├── css
│ └── app.56f2549f.css
├── favicon.ico
├── index.html
└── js
│ ├── app.11df425d.js
│ ├── app.11df425d.js.map
│ ├── chunk-vendors.7ee3254a.js
│ └── chunk-vendors.7ee3254a.js.map
├── package.json
├── public
├── favicon.ico
└── index.html
├── src
├── App.vue
├── assets
│ └── logo.png
├── components
│ ├── AppBase.vue
│ ├── AppButtonrecord.vue
│ ├── AppControls.vue
│ ├── AppEmotionstatus.vue
│ ├── AppRecordinglogic.vue
│ ├── AppRecordintensity.vue
│ ├── AppRecordintent.vue
│ ├── AppRefresh.vue
│ └── AppSineloader.vue
├── main.js
└── store.js
└── yarn.lock
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "@vue/app"
4 | ]
5 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ### OSX ###
2 | *.DS_Store
3 | .AppleDouble
4 | .LSOverride
5 |
6 | # Icon must end with two
7 | Icon
8 | # Thumbnails
9 | ._*
10 | # Files that might appear in the root of a volume
11 | .DocumentRevisions-V100
12 | .fseventsd
13 | .Spotlight-V100
14 | .TemporaryItems
15 | .Trashes
16 | .VolumeIcon.icns
17 | .com.apple.timemachine.donotpresent
18 | # Directories potentially created on remote AFP share
19 | .AppleDB
20 | .AppleDesktop
21 | Network Trash Folder
22 | Temporary Items
23 | .apdisk
24 |
25 | ### Node ###
26 | # Logs
27 | logs
28 | *.log
29 | npm-debug.log*
30 |
31 | # Runtime data
32 | pids
33 | *.pid
34 | *.seed
35 | *.pid.lock
36 |
37 | # Directory for instrumented libs generated by jscoverage/JSCover
38 | lib-cov
39 |
40 | # Coverage directory used by tools like istanbul
41 | coverage
42 |
43 | # nyc test coverage
44 | .nyc_output
45 |
46 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
47 | .grunt
48 |
49 | # node-waf configuration
50 | .lock-wscript
51 |
52 | # Compiled binary addons (http://nodejs.org/api/addons.html)
53 | build/Release
54 |
55 | # Dependency directories
56 | node_modules
57 | jspm_packages
58 | yarn.lock
59 |
60 | # Optional npm cache directory
61 | .npm
62 |
63 | # Optional eslint cache
64 | .eslintcache
65 |
66 | # Optional REPL history
67 | .node_repl_history
68 |
69 | # Output of 'npm pack'
70 | *.tgz
71 |
72 | # Yarn Integrity file
73 | .yarn-integrity
74 |
75 | # Nuxt build
76 | .nuxt
77 |
78 | # Nuxt generate
79 | dist
--------------------------------------------------------------------------------
/.postcssrc:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": {
3 | "autoprefixer": {}
4 | }
5 | }
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "type": "node",
9 | "request": "launch",
10 | "name": "Launch Program",
11 | "program": "${file}"
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Sarah Drasner
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Three Vue Pattern
2 |
3 | This project brings together a few concepts, outlined below:
4 |
5 | ## Three.js, Vue, and LUIS
6 |
7 | I have wanted to be able to update a three.js visualization on the fly with Vue for a little while ago. This app started with the base concepts outlined in [this repo](https://github.com/colordodge/ThreeJS_Kaleidoscope) and refactors/extends them to be manipulated by your emotion based on speech. You can update the visualization (through state in Vuex) by using [LUIS](https://aka.ms/luishome) to analyze your speech.
8 |
9 | [LUIS](https://aka.ms/luishome) is a machine learning based service to build natural language through the use of custom models that can continuously improve. We can use this for apps, bots, and even IoT devices. Here we're guiding our visualization, first by telling it our mood, and then we're able to control with it with our voice to update it on the fly and without the use of our hands. The purpose of this demo is to create a biofeedback visualization for those who are trying to guide themselves through healing. There's more information in my Live and Machine Learn talk that I will be giving at Microsoft Build, and possibly a subsequent article.
10 |
11 | 
12 |
13 | This project was created in collaboration with [Brian Holt](https://github.com/btholt).
14 |
15 | ---
16 |
17 | To install dependencies and set up a dev server, run:
18 |
19 | ```
20 | yarn
21 | yarn serve
22 | ```
23 |
24 | This will set up a server at `localhost:8080`.
25 |
--------------------------------------------------------------------------------
/docs/css/app.56f2549f.css:
--------------------------------------------------------------------------------
1 | canvas[data-v-b8d44556] {
2 | height: 150px;
3 | }
4 | button[data-v-4fcce4f0] {
5 | border-radius: 1000px;
6 | background: red;
7 | width: 80px;
8 | height: 80px;
9 | border: none;
10 | outline: 0;
11 | cursor: pointer;
12 | margin-top: 10px;
13 | -webkit-transition: all 0.3s ease-out;
14 | transition: all 0.3s ease-out;
15 | }
16 | button.disabled[data-v-4fcce4f0] {
17 | background: #ccc;
18 | cursor: none;
19 | }
20 | div[data-v-a98b1596] {
21 | background: #000;
22 | }
23 | button[data-v-a98b1596] {
24 | border: none;
25 | outline: none;
26 | padding: 12px 15px 10px;
27 | background: #333;
28 | color: #fff;
29 | font-family: Josefin Sans, sans-serif;
30 | font-size: 16px;
31 | border-radius: 5px;
32 | cursor: pointer;
33 | -webkit-transition: all 0.2s ease;
34 | transition: all 0.2s ease;
35 | }
36 | button[data-v-a98b1596]:hover {
37 | background: #444;
38 | }
39 | main[data-v-ddfa84b8] {
40 | margin-top: 40px;
41 | padding: 20px 20px 40px;
42 | text-align: center;
43 | background: #000;
44 | position: absolute;
45 | top: 20px;
46 | left: 50%;
47 | width: 500px;
48 | margin-left: -250px;
49 | }
50 | h1[data-v-ddfa84b8] {
51 | color: #f5f5f5;
52 | }
53 | p.big[data-v-ddfa84b8] {
54 | font-size: 20px;
55 | line-height: 1.5;
56 | }
57 | span[data-v-ddfa84b8] {
58 | color: #a8a7a7;
59 | }
60 | div[data-v-69bb8ec4] {
61 | position: absolute;
62 | text-align: center;
63 | bottom: 30px;
64 | left: 50%;
65 | margin-left: -50px;
66 | width: 135px;
67 | }
68 | button[data-v-69bb8ec4] {
69 | border: none;
70 | outline: none;
71 | padding: 12px 15px 10px;
72 | background: #333;
73 | color: #fff;
74 | font-family: Josefin Sans, sans-serif;
75 | font-size: 16px;
76 | border-radius: 5px;
77 | cursor: pointer;
78 | -webkit-transition: all 0.2s ease;
79 | transition: all 0.2s ease;
80 | }
81 | button[data-v-69bb8ec4]:hover {
82 | background: #444;
83 | }
84 | main[data-v-6bc156ea] {
85 | margin-top: 40px;
86 | padding: 20px 20px 40px;
87 | text-align: center;
88 | background: #000;
89 | position: absolute;
90 | top: 20px;
91 | left: 50%;
92 | width: 500px;
93 | margin-left: -250px;
94 | }
95 | h1[data-v-6bc156ea] {
96 | color: #f5f5f5;
97 | }
98 | p.big[data-v-6bc156ea] {
99 | font-size: 20px;
100 | line-height: 1.5;
101 | }
102 | span[data-v-6bc156ea] {
103 | color: #a8a7a7;
104 | }
105 | body {
106 | margin: 0;
107 | overflow: hidden;
108 | background-color: #000;
109 | font-family: Josefin Sans, sans-serif;
110 | font-weight: 300;
111 | color: #fff;
112 | display: -webkit-box;
113 | display: -ms-flexbox;
114 | display: flex;
115 | -webkit-box-pack: center;
116 | -ms-flex-pack: center;
117 | justify-content: center;
118 | -ms-flex-line-pack: center;
119 | align-content: center;
120 | }
121 | canvas {
122 | width: 100%;
123 | height: 100%;
124 | }
125 |
--------------------------------------------------------------------------------
/docs/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sdras/three-vue-pattern/cf00595d6fc3901c81d142e20474599b811870ed/docs/favicon.ico
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | three-vue-kaleidoscope
11 |
12 |
13 |
14 |
15 |
16 |
17 |
19 |
20 |
--------------------------------------------------------------------------------
/docs/js/app.11df425d.js:
--------------------------------------------------------------------------------
1 | (function(e){function t(t){for(var i,o,a=t[0],c=t[1],u=t[2],d=0,l=[];dr&&(C=1),a.faces.push(new c["c"](0,q,C))}a.computeBoundingSphere(),a.computeBoundingBox(),a.faceVertexUvs[0]=[];var $=1/e,E=1-$,R=E/2,N=1-E/2;for(w=0;w\n \n\n\n\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppBase.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppBase.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./AppBase.vue?vue&type=template&id=3f6dadb2&scoped=true&\"\nimport script from \"./AppBase.vue?vue&type=script&lang=js&\"\nexport * from \"./AppBase.vue?vue&type=script&lang=js&\"\nimport style0 from \"./AppBase.vue?vue&type=style&index=0&id=3f6dadb2&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"3f6dadb2\",\n null\n \n)\n\ncomponent.options.__file = \"AppBase.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('main',[_c('h1',[_vm._v(\"How do you feel?\")]),_vm._m(0),_vm._m(1),_c('app-recordinglogic')],1)}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('p',{staticClass:\"big\"},[_c('span',[_vm._v(\"Some options... \")]),_c('br'),_c('em',[_vm._v(\"excited, nervous, frustrated, happy, calm, tipsy\")])])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('p',[_c('span',[_vm._v(\"Hit the button and start recording\")])])}]\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.intent === 'None' || _vm.aborted)?_c('app-buttonrecord',{attrs:{\"aborted\":_vm.aborted},on:{\"isaborted\":function($event){_vm.aborted = $event}}}):_vm._e(),(_vm.uiState === 'listening' || \n _vm.intent !== 'None' && \n _vm.aborted === false)?_c('div',[_c('app-sineloader'),_c('button',{on:{\"click\":_vm.aborting}},[_vm._v(\"Abort Recording\")])],1):_vm._e()],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('canvas',{ref:\"waves\"})}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n \n\n\n\n\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppSineloader.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppSineloader.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./AppSineloader.vue?vue&type=template&id=b8d44556&scoped=true&\"\nimport script from \"./AppSineloader.vue?vue&type=script&lang=js&\"\nexport * from \"./AppSineloader.vue?vue&type=script&lang=js&\"\nimport style0 from \"./AppSineloader.vue?vue&type=style&index=0&id=b8d44556&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"b8d44556\",\n null\n \n)\n\ncomponent.options.__file = \"AppSineloader.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('button',{class:{ disabled: _vm.uiState === 'listening' },on:{\"click\":_vm.getNewIntent}})])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n \n \n
\n\n\n\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppButtonrecord.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppButtonrecord.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./AppButtonrecord.vue?vue&type=template&id=4fcce4f0&scoped=true&\"\nimport script from \"./AppButtonrecord.vue?vue&type=script&lang=js&\"\nexport * from \"./AppButtonrecord.vue?vue&type=script&lang=js&\"\nimport style0 from \"./AppButtonrecord.vue?vue&type=style&index=0&id=4fcce4f0&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"4fcce4f0\",\n null\n \n)\n\ncomponent.options.__file = \"AppButtonrecord.vue\"\nexport default component.exports","\n \n\n\n\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppRecordinglogic.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppRecordinglogic.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./AppRecordinglogic.vue?vue&type=template&id=a98b1596&scoped=true&\"\nimport script from \"./AppRecordinglogic.vue?vue&type=script&lang=js&\"\nexport * from \"./AppRecordinglogic.vue?vue&type=script&lang=js&\"\nimport style0 from \"./AppRecordinglogic.vue?vue&type=style&index=0&id=a98b1596&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"a98b1596\",\n null\n \n)\n\ncomponent.options.__file = \"AppRecordinglogic.vue\"\nexport default component.exports","\n \n How do you feel?
\n Some options...
\n excited, nervous, frustrated, happy, calm, tipsy
\n Hit the button and start recording
\n \n \n\n\n\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppRecordintent.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppRecordintent.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./AppRecordintent.vue?vue&type=template&id=ddfa84b8&scoped=true&\"\nimport script from \"./AppRecordintent.vue?vue&type=script&lang=js&\"\nexport * from \"./AppRecordintent.vue?vue&type=script&lang=js&\"\nimport style0 from \"./AppRecordintent.vue?vue&type=style&index=0&id=ddfa84b8&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"ddfa84b8\",\n null\n \n)\n\ncomponent.options.__file = \"AppRecordintent.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('main',[_c('h1',{staticClass:\"emotion\"},[_vm._v(\"Feeling \"+_vm._s(_vm.emotion))]),_c('h3',[_vm._v(\"Change the intensity!\")]),_vm._m(0),_c('app-recordinglogic')],1),_c('app-refresh')],1)}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('p',{staticClass:\"big\"},[_c('span',[_vm._v(\"Some options... \")]),_c('em',[_vm._v(\"more, less\")])])}]\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('button',{on:{\"click\":_vm.refresh}},[_vm._v(\"Start again\")])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n \n \n
\n\n\n\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppRefresh.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppRefresh.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./AppRefresh.vue?vue&type=template&id=69bb8ec4&scoped=true&\"\nimport script from \"./AppRefresh.vue?vue&type=script&lang=js&\"\nexport * from \"./AppRefresh.vue?vue&type=script&lang=js&\"\nimport style0 from \"./AppRefresh.vue?vue&type=style&index=0&id=69bb8ec4&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"69bb8ec4\",\n null\n \n)\n\ncomponent.options.__file = \"AppRefresh.vue\"\nexport default component.exports","\n \n
\n Feeling {{ emotion }}
\n Change the intensity!
\n Some options... more, less
\n \n \n\n
\n
\n\n\n\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppRecordintensity.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppRecordintensity.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./AppRecordintensity.vue?vue&type=template&id=6bc156ea&scoped=true&\"\nimport script from \"./AppRecordintensity.vue?vue&type=script&lang=js&\"\nexport * from \"./AppRecordintensity.vue?vue&type=script&lang=js&\"\nimport style0 from \"./AppRecordintensity.vue?vue&type=style&index=0&id=6bc156ea&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"6bc156ea\",\n null\n \n)\n\ncomponent.options.__file = \"AppRecordintensity.vue\"\nexport default component.exports","\n \n\n
\n
\n\n
\n
\n
\n
\n
\n
\n \n
\n\n\n\n\n\n","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./App.vue?vue&type=template&id=574c2228&\"\nimport script from \"./App.vue?vue&type=script&lang=js&\"\nexport * from \"./App.vue?vue&type=script&lang=js&\"\nimport style0 from \"./App.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"App.vue\"\nexport default component.exports","import Vue from 'vue'\nimport Vuex from 'vuex'\nimport axios from 'axios'\n\nVue.use(Vuex)\n\nconst SpeechRecognition =\n window.SpeechRecognition || window.webkitSpeechRecognition\nconst SpeechGrammarList =\n window.SpeechGrammarList || window.webkitSpeechGrammarList\nconst SpeechRecognitionEvent =\n window.SpeechRecognitionEvent || window.webkitSpeechRecognitionEvent\n\nif (!SpeechRecognition) {\n // uh shit browser doesn't support speech, do things here\n}\n\nconst recognition = new SpeechRecognition()\n\nrecognition.lang = 'en-US'\nrecognition.interimResults = false\nrecognition.maxAlternatives = 1\n\nexport default new Vuex.Store({\n state: {\n counter: 0,\n intent: 'None',\n intensity: 'None',\n score: 0,\n // idle - awaiting user input\n // listening - listening to user input\n // fetching - fetching user data from the API\n uiState: 'idle',\n zoom: 3\n },\n getters: {\n intentStr: state => {\n var str = state.intent\n str = str.replace(/\\b(App.)\\b/gi, '')\n return str\n },\n intensityStr: state => {\n var str = state.intensity\n str = str.replace(/\\b(Intensity.)\\b/gi, '')\n return str\n }\n },\n mutations: {\n newIntent: (state, { intent, score }) => {\n if (intent.includes('Intensity')) {\n state.intensity = intent\n if (intent.includes('More')) {\n state.counter++\n } else if (intent.includes('Less')) {\n state.counter--\n }\n } else {\n state.intent = intent\n }\n state.score = score\n },\n setUiState: (state, status) => {\n state.uiState = status\n },\n setIntent: (state, status) => {\n state.intent = status\n },\n abortRecording: state => {\n recognition.abort()\n state.uiState = 'idle'\n },\n setZoom: state => {\n var expr = state.intent\n switch (expr) {\n case 'App.Excited':\n state.zoom = 2 + state.counter\n break\n case 'App.Nervous':\n state.zoom = 2 + state.counter\n break\n case 'App.Happy':\n state.zoom = 2 + state.counter\n break\n case 'App.Tipsy':\n state.zoom = 1 + state.counter\n break\n default:\n state.zoom = 3 + state.counter\n }\n }\n },\n actions: {\n getSpeech({ dispatch, commit, state }) {\n commit('setUiState', 'listening')\n\n //keep recording speech all the time or activate it- for the first screen no, press a button. second screen yes.\n state.intent === 'None'\n ? (recognition.continuous = true)\n : (recognition.continuous = false)\n\n recognition.start()\n\n recognition.onresult = function(event) {\n const last = event.results.length - 1\n const phrase = event.results[last][0].transcript\n dispatch('getUnderstanding', phrase)\n }\n },\n\n getUnderstanding({ commit }, utterance) {\n commit('setUiState', 'fetching')\n const url = `https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/4aba2274-c5df-4b0d-8ff7-57658254d042`\n\n https: axios({\n method: 'get',\n url,\n params: {\n verbose: true,\n timezoneOffset: 0,\n q: utterance\n },\n headers: {\n 'Content-Type': 'application/json',\n 'Ocp-Apim-Subscription-Key': '6c85f08d11e84b59b655b8a919b9e286'\n }\n })\n .then(({ data }) => {\n console.log('axios result', data)\n if (altMaps.hasOwnProperty(data.query)) {\n commit('newIntent', {\n intent: altMaps[data.query],\n score: 1\n })\n } else {\n commit('newIntent', data.topScoringIntent)\n }\n commit('setUiState', 'idle')\n commit('setZoom')\n })\n .catch(err => {\n console.error('axios error', err)\n })\n }\n }\n})\n\n// if it keeps thinking you're saying something else, add here:\n// we don't want to do it in Luis if the meaning is much different\n// because it will learn the wrong thing.\nconst altMaps = {\n gypsy: 'App.Tipsy',\n call: 'App.Calm',\n Les: 'Intensity.Less',\n bus: 'Intensity.Less',\n Bus: 'Intensity.Less',\n plus: 'Intensity.Less',\n Plus: 'Intensity.Less',\n last: 'Intensity.Less',\n Last: 'Intensity.Less',\n Rush: 'Intensity.Less',\n bless: 'Intensity.Less',\n Bless: 'Intensity.Less',\n Bess: 'Intensity.Less',\n bess: 'Intensity.Less',\n best: 'Intensity.Less',\n birth: 'Intensity.Less',\n love: 'Intensity.Less',\n plus: 'Intensity.Less',\n glad: 'Intensity.Less',\n louis: 'Intensity.Less',\n glass: 'Intensity.Less',\n let: 'Intensity.Less',\n lek: 'Intensity.Less',\n lek: 'Intensity.Less',\n west: 'Intensity.Less',\n West: 'Intensity.Less',\n ad: 'Intensity.More',\n mall: 'Intensity.More',\n mirrors: 'App.Nervous',\n hobby: 'App.Happy',\n heavy: 'App.Happy',\n faded: 'App.Excited',\n phelan: 'App.Excited',\n home: 'App.Calm',\n call: 'App.Calm',\n hull: 'App.Calm',\n paris: 'App.Nervous',\n Paris: 'App.Nervous',\n nurse: 'App.Nervous',\n tipton: 'App.Tipsy'\n}\n","import Vue from 'vue'\nimport App from './App.vue'\nimport store from './store'\n\nVue.config.productionTip = false\n\nnew Vue({\n store,\n render: h => h(App)\n}).$mount('#app')\n","import mod from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/postcss-loader/lib/index.js??ref--8-oneOf-1-2!../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/postcss-loader/lib/index.js??ref--8-oneOf-1-2!../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=style&index=0&lang=scss&\"","import mod from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/lib/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppSineloader.vue?vue&type=style&index=0&id=b8d44556&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/lib/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppSineloader.vue?vue&type=style&index=0&id=b8d44556&lang=scss&scoped=true&\"","import mod from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/lib/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppRefresh.vue?vue&type=style&index=0&id=69bb8ec4&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/lib/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppRefresh.vue?vue&type=style&index=0&id=69bb8ec4&lang=scss&scoped=true&\"","import mod from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/lib/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppRecordinglogic.vue?vue&type=style&index=0&id=a98b1596&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/lib/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppRecordinglogic.vue?vue&type=style&index=0&id=a98b1596&lang=scss&scoped=true&\"","import mod from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/lib/index.js??ref--6-oneOf-1-2!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppBase.vue?vue&type=style&index=0&id=3f6dadb2&scoped=true&lang=css&\"; export default mod; export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/lib/index.js??ref--6-oneOf-1-2!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppBase.vue?vue&type=style&index=0&id=3f6dadb2&scoped=true&lang=css&\"","import mod from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/lib/index.js??ref--6-oneOf-1-2!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppRecordintent.vue?vue&type=style&index=0&id=ddfa84b8&scoped=true&lang=css&\"; export default mod; export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/lib/index.js??ref--6-oneOf-1-2!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppRecordintent.vue?vue&type=style&index=0&id=ddfa84b8&scoped=true&lang=css&\""],"sourceRoot":""}
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "three-vue-pattern",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve --open",
7 | "build": "vue-cli-service build"
8 | },
9 | "dependencies": {
10 | "axios": "^0.18.0",
11 | "sine-waves": "^0.3.0",
12 | "three": "^0.90.0",
13 | "vue": "^2.5.13",
14 | "vuex": "^3.0.1"
15 | },
16 | "devDependencies": {
17 | "@vue/cli-plugin-babel": "^3.0.0-beta.6",
18 | "@vue/cli-service": "^3.0.0-beta.6",
19 | "node-sass": "^4.7.2",
20 | "sass-loader": "^6.0.6",
21 | "vue-template-compiler": "^2.5.13"
22 | },
23 | "browserslist": ["> 1%", "last 2 versions", "not ie <= 8"]
24 | }
25 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sdras/three-vue-pattern/cf00595d6fc3901c81d142e20474599b811870ed/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | three-vue-kaleidoscope
11 |
12 |
13 |
14 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
20 |
25 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
56 |
57 |
74 |
--------------------------------------------------------------------------------
/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sdras/three-vue-pattern/cf00595d6fc3901c81d142e20474599b811870ed/src/assets/logo.png
--------------------------------------------------------------------------------
/src/components/AppBase.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
345 |
346 |
--------------------------------------------------------------------------------
/src/components/AppButtonrecord.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
29 |
30 |
--------------------------------------------------------------------------------
/src/components/AppControls.vue:
--------------------------------------------------------------------------------
1 |
2 |
34 |
35 |
36 |
77 |
78 |
--------------------------------------------------------------------------------
/src/components/AppEmotionstatus.vue:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
23 |
24 |
--------------------------------------------------------------------------------
/src/components/AppRecordinglogic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
49 |
50 |
--------------------------------------------------------------------------------
/src/components/AppRecordintensity.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Feeling {{ emotion }}
5 | Change the intensity!
6 | Some options... more, less
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
31 |
32 |
--------------------------------------------------------------------------------
/src/components/AppRecordintent.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | How do you feel?
4 | Some options...
5 | excited, nervous, frustrated, happy, calm, tipsy
6 | Hit the button and start recording
7 |
8 |
9 |
10 |
11 |
27 |
28 |
--------------------------------------------------------------------------------
/src/components/AppRefresh.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
16 |
17 |
--------------------------------------------------------------------------------
/src/components/AppSineloader.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
81 |
82 |
87 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 | import store from './store'
4 |
5 | Vue.config.productionTip = false
6 |
7 | new Vue({
8 | store,
9 | render: h => h(App)
10 | }).$mount('#app')
11 |
--------------------------------------------------------------------------------
/src/store.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Vuex from 'vuex'
3 | import axios from 'axios'
4 |
5 | Vue.use(Vuex)
6 |
7 | const SpeechRecognition =
8 | window.SpeechRecognition || window.webkitSpeechRecognition
9 | const SpeechGrammarList =
10 | window.SpeechGrammarList || window.webkitSpeechGrammarList
11 | const SpeechRecognitionEvent =
12 | window.SpeechRecognitionEvent || window.webkitSpeechRecognitionEvent
13 |
14 | if (!SpeechRecognition) {
15 | // uh shit browser doesn't support speech, do things here
16 | }
17 |
18 | const recognition = new SpeechRecognition()
19 |
20 | recognition.lang = 'en-US'
21 | recognition.interimResults = false
22 | recognition.maxAlternatives = 1
23 |
24 | export default new Vuex.Store({
25 | state: {
26 | counter: 0,
27 | intent: 'None',
28 | intensity: 'None',
29 | score: 0,
30 | // idle - awaiting user input
31 | // listening - listening to user input
32 | // fetching - fetching user data from the API
33 | uiState: 'idle',
34 | zoom: 3
35 | },
36 | getters: {
37 | intentStr: state => {
38 | var str = state.intent
39 | str = str.replace(/\b(App.)\b/gi, '')
40 | return str
41 | },
42 | intensityStr: state => {
43 | var str = state.intensity
44 | str = str.replace(/\b(Intensity.)\b/gi, '')
45 | return str
46 | }
47 | },
48 | mutations: {
49 | newIntent: (state, { intent, score }) => {
50 | if (intent.includes('Intensity')) {
51 | state.intensity = intent
52 | if (intent.includes('More')) {
53 | state.counter++
54 | } else if (intent.includes('Less')) {
55 | state.counter--
56 | }
57 | } else {
58 | state.intent = intent
59 | }
60 | state.score = score
61 | },
62 | setUiState: (state, status) => {
63 | state.uiState = status
64 | },
65 | setIntent: (state, status) => {
66 | state.intent = status
67 | },
68 | abortRecording: state => {
69 | recognition.abort()
70 | state.uiState = 'idle'
71 | },
72 | setZoom: state => {
73 | var expr = state.intent
74 | switch (expr) {
75 | case 'App.Excited':
76 | state.zoom = 2 + state.counter
77 | break
78 | case 'App.Nervous':
79 | state.zoom = 2 + state.counter
80 | break
81 | case 'App.Happy':
82 | state.zoom = 2 + state.counter
83 | break
84 | case 'App.Tipsy':
85 | state.zoom = 1 + state.counter
86 | break
87 | default:
88 | state.zoom = 3 + state.counter
89 | }
90 | }
91 | },
92 | actions: {
93 | getSpeech({ dispatch, commit, state }) {
94 | commit('setUiState', 'listening')
95 |
96 | //keep recording speech all the time or activate it- for the first screen no, press a button. second screen yes.
97 | state.intent === 'None'
98 | ? (recognition.continuous = true)
99 | : (recognition.continuous = false)
100 |
101 | recognition.start()
102 |
103 | recognition.onresult = function(event) {
104 | const last = event.results.length - 1
105 | const phrase = event.results[last][0].transcript
106 | dispatch('getUnderstanding', phrase)
107 | }
108 | },
109 |
110 | getUnderstanding({ commit }, utterance) {
111 | commit('setUiState', 'fetching')
112 | const url = `https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/4aba2274-c5df-4b0d-8ff7-57658254d042`
113 |
114 | https: axios({
115 | method: 'get',
116 | url,
117 | params: {
118 | verbose: true,
119 | timezoneOffset: 0,
120 | q: utterance
121 | },
122 | headers: {
123 | 'Content-Type': 'application/json',
124 | 'Ocp-Apim-Subscription-Key': '6c85f08d11e84b59b655b8a919b9e286'
125 | }
126 | })
127 | .then(({ data }) => {
128 | console.log('axios result', data)
129 | if (altMaps.hasOwnProperty(data.query)) {
130 | commit('newIntent', {
131 | intent: altMaps[data.query],
132 | score: 1
133 | })
134 | } else {
135 | commit('newIntent', data.topScoringIntent)
136 | }
137 | commit('setUiState', 'idle')
138 | commit('setZoom')
139 | })
140 | .catch(err => {
141 | console.error('axios error', err)
142 | })
143 | }
144 | }
145 | })
146 |
147 | // if it keeps thinking you're saying something else, add here:
148 | // we don't want to do it in Luis if the meaning is much different
149 | // because it will learn the wrong thing.
150 | const altMaps = {
151 | gypsy: 'App.Tipsy',
152 | call: 'App.Calm',
153 | Les: 'Intensity.Less',
154 | bus: 'Intensity.Less',
155 | Bus: 'Intensity.Less',
156 | plus: 'Intensity.Less',
157 | Plus: 'Intensity.Less',
158 | last: 'Intensity.Less',
159 | Last: 'Intensity.Less',
160 | Rush: 'Intensity.Less',
161 | bless: 'Intensity.Less',
162 | Bless: 'Intensity.Less',
163 | Bess: 'Intensity.Less',
164 | bess: 'Intensity.Less',
165 | best: 'Intensity.Less',
166 | birth: 'Intensity.Less',
167 | love: 'Intensity.Less',
168 | plus: 'Intensity.Less',
169 | glad: 'Intensity.Less',
170 | louis: 'Intensity.Less',
171 | glass: 'Intensity.Less',
172 | let: 'Intensity.Less',
173 | lek: 'Intensity.Less',
174 | lek: 'Intensity.Less',
175 | west: 'Intensity.Less',
176 | West: 'Intensity.Less',
177 | ad: 'Intensity.More',
178 | mall: 'Intensity.More',
179 | mirrors: 'App.Nervous',
180 | hobby: 'App.Happy',
181 | heavy: 'App.Happy',
182 | faded: 'App.Excited',
183 | phelan: 'App.Excited',
184 | home: 'App.Calm',
185 | call: 'App.Calm',
186 | hull: 'App.Calm',
187 | paris: 'App.Nervous',
188 | Paris: 'App.Nervous',
189 | nurse: 'App.Nervous',
190 | tipton: 'App.Tipsy'
191 | }
192 |
--------------------------------------------------------------------------------