diff --git a/public/css/styles.css b/public/css/styles.css index 87dd3ee..8fcc6d4 100644 --- a/public/css/styles.css +++ b/public/css/styles.css @@ -1,6 +1,6 @@ /* ------------------------------ */ /* Wavelovers styles */ -/* version: dated 2022.07.25 */ +/* version: dated 2022.08.07 */ /* author: Eugene Serb */ /* ------------------------------ */ @@ -205,7 +205,7 @@ fieldset { padding: 8px; } -button, input, textarea, select { +button, textarea, select, input { padding: 4px 8px; border: 2px solid var(--color-link); border-radius: var(--number-border-radius); @@ -215,7 +215,6 @@ button, input, textarea, select { line-height: 1.382em; white-space: nowrap; } - button:hover, input:hover, textarea:hover, select:hover { border: 2px solid var(--color-link-hover); @@ -234,6 +233,114 @@ option { color: var(--color-white); } +input[type=range] { + width: 100%; + margin: 8px 0; + padding: 0; + border: 0px solid var(--color-link); + -webkit-appearance: none; +} + + input[type=range]:hover { + margin: 8px 0; + padding: 0; + border: 0px solid var(--color-link-hover); + } + + input[type=range]:focus { + outline: none; + } + + input[type=range]::-webkit-slider-runnable-track { + width: 100%; + height: 8px; + cursor: pointer; + box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d; + background: var(--color-b); + border-radius: 8px; + border: 0px solid #000101; + } + + input[type=range]::-webkit-slider-thumb { + box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d; + border: 0px solid #000000; + height: 16px; + width: 16px; + border-radius: 8px; + background: var(--color-a); + cursor: pointer; + -webkit-appearance: none; + margin-top: -4px; + } + + input[type=range]:focus::-webkit-slider-runnable-track { + background: var(--color-b); + } + + input[type=range]::-moz-range-track { + width: 100%; + height: 8px; + cursor: pointer; + animate: 0.2s; + box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d; + background: var(--color-b); + border-radius: 8px; + border: 0px solid #000101; + } + + input[type=range]::-moz-range-thumb { + box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d; + border: 0px solid #000000; + height: 16px; + width: 16px; + border-radius: 8px; + background: var(--color-a); + cursor: pointer; + } + + input[type=range]::-ms-track { + width: 100%; + height: 8px; + cursor: pointer; + animate: 0.2s; + background: transparent; + border-color: transparent; + border-width: 8px 0; + color: transparent; + } + + input[type=range]::-ms-fill-lower { + background: var(--color-b); + border: 0px solid #000101; + border-radius: 8px; + box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d; + } + + input[type=range]::-ms-fill-upper { + background: var(--color-b); + border: 0px solid #000101; + border-radius: 8px; + box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d; + } + + input[type=range]::-ms-thumb { + box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d; + border: 0px solid #000000; + height: 16px; + width: 16px; + border-radius: 8px; + background: var(--color-a); + cursor: pointer; + } + + input[type=range]:focus::-ms-fill-lower { + background: var(--color-b); + } + + input[type=range]:focus::-ms-fill-upper { + background: var(--color-b); + } + /* ------ */ /* TABLES */ /* ------ */ diff --git a/src/App.vue b/src/App.vue index c0cca97..471fcd8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,12 +1,53 @@ - + + + + + Press any gamepad button or connect a new gamepad to vibrate. + + + diff --git a/src/components/AppManual.vue b/src/components/AppManual.vue new file mode 100644 index 0000000..0cec669 --- /dev/null +++ b/src/components/AppManual.vue @@ -0,0 +1,84 @@ + + + + + Start Delay (ms) + + + + Duration (ms) + + + + Weak Magnitude + + + + Strong Magnitude + + + Start + Stop + + + + + + + + diff --git a/src/components/AppPatterns.vue b/src/components/AppPatterns.vue new file mode 100644 index 0000000..908b22e --- /dev/null +++ b/src/components/AppPatterns.vue @@ -0,0 +1,46 @@ + + + + Loading... + + + + + diff --git a/src/components/NavigationList.vue b/src/components/NavigationList.vue new file mode 100644 index 0000000..4ec1feb --- /dev/null +++ b/src/components/NavigationList.vue @@ -0,0 +1,32 @@ + + + Manual + Patterns + + + + + + + diff --git a/src/components/PatternItem.vue b/src/components/PatternItem.vue index 311ad5f..ef3a749 100644 --- a/src/components/PatternItem.vue +++ b/src/components/PatternItem.vue @@ -52,7 +52,7 @@ align-items: center; text-align: center; overflow: hidden; - cursor: default; + cursor: pointer; } @media only screen and (min-width: 540px) { diff --git a/src/components/WaveloversApp.vue b/src/components/WaveloversApp.vue deleted file mode 100644 index 1f079b8..0000000 --- a/src/components/WaveloversApp.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - - Loading... - - Press any gamepad button or connect a new gamepad to vibrate. - - - - - - - diff --git a/src/router/index.ts b/src/router/index.ts index 0f30dc4..547ed7a 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,11 +1,17 @@ import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'; -import HomeView from '@/views/HomeView.vue'; +import PatternsView from '@/views/PatternsView.vue'; +import ManualView from '@/views/ManualView.vue'; const routes: Array = [ { path: '/', - name: 'home', - component: HomeView, + name: 'patterns-view', + component: PatternsView, + }, + { + path: '/manual', + name: 'manual-view', + component: ManualView, }, ]; diff --git a/src/store/index.ts b/src/store/index.ts index 78239b5..5b487ed 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -2,6 +2,7 @@ import { createStore, Store } from 'vuex'; import IRootState from './models/IRootState'; import MGamepads from '@/store/modules/MGamepads'; import MPatterns from '@/store/modules/MPatterns'; +import TPatternUnit from '../models/TPatternUnit'; const store: Store = createStore({ state: () => ({ @@ -46,11 +47,20 @@ const store: Store = createStore({ } if (context.getters.isActive === true) { context.dispatch('reset'); - context.dispatch('vibrate'); + context.dispatch( + 'vibrate', + context.getters.patterns[context.getters.mode].pattern + ); } else { context.dispatch('reset'); } }, + startCustom: function (context, pattern: TPatternUnit[]): void { + context.dispatch('setIsActive', false); + context.dispatch('setMode', 0); + context.dispatch('reset'); + context.dispatch('vibrate', pattern); + }, }, modules: { MGamepads: MGamepads, diff --git a/src/store/modules/MGamepads.ts b/src/store/modules/MGamepads.ts index 4732627..f0a3780 100644 --- a/src/store/modules/MGamepads.ts +++ b/src/store/modules/MGamepads.ts @@ -46,10 +46,11 @@ const MGamepads: Module = { }); }, vibrate: function ( - context: ActionContext + context: ActionContext, + pattern: TPatternUnit[] ): void { context.getters.gamepads.forEach((gamepad: Vibrator) => { - gamepad.vibrate(context.getters.patterns[context.getters.mode].pattern as TPatternUnit[]); + gamepad.vibrate(pattern); }); }, reset: function ( diff --git a/src/views/HomeView.vue b/src/views/ManualView.vue similarity index 53% rename from src/views/HomeView.vue rename to src/views/ManualView.vue index cde62a2..e49503d 100644 --- a/src/views/HomeView.vue +++ b/src/views/ManualView.vue @@ -1,15 +1,15 @@ - + diff --git a/src/views/PatternsView.vue b/src/views/PatternsView.vue new file mode 100644 index 0000000..d25f36d --- /dev/null +++ b/src/views/PatternsView.vue @@ -0,0 +1,16 @@ + + + + + +