remote-calibrator 0.3.0 → 0.5.0-beta.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +29 -19
  3. package/homepage/example.js +9 -3
  4. package/i18n/fetch-languages-sheets.js +5 -4
  5. package/lib/RemoteCalibrator.min.js +1 -1
  6. package/lib/RemoteCalibrator.min.js.LICENSE.txt +1 -1
  7. package/lib/RemoteCalibrator.min.js.map +1 -1
  8. package/package.json +15 -15
  9. package/src/WebGazer4RC/.gitattributes +10 -0
  10. package/src/WebGazer4RC/LICENSE.md +15 -0
  11. package/src/WebGazer4RC/README.md +142 -0
  12. package/src/WebGazer4RC/gnu-lgpl-v3.0.md +163 -0
  13. package/src/WebGazer4RC/gplv3.md +636 -0
  14. package/src/WebGazer4RC/package-lock.json +1133 -0
  15. package/src/WebGazer4RC/package.json +28 -0
  16. package/src/WebGazer4RC/src/dom_util.mjs +27 -0
  17. package/src/WebGazer4RC/src/facemesh.mjs +150 -0
  18. package/src/WebGazer4RC/src/index.mjs +1235 -0
  19. package/src/WebGazer4RC/src/mat.mjs +301 -0
  20. package/src/WebGazer4RC/src/params.mjs +29 -0
  21. package/src/WebGazer4RC/src/pupil.mjs +109 -0
  22. package/src/WebGazer4RC/src/ridgeReg.mjs +104 -0
  23. package/src/WebGazer4RC/src/ridgeRegThreaded.mjs +161 -0
  24. package/src/WebGazer4RC/src/ridgeWeightedReg.mjs +125 -0
  25. package/src/WebGazer4RC/src/ridgeWorker.mjs +135 -0
  26. package/src/WebGazer4RC/src/util.mjs +348 -0
  27. package/src/WebGazer4RC/src/util_regression.mjs +240 -0
  28. package/src/WebGazer4RC/src/worker_scripts/mat.js +306 -0
  29. package/src/WebGazer4RC/src/worker_scripts/util.js +398 -0
  30. package/src/WebGazer4RC/test/regression_test.js +182 -0
  31. package/src/WebGazer4RC/test/run_tests_and_server.sh +24 -0
  32. package/src/WebGazer4RC/test/util_test.js +60 -0
  33. package/src/WebGazer4RC/test/webgazerExtract_test.js +40 -0
  34. package/src/WebGazer4RC/test/webgazer_test.js +160 -0
  35. package/src/WebGazer4RC/test/www_page_test.js +41 -0
  36. package/src/const.js +3 -0
  37. package/src/core.js +8 -0
  38. package/src/css/distance.scss +40 -0
  39. package/src/css/panel.scss +32 -1
  40. package/src/distance/distance.js +4 -4
  41. package/src/distance/distanceCheck.js +115 -0
  42. package/src/distance/distanceTrack.js +99 -41
  43. package/src/{interpupillaryDistance.js → distance/interPupillaryDistance.js} +14 -12
  44. package/src/gaze/gazeTracker.js +16 -1
  45. package/src/i18n.js +1 -1
  46. package/src/index.js +2 -1
  47. package/src/panel.js +32 -3
  48. package/webpack.config.js +4 -4
package/src/index.js CHANGED
@@ -6,7 +6,8 @@ import './screenSize'
6
6
 
7
7
  import './distance/distance'
8
8
  import './distance/distanceTrack'
9
- import './interpupillaryDistance'
9
+ import './distance/distanceCheck'
10
+ import './distance/interPupillaryDistance'
10
11
 
11
12
  import './gaze/gaze'
12
13
  import './gaze/gazeCalibration'
package/src/panel.js CHANGED
@@ -97,6 +97,8 @@ RemoteCalibrator.prototype.panel = async function (
97
97
  nextDescription: phrases.RC_panelIntroNext[this.L],
98
98
  nextButton: phrases.RC_panelButton[this.L],
99
99
  color: '#3490de',
100
+ debug: false,
101
+ i18n: true,
100
102
  _demoActivateAll: false, // ! Private
101
103
  },
102
104
  options
@@ -126,7 +128,10 @@ RemoteCalibrator.prototype.panel = async function (
126
128
  if (this.LD === this._CONST.RTL) panel.className += ' rc-lang-rtl'
127
129
  else panel.className += ' rc-lang-ltr'
128
130
 
129
- panel.innerHTML = `<h1 class="rc-panel-title" id="rc-panel-title">${options.headline}</h1>`
131
+ if (options.i18n) {
132
+ panel.innerHTML += `<div class="rc-panel-language-parent" id="rc-panel-language-parent"></div>`
133
+ }
134
+ panel.innerHTML += `<h1 class="rc-panel-title" id="rc-panel-title">${options.headline}</h1>`
130
135
  panel.innerHTML += `<p class="rc-panel-description" id="rc-panel-description">${options.description}</p>`
131
136
  panel.innerHTML += '<div class="rc-panel-steps" id="rc-panel-steps"></div>'
132
137
 
@@ -184,6 +189,13 @@ RemoteCalibrator.prototype.panel = async function (
184
189
  this._panelStatus.hasPanel = true
185
190
  this._panelStatus.panelFinished = false
186
191
 
192
+ if (options.i18n)
193
+ _setLanguagePicker(
194
+ this,
195
+ document.querySelector('#rc-panel-language-parent'),
196
+ darkerColor
197
+ )
198
+
187
199
  if (resolveOnFinish === null) resolveOnFinish = true
188
200
 
189
201
  return new Promise(resolve => {
@@ -217,8 +229,8 @@ const _validTaskList = {
217
229
  },
218
230
  trackDistance: {
219
231
  use: 2,
220
- name: phrases.RC_headTracking['en-US'],
221
- phraseHandle: 'RC_headTracking',
232
+ name: phrases.RC_distanceTracking['en-US'],
233
+ phraseHandle: 'RC_distanceTracking',
222
234
  },
223
235
  trackGaze: {
224
236
  use: 2,
@@ -465,3 +477,20 @@ const _clearPanelIntervals = RC => {
465
477
  RC._panelStatus.panelResolveIntervals.forEach(i => clearInterval(i))
466
478
  RC._panelStatus.panelResolveIntervals = []
467
479
  }
480
+
481
+ const _setLanguagePicker = (RC, parent, darkerColor) => {
482
+ let langInner = `<select name="rc-lang" id="rc-panel-lang-picker" style="color: ${darkerColor} !important">`
483
+ for (let lang of RC.supportedLanguages)
484
+ if (RC.L === lang.language)
485
+ langInner += `<option value="${lang.language}" selected>${lang.languageNameNative}</option>`
486
+ for (let lang of RC.supportedLanguages)
487
+ if (RC.L !== lang.language)
488
+ langInner += `<option value="${lang.language}">${lang.languageNameNative}</option>`
489
+ langInner += '</select>'
490
+ parent.innerHTML = langInner
491
+
492
+ document.querySelector('#rc-panel-lang-picker').onchange = () => {
493
+ RC.newLanguage(document.querySelector('#rc-panel-lang-picker').value)
494
+ RC.resetPanel()
495
+ }
496
+ }
package/webpack.config.js CHANGED
@@ -139,10 +139,10 @@ module.exports = env => {
139
139
  new webpack.BannerPlugin(licenseText)
140
140
  )
141
141
 
142
- const libConfigExample = Object.assign({}, libConfig, {
143
- output: exampleConfig.output,
144
- })
142
+ // const libConfigExample = Object.assign({}, libConfig, {
143
+ // output: exampleConfig.output,
144
+ // })
145
145
 
146
- return [libConfig, libConfigExample]
146
+ return libConfig
147
147
  }
148
148
  }