From e30da21dc4c431cf8257e1e8bc4b108667334137 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Sat, 18 Jun 2022 12:08:13 +0300 Subject: [PATCH 01/46] Fixed max patterns. fixed disabling devices, fixed start on device without vibrating actuator, --- js/scripts.js | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/js/scripts.js b/js/scripts.js index 9c50b98..2a7228f 100644 --- a/js/scripts.js +++ b/js/scripts.js @@ -38,7 +38,7 @@ const __PATTERNS = [ icon: '🙃', pattern: [ { - startDelay: 0, + startDelay: 100, duration: 100, weakMagnitude: 1.0, strongMagnitude: 1.0, @@ -78,7 +78,7 @@ const __PATTERNS = [ icon: '😊', pattern: [ { - startDelay: 0, + startDelay: 100, duration: 250, weakMagnitude: 1.0, strongMagnitude: 1.0, @@ -118,7 +118,7 @@ const __PATTERNS = [ icon: '🤪', pattern: [ { - startDelay: 0, + startDelay: 100, duration: 500, weakMagnitude: 1.0, strongMagnitude: 1.0, @@ -384,15 +384,17 @@ class VibrationMaster { change = (index) => { if (this.gamepads.length > 0) { this.gamepads.forEach(gamepad => { - this.unselect(); - if (gamepad.index === index && - gamepad.isVibrating === true) { - gamepad.isVibrating = false; - gamepad.reset(); - } else { - gamepad.change(index); - gamepad.vibrate(); - this.select(index); + if (gamepad.canVibrate === true) { + this.unselect(); + if (gamepad.index === index && + gamepad.isVibrating === true) { + gamepad.reset(); + } else { + gamepad.reset() + gamepad.change(index); + gamepad.vibrate(); + this.select(index); + }; }; }); } else { @@ -436,6 +438,7 @@ class VibrationMaster { this.gamepads.splice(index, 1); }; }); + this.unselect(); }); }; }; From 15de6a9a1274dd9fa6f7f252be332a10f2ba01e3 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Sat, 18 Jun 2022 14:22:08 +0300 Subject: [PATCH 02/46] Added styles for tables, deleted navigation from header, deleted controls buttons --- css/styles.css | 93 ++++++++++++++++++++++---------------------------- index.html | 16 --------- 2 files changed, 40 insertions(+), 69 deletions(-) diff --git a/css/styles.css b/css/styles.css index 8a1b61f..c577e15 100644 --- a/css/styles.css +++ b/css/styles.css @@ -37,9 +37,9 @@ --color-link-hover: var(--color-a); --color-border: var(--color-a); --color-selection: var(--color-b); - --color-table-header-background: transparent; - --color-table-header-text: transparent; - --color-table-item: transparent; + --color-table-header-background: var(--color-b); + --color-table-header-text: var(--color-white); + --color-table-item: var(--color-c); --color-anotation: var(--color-coal); --color-pattern-button: var(--color-c); --color-pattern-text: var(--color-white); @@ -57,9 +57,9 @@ --color-link-hover: var(--color-a); --color-border: var(--color-a); --color-selection: var(--color-b); - --color-table-header-background: transparent; - --color-table-header-text: transparent; - --color-table-item: transparent; + --color-table-header-background: var(--color-b); + --color-table-header-text: var(--color-white); + --color-table-item: var(--color-c); --color-anotation: var(--color-milk); --color-pattern-button: var(--color-milk); --color-pattern-text: var(--color-black); @@ -179,6 +179,40 @@ legend { text-align: left; } +/* ------ */ +/* TABLES */ +/* ------ */ + +table, th, td { + width: 100%; + padding: 8px; + border-collapse: collapse; + table-layout: fixed; + font-weight: 400; +} + +.table_pink thead { + border-bottom: 4px solid var(--color-table-item); +} + + .table_pink thead > tr { + background-color: var(--color-table-header-background); + color: var(--color-table-header-text); + } + + .table_pink thead > tr > th { + font-weight: 500; + } + +.table_pink tbody > tr:nth-child(even) { + background-color: var(--color-table-item); + color: var(--color-white); +} + +.table_pink tfoot { + border-top: 4px solid var(--color-table-header-background); +} + /* ------------- */ /* SERVICE RULES */ /* ------------- */ @@ -469,50 +503,3 @@ legend { color: var(--color-white); } -.controls-box { - display: flex; - flex-direction: row; - justify-content: space-around; - flex-wrap: wrap; - gap: 32px; -} - - .controls-box__item { - display: flex; - flex-direction: column; - text-align: center; - gap: 8px; - } - - .controls-box__item > span { - font-size: 24px; - } - -.gamepad-button-container { - display: flex; - flex-direction: row; - justify-content: center; - align-items: center; - gap: 8px; -} - - .gamepad-button { - width: 4ch; - height: 4ch; - border: 1px solid black; - border-radius: 100%; - display: flex; - justify-content: center; - align-items: center; - background: grey; - color: white; - text-align: center; - } - - .gamepad-button > span { color: var(--color-white); } - - .gamepad-button_a { background: green; } - .gamepad-button_b { background: red; } - .gamepad-button_x { background: blue; } - .gamepad-button_y { background: orange; } - diff --git a/index.html b/index.html index f4ec557..f04a7c8 100644 --- a/index.html +++ b/index.html @@ -77,22 +77,6 @@
- From b121a525974c95677e3f7922a596d4d44ccb009e Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Sat, 18 Jun 2022 20:11:34 +0300 Subject: [PATCH 03/46] Added navigation and feedback page --- feedback.html | 132 ++++++++++++++++++++++++++++++++++++++++++++++++++ index.html | 15 +++++- 2 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 feedback.html diff --git a/feedback.html b/feedback.html new file mode 100644 index 0000000..eda7528 --- /dev/null +++ b/feedback.html @@ -0,0 +1,132 @@ + + + + Wavelovers – Feedback + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+
+ +
+

Wavelovers – Feedback

+
+
+

Feedback

+

Hi, friend! I am the author and developer of Wavelovers app and I want to thank you for using this app.

+
+ Follow me on Twitter: + @eugene_serb +
+

Donate

+

If you like this app, you can thank me and donate to me.

+
+ Bitcoin: + BC1QSPZGJ7XRF099S2EJ8F5ZMM52XU0WKFURPEZNY5 +

+
+
+
+ + + + + + + + diff --git a/index.html b/index.html index f04a7c8..f73e10d 100644 --- a/index.html +++ b/index.html @@ -21,7 +21,7 @@ - + @@ -77,6 +77,19 @@
+ From 2812290a9abad5113fbf98c19e9f8475d64ea556 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Sat, 18 Jun 2022 20:15:20 +0300 Subject: [PATCH 04/46] Fixed link to feeback.html --- feedback.html | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/feedback.html b/feedback.html index eda7528..8ed30c1 100644 --- a/feedback.html +++ b/feedback.html @@ -86,7 +86,7 @@ Tester diff --git a/index.html b/index.html index f73e10d..d623a82 100644 --- a/index.html +++ b/index.html @@ -86,7 +86,7 @@ Tester From b1237d5bfd9664a3ce74ee32dab19eec256aa2f2 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Sat, 18 Jun 2022 20:16:39 +0300 Subject: [PATCH 05/46] Updated feedback --- feedback.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feedback.html b/feedback.html index 8ed30c1..c0e7b9d 100644 --- a/feedback.html +++ b/feedback.html @@ -98,7 +98,7 @@

Feedback

-

Hi, friend! I am the author and developer of Wavelovers app and I want to thank you for using this app.

+

Hi, friend! I am the author and developer of Wavelovers app and I want to thank you for using this app. If you have any ideas or wishes, you can write to me.


Follow me on Twitter: @eugene_serb From 5874decda281f15ede3e4ebd6a839939aedec4fc Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Sat, 18 Jun 2022 20:36:35 +0300 Subject: [PATCH 06/46] Added json --- js/scripts.js | 6 ++ json/patterns.json | 159 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 165 insertions(+) create mode 100644 json/patterns.json diff --git a/js/scripts.js b/js/scripts.js index 2a7228f..d872d56 100644 --- a/js/scripts.js +++ b/js/scripts.js @@ -292,6 +292,8 @@ class VibrationMaster { this.patterns = __PATTERNS; this.print(this.patterns); + this.load(); + if (!this.checkGamepadSupport()) { console.log(`This browser does not support of gamepads.`); this.$MESSAGE.innerText = `This browser does not support of gamepads.`; @@ -358,6 +360,10 @@ class VibrationMaster { }; }; + load = () => { + const response = fetch('./json/patterns.json'); + console.log(response); + }; print = (patterns) => { this.$PATTERN_LIST.innerHTML = ''; patterns.forEach((pattern, index) => { diff --git a/json/patterns.json b/json/patterns.json new file mode 100644 index 0000000..f906202 --- /dev/null +++ b/json/patterns.json @@ -0,0 +1,159 @@ +[ + { + "name": "Dotted Weak", + "type": "Simple", + "icon": "😌", + "pattern": [ + { + "startDelay": 100, + "duration": 100, + "weakMagnitude": 1.0, + "strongMagnitude": 0.0 + } + ] + }, + { + "name": "Dotted Strong", + "type": "Simple", + "icon": "😉", + "pattern": [ + { + "startDelay": 100, + "duration": 100, + "weakMagnitude": 0.0, + "strongMagnitude": 1.0 + } + ] + }, + { + "name": "Dotted Max", + "type": "Simple", + "icon": "🙃", + "pattern": [ + { + "startDelay": 100, + "duration": 100, + "weakMagnitude": 1.0, + "strongMagnitude": 1.0 + } + ] + }, + { + "name": "Short Dashed Weak", + "type": "Simple", + "icon": "🙂", + "pattern": [ + { + "startDelay": 100, + "duration": 250, + "weakMagnitude": 1.0, + "strongMagnitude": 0.0 + } + ] + }, + { + "name": "Short Dashed Strong", + "type": "Simple", + "icon": "😇", + "pattern": [ + { + "startDelay": 100, + "duration": 250, + "weakMagnitude": 0.0, + "strongMagnitude": 1.0 + } + ] + }, + { + "name": "Short Dashed Max", + "type": "Simple", + "icon": "😊", + "pattern": [ + { + "startDelay": 100, + "duration": 250, + "weakMagnitude": 1.0, + "strongMagnitude": 1.0 + } + ] + }, + { + "name": "Long Dashed Weak", + "type": "Simple", + "icon": "😋", + "pattern": [ + { + "startDelay": 100, + "duration": 500, + "weakMagnitude": 1.0, + "strongMagnitude": 0.0 + } + ] + }, + { + "name": "Long Dashed Strong", + "type": "Simple", + "icon": "😜", + "pattern": [ + { + "startDelay": 100, + "duration": 500, + "weakMagnitude": 0.0, + "strongMagnitude": 1.0 + } + ] + }, + { + "name": "Long Dashed Max", + "type": "Simple", + "icon": "🤪", + "pattern": [ + { + "startDelay": 100, + "duration": 500, + "weakMagnitude": 1.0, + "strongMagnitude": 1.0 + } + ] + }, + { + "name": "Constant Weak", + "type": "Simple", + "icon": "😏", + "pattern": [ + { + "startDelay": 0, + "duration": 1000, + "weakMagnitude": 1.0, + "strongMagnitude": 0.0 + } + ] + }, + { + "name": "Constant Strong", + "type": "Simple", + "icon": "🤩", + "pattern": [ + { + "startDelay": 0, + "duration": 1000, + "weakMagnitude": 0.0, + "strongMagnitude": 1.0 + } + ] + }, + { + "name": "Constant Max", + "type": "Simple", + "icon": "😍", + "pattern": [ + { + "startDelay": 0, + "duration": 1000, + "weakMagnitude": 1.0, + "strongMagnitude": 1.0 + } + ] + } +] + From fe8895f07c94653d7a2b37e19f0c2e893332eb94 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Sat, 18 Jun 2022 21:24:30 +0300 Subject: [PATCH 07/46] Updated load function --- css/styles.css | 3 + index.html | 6 +- js/scripts.js | 202 +++++++++++-------------------------------------- 3 files changed, 52 insertions(+), 159 deletions(-) diff --git a/css/styles.css b/css/styles.css index c577e15..8de64e2 100644 --- a/css/styles.css +++ b/css/styles.css @@ -419,6 +419,9 @@ table, th, td { } .message { + width: 100%; + display: flex; + justify-content: center; text-align: center; font-size: 24px; } diff --git a/index.html b/index.html index d623a82..963f87c 100644 --- a/index.html +++ b/index.html @@ -97,7 +97,11 @@

Wavelovers

-
+
+
+ Loading... +
+
diff --git a/js/scripts.js b/js/scripts.js index d872d56..48fc5c5 100644 --- a/js/scripts.js +++ b/js/scripts.js @@ -5,166 +5,45 @@ 'use strict'; const __PATTERNS = [ - /* Dotted, 0.1s, 0.1s */ { - name: 'Dotted Weak', - type: 'Simple', - icon: '😌', - pattern: [ + "name": "Constant Weak", + "type": "Simple", + "icon": "😏", + "pattern": [ { - startDelay: 100, - duration: 100, - weakMagnitude: 1.0, - strongMagnitude: 0.0, - }, - ], + "startDelay": 0, + "duration": 1000, + "weakMagnitude": 1.0, + "strongMagnitude": 0.0 + } + ] }, { - name: 'Dotted Strong', - type: 'Simple', - icon: '😉', - pattern: [ + "name": "Constant Strong", + "type": "Simple", + "icon": "🤩", + "pattern": [ { - startDelay: 100, - duration: 100, - weakMagnitude: 0.0, - strongMagnitude: 1.0, - }, - ], + "startDelay": 0, + "duration": 1000, + "weakMagnitude": 0.0, + "strongMagnitude": 1.0 + } + ] }, { - name: 'Dotted Max', - type: 'Simple', - icon: '🙃', - pattern: [ + "name": "Constant Max", + "type": "Simple", + "icon": "😍", + "pattern": [ { - startDelay: 100, - duration: 100, - weakMagnitude: 1.0, - strongMagnitude: 1.0, - }, - ], - }, - /* Short Dashed, 0.1s, 0.25s */ - { - name: 'Short Dashed Weak', - type: 'Simple', - icon: '🙂', - pattern: [ - { - startDelay: 100, - duration: 250, - weakMagnitude: 1.0, - strongMagnitude: 0.0, - }, - ], - }, - { - name: 'Short Dashed Strong', - type: 'Simple', - icon: '😇', - pattern: [ - { - startDelay: 100, - duration: 250, - weakMagnitude: 0.0, - strongMagnitude: 1.0, - }, - ], - }, - { - name: 'Short Dashed Max', - type: 'Simple', - icon: '😊', - pattern: [ - { - startDelay: 100, - duration: 250, - weakMagnitude: 1.0, - strongMagnitude: 1.0, - }, - ], - }, - /* Long Dashed, 0.1s, 0.5s */ - { - name: 'Long Dashed Weak', - type: 'Simple', - icon: '😋', - pattern: [ - { - startDelay: 100, - duration: 500, - weakMagnitude: 1.0, - strongMagnitude: 0.0, - }, - ], - }, - { - name: 'Long Dashed Strong', - type: 'Simple', - icon: '😜', - pattern: [ - { - startDelay: 100, - duration: 500, - weakMagnitude: 0.0, - strongMagnitude: 1.0, - }, - ], - }, - { - name: 'Long Dashed Max', - type: 'Simple', - icon: '🤪', - pattern: [ - { - startDelay: 100, - duration: 500, - weakMagnitude: 1.0, - strongMagnitude: 1.0, - }, - ], - }, - /* Constant, 0s, 1s */ - { - name: 'Constant Weak', - type: 'Simple', - icon: '😏', - pattern: [ - { - startDelay: 0, - duration: 1000, - weakMagnitude: 1.0, - strongMagnitude: 0.0, - }, - ], - }, - { - name: 'Constant Strong', - type: 'Simple', - icon: '🤩', - pattern: [ - { - startDelay: 0, - duration: 1000, - weakMagnitude: 0.0, - strongMagnitude: 1.0, - }, - ], - }, - { - name: 'Constant Max', - type: 'Simple', - icon: '😍', - pattern: [ - { - startDelay: 0, - duration: 1000, - weakMagnitude: 1.0, - strongMagnitude: 1.0, - }, - ], - }, + "startDelay": 0, + "duration": 1000, + "weakMagnitude": 1.0, + "strongMagnitude": 1.0 + } + ] + } ]; class Gamepad { @@ -289,9 +168,6 @@ class VibrationMaster { }; init = () => { this.#DOMs(); - this.patterns = __PATTERNS; - this.print(this.patterns); - this.load(); if (!this.checkGamepadSupport()) { @@ -360,9 +236,19 @@ class VibrationMaster { }; }; - load = () => { - const response = fetch('./json/patterns.json'); - console.log(response); + load = async () => { + const url = './json/patterns.json'; + + const response = await fetch(url); + + if (response.ok) { + let json = await response.json(); + this.pattern = json; + this.print(this.pattern); + } else { + this.pattern = __PATTERNS; + this.print(this.pattern); + }; }; print = (patterns) => { this.$PATTERN_LIST.innerHTML = ''; From 99031063828fab9352966cda2be16afed8363fc2 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Sat, 18 Jun 2022 23:11:09 +0300 Subject: [PATCH 08/46] Added singleton library, deleted patterns in constructors --- feedback.html | 2 +- js/scripts.js | 275 +++++++++++++++++++++++++++++++++++++------------- 2 files changed, 204 insertions(+), 73 deletions(-) diff --git a/feedback.html b/feedback.html index c0e7b9d..a191413 100644 --- a/feedback.html +++ b/feedback.html @@ -98,7 +98,7 @@

Feedback

-

Hi, friend! I am the author and developer of Wavelovers app and I want to thank you for using this app. If you have any ideas or wishes, you can write to me.

+

Hi! I am the author and developer of Wavelovers app and I want to thank you for using this app. If you have any ideas or wishes, you can write to me.


Follow me on Twitter: @eugene_serb diff --git a/js/scripts.js b/js/scripts.js index 48fc5c5..57cc9c9 100644 --- a/js/scripts.js +++ b/js/scripts.js @@ -4,53 +4,184 @@ 'use strict'; -const __PATTERNS = [ - { - "name": "Constant Weak", - "type": "Simple", - "icon": "😏", - "pattern": [ +class Library { + constructor() { + if (typeof Library.instance === 'object') { + return Library.instance; + }; + this.init(); + Library.instance = this; + return this; + }; + init = () => { + this.patterns = this.getBase(); + }; + getBase = () => { + return [ { - "startDelay": 0, - "duration": 1000, - "weakMagnitude": 1.0, - "strongMagnitude": 0.0 - } - ] - }, - { - "name": "Constant Strong", - "type": "Simple", - "icon": "🤩", - "pattern": [ + "name": "Dotted Weak", + "type": "Simple", + "icon": "😌", + "pattern": [ + { + "startDelay": 100, + "duration": 100, + "weakMagnitude": 1.0, + "strongMagnitude": 0.0 + } + ] + }, { - "startDelay": 0, - "duration": 1000, - "weakMagnitude": 0.0, - "strongMagnitude": 1.0 - } - ] - }, - { - "name": "Constant Max", - "type": "Simple", - "icon": "😍", - "pattern": [ + "name": "Dotted Strong", + "type": "Simple", + "icon": "😉", + "pattern": [ + { + "startDelay": 100, + "duration": 100, + "weakMagnitude": 0.0, + "strongMagnitude": 1.0 + } + ] + }, { - "startDelay": 0, - "duration": 1000, - "weakMagnitude": 1.0, - "strongMagnitude": 1.0 + "name": "Dotted Max", + "type": "Simple", + "icon": "🙃", + "pattern": [ + { + "startDelay": 100, + "duration": 100, + "weakMagnitude": 1.0, + "strongMagnitude": 1.0 + } + ] + }, + { + "name": "Short Dashed Weak", + "type": "Simple", + "icon": "🙂", + "pattern": [ + { + "startDelay": 100, + "duration": 250, + "weakMagnitude": 1.0, + "strongMagnitude": 0.0 + } + ] + }, + { + "name": "Short Dashed Strong", + "type": "Simple", + "icon": "😇", + "pattern": [ + { + "startDelay": 100, + "duration": 250, + "weakMagnitude": 0.0, + "strongMagnitude": 1.0 + } + ] + }, + { + "name": "Short Dashed Max", + "type": "Simple", + "icon": "😊", + "pattern": [ + { + "startDelay": 100, + "duration": 250, + "weakMagnitude": 1.0, + "strongMagnitude": 1.0 + } + ] + }, + { + "name": "Long Dashed Weak", + "type": "Simple", + "icon": "😋", + "pattern": [ + { + "startDelay": 100, + "duration": 500, + "weakMagnitude": 1.0, + "strongMagnitude": 0.0 + } + ] + }, + { + "name": "Long Dashed Strong", + "type": "Simple", + "icon": "😜", + "pattern": [ + { + "startDelay": 100, + "duration": 500, + "weakMagnitude": 0.0, + "strongMagnitude": 1.0 + } + ] + }, + { + "name": "Long Dashed Max", + "type": "Simple", + "icon": "🤪", + "pattern": [ + { + "startDelay": 100, + "duration": 500, + "weakMagnitude": 1.0, + "strongMagnitude": 1.0 + } + ] + }, + { + "name": "Constant Weak", + "type": "Simple", + "icon": "😏", + "pattern": [ + { + "startDelay": 0, + "duration": 1000, + "weakMagnitude": 1.0, + "strongMagnitude": 0.0 + } + ] + }, + { + "name": "Constant Strong", + "type": "Simple", + "icon": "🤩", + "pattern": [ + { + "startDelay": 0, + "duration": 1000, + "weakMagnitude": 0.0, + "strongMagnitude": 1.0 + } + ] + }, + { + "name": "Constant Max", + "type": "Simple", + "icon": "😍", + "pattern": [ + { + "startDelay": 0, + "duration": 1000, + "weakMagnitude": 1.0, + "strongMagnitude": 1.0 + } + ] } - ] - } -]; + ]; + }; +}; class Gamepad { - constructor(gamepad, $container, library) { + constructor(gamepad, $container) { this.unit = gamepad; this.$container = $container; - this.library = library; this.init(); }; @@ -60,16 +191,13 @@ class Gamepad { this.isSelected = false; this.isVibrating = false; this.isLocked = false; + + this.library = new Library; + this.cooldown = 0; this.index = 0; - this.pattern = [ - { - startDelay: 0, - duration: 1000, - weakMagnitude: 1.0, - strongMagnitude: 1.0, - } - ]; + this.pattern = this.library.patterns[this.index].pattern; + this.generateBox(); }; @@ -111,7 +239,7 @@ class Gamepad { }; vibrate = async () => { this.isVibrating = true; - this.pattern = this.library[this.index].pattern; + this.pattern = this.library.patterns[this.index].pattern; while (this.isVibrating) { for (let i = 0; i < this.pattern.length; i++) { @@ -130,22 +258,22 @@ class Gamepad { previous = () => { if (Date.now() >= this.cooldown) { if (this.index === 0) { - this.index = this.library.length - 1; + this.index = this.library.patterns.length - 1; } else { this.index--; }; - this.pattern = this.library[this.index].pattern; + this.pattern = this.library.patterns[this.index].pattern; this.cooldown = Date.now() + 500; }; }; next = () => { if (Date.now() >= this.cooldown) { - if (this.index === this.library.length - 1) { + if (this.index === this.library.patterns.length - 1) { this.index = 0; } else { this.index++; }; - this.pattern = this.library[this.index].pattern; + this.pattern = this.library.patterns[this.index].pattern; this.cooldown = Date.now() + 500; }; }; @@ -158,7 +286,7 @@ class Gamepad { change = (index) => { this.index = index; - this.pattern = this.library[this.index].pattern; + this.pattern = this.library.patterns[this.index].pattern; }; }; @@ -168,7 +296,9 @@ class VibrationMaster { }; init = () => { this.#DOMs(); - this.load(); + + this.library = new Library(); + this.print(this.library.patterns); if (!this.checkGamepadSupport()) { console.log(`This browser does not support of gamepads.`); @@ -237,17 +367,18 @@ class VibrationMaster { }; load = async () => { - const url = './json/patterns.json'; - - const response = await fetch(url); - - if (response.ok) { - let json = await response.json(); - this.pattern = json; - this.print(this.pattern); - } else { - this.pattern = __PATTERNS; - this.print(this.pattern); + const url = 'https://eugene-serb.github.io/wavelovers/json/patterns.json'; + try { + const response = await fetch(url); + if (response.ok) { + let json = await response.json(); + this.library.patterns = json; + this.print(this.library.patterns); + } else { + console.log('Connect to the Internet for download more patterns...'); + }; + } catch (error) { + console.log('[error]', error); }; }; print = (patterns) => { @@ -277,7 +408,7 @@ class VibrationMaster { if (this.gamepads.length > 0) { this.gamepads.forEach(gamepad => { if (gamepad.canVibrate === true) { - this.unselect(); + this.unselect(this.library.patterns); if (gamepad.index === index && gamepad.isVibrating === true) { gamepad.reset(); @@ -285,7 +416,7 @@ class VibrationMaster { gamepad.reset() gamepad.change(index); gamepad.vibrate(); - this.select(index); + this.select(this.library.patterns, index); }; }; }); @@ -295,13 +426,13 @@ class VibrationMaster { }; }; - unselect = () => { - this.patterns.forEach(pattern => { + unselect = (patterns) => { + patterns.forEach(pattern => { pattern['container'].classList.remove('pattern-item__selected'); }); }; - select = (index) => { - this.patterns[index]['container'].classList.add('pattern-item__selected'); + select = (patterns, index) => { + patterns[index]['container'].classList.add('pattern-item__selected'); }; checkGamepadSupport = () => { @@ -320,7 +451,7 @@ class VibrationMaster { if (this.gamepads.length > 1) { return; } else { - this.gamepads.push(new Gamepad(event.gamepad, this.$DEVICE_LIST, this.patterns)); + this.gamepads.push(new Gamepad(event.gamepad, this.$DEVICE_LIST)); }; }); window.addEventListener('gamepaddisconnected', (event) => { From 072e0e20a776d62adb9d1343888efa9451d78c8d Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Sun, 19 Jun 2022 11:47:45 +0300 Subject: [PATCH 09/46] Updated feedback.html. Made feedback and donate posts separated, fix link with new CSS class .link_hash that break all to new lines --- css/styles.css | 4 ++++ feedback.html | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/css/styles.css b/css/styles.css index 8de64e2..0e517d3 100644 --- a/css/styles.css +++ b/css/styles.css @@ -506,3 +506,7 @@ table, th, td { color: var(--color-white); } +.link_hash { + word-break: break-all; +} + diff --git a/feedback.html b/feedback.html index a191413..074197e 100644 --- a/feedback.html +++ b/feedback.html @@ -102,12 +102,13 @@
Follow me on Twitter: @eugene_serb -
+
+

Donate

If you like this app, you can thank me and donate to me.


Bitcoin: - BC1QSPZGJ7XRF099S2EJ8F5ZMM52XU0WKFURPEZNY5 + BC1QSPZGJ7XRF099S2EJ8F5ZMM52XU0WKFURPEZNY5

From 6a1c657c8f9a6722feb839fa04716d3b1da0906d Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Sun, 19 Jun 2022 11:50:32 +0300 Subject: [PATCH 10/46] Updated web manifest --- site.webmanifest | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/site.webmanifest b/site.webmanifest index 899dac7..7418fbd 100644 --- a/site.webmanifest +++ b/site.webmanifest @@ -1,6 +1,6 @@ { - "name": "", - "short_name": "", + "name": "Wavelovers", + "short_name": "Wavelovers", "icons": [ { "src": "https://eugene-serb.github.io/wavelovers/img/android-chrome-192x192.png", @@ -13,8 +13,8 @@ "type": "image/png" } ], - "theme_color": "#ffffff", - "background_color": "#ffffff", + "theme_color": "#EFCFE3", + "background_color": "#EFCFE3", "display": "standalone" } From 8b33325c4a8c1790ec4b7a4463265f33622f1305 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Mon, 20 Jun 2022 16:28:39 +0300 Subject: [PATCH 11/46] Create CNAME --- CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 CNAME diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..db815ff --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +wavelovers.ru \ No newline at end of file From b42d2fc9c6a6a07b608b6ecaa85f9e98ae2d0d46 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Mon, 20 Jun 2022 16:46:50 +0300 Subject: [PATCH 12/46] Added sitemaps, changed urls, feedback changed about --- feedback.html => about.html | 74 ++++++++++--------------------------- index.html | 66 ++++++++------------------------- sitemap-internal.xml | 16 ++++++++ sitemap.xml | 8 ++++ 4 files changed, 59 insertions(+), 105 deletions(-) rename feedback.html => about.html (50%) create mode 100644 sitemap-internal.xml create mode 100644 sitemap.xml diff --git a/feedback.html b/about.html similarity index 50% rename from feedback.html rename to about.html index 074197e..434c724 100644 --- a/feedback.html +++ b/about.html @@ -1,7 +1,7 @@ - Wavelovers – Feedback + Wavelovers – About @@ -9,67 +9,35 @@ - - - - - - - + + + + + + + - + - + - - - + + + - + - - - - - - - - - - - - - - +
@@ -80,13 +48,10 @@ @@ -102,6 +67,8 @@
Follow me on Twitter: @eugene_serb + Mail me: + eugene.serb@gmail.com

Donate

@@ -117,7 +84,7 @@ - diff --git a/index.html b/index.html index 963f87c..887b7ea 100644 --- a/index.html +++ b/index.html @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -29,47 +29,15 @@ - - - + + + - - - - - - - - - - - - - - +
@@ -80,13 +48,10 @@ @@ -115,7 +80,7 @@ - + - diff --git a/sitemap-internal.xml b/sitemap-internal.xml new file mode 100644 index 0000000..9851256 --- /dev/null +++ b/sitemap-internal.xml @@ -0,0 +1,16 @@ + + + + https://wavelovers.ru/ + 2022-06-20 + weekly + 1.0 + + + https://wavelovers.ru/about.html + 2022-06-20 + weekly + 1.0 + + + diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..367af56 --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,8 @@ + + + + https://wavelovers.ru/sitemap-internal.xml + 2022-06-20 + + + From 1086d0e6c1c4fdfe2b7a1746bef4c3060c9daad8 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Mon, 20 Jun 2022 17:00:38 +0300 Subject: [PATCH 13/46] Added robots.txt and analytics yandex --- about.html | 18 ++++++++++++++++++ index.html | 18 ++++++++++++++++++ robots.txt | 13 +++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 robots.txt diff --git a/about.html b/about.html index 434c724..1e56b89 100644 --- a/about.html +++ b/about.html @@ -38,6 +38,23 @@ + + + +
@@ -94,6 +111,7 @@ + diff --git a/index.html b/index.html index 887b7ea..11278c1 100644 --- a/index.html +++ b/index.html @@ -38,6 +38,23 @@ + + + +
@@ -91,6 +108,7 @@ + diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..f559157 --- /dev/null +++ b/robots.txt @@ -0,0 +1,13 @@ +# +# robots.txt at https://wavelovers.ru/ +# +# Follow me on Twitter: @eugene_serb +# Author: https://eugene-serb.github.io/ +# + +# All Bots +User-agent: * +Allow: / + +Sitemap: https://wavelovers.ru/sitemap.xml + From 2cfc967a5ef3b8ff6c495986ddb2fe8ddad548b8 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Mon, 20 Jun 2022 17:07:06 +0300 Subject: [PATCH 14/46] Added gtag.js --- about.html | 10 ++++++++++ index.html | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/about.html b/about.html index 1e56b89..a08bb43 100644 --- a/about.html +++ b/about.html @@ -39,6 +39,16 @@ + + + + + + + + + + + + + +
+
+
+ +
+ +
+
+ +
+

Wavelovers – FAQ

+
+
+

FAQ

+ What is the purpose of this software?
+ Everyone decides for himself, but can be used as a gamepad vibration tester, or as a hand massager.

+ + Can I use this software as a hand massager?
+ Yes of course. If you use this as a massager, then before the session I recommend consulting with a doctor.

+ + I have a gamepad with vibration, what should I do before using it as a hand massager?
+ I recommend checking the device for correct operation, mechanical damage, and be sure to use an antiseptic.

+ + I'm having problems with the app or connecting my device to the app?
+ Go to Troubleshooting.

+
+
+

Troubleshooting

+ If you are having difficulty detecting a gamepad by the browser, you can use the utility + Gamepad Master

+ + The app does not see my device.
+ Make sure you have a chromium-based browser, then update the app and reconnect your device.

+ + The application sees the gamepad, but writes that the vibration actuator is missing.
+ This problem is specific to mozilla firefox browser and d-input mode. Check the system requirements before using the software.

+ + My question is not here.
+ Write me eugene.serb@gmail.com

+
+
+

System Requirements

+ Browser: Google Chrome and other Chromium based browser.
+ OS: Windows 7 or later.
+ Gamepad: with X-Input. +
+
+
+ + + + + + + + diff --git a/index.html b/index.html index eb8cb4e..da6bf2f 100644 --- a/index.html +++ b/index.html @@ -77,6 +77,12 @@ + + From cdc1c9edff2e30828d3b4694f7a8ed3cdfbafd68 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Tue, 21 Jun 2022 12:13:27 +0300 Subject: [PATCH 23/46] Updated about, sitemaps --- about.html | 8 ++++---- sitemap-internal.xml | 10 ++++++++-- sitemap.xml | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/about.html b/about.html index 748f6d0..080cec3 100644 --- a/about.html +++ b/about.html @@ -98,14 +98,14 @@

Feedback

Hi! I am the author and developer of Wavelovers app and I want to thank you for using this app. If you have any ideas or wishes, you can write to me.


- Mail me: + Write me: eugene.serb@gmail.com
- Follow me on Twitter: - @eugene_serb -
Visit my homepage: eugene-serb.github.io +
+ Follow me on Twitter: + @eugene_serb
diff --git a/index.html b/index.html index da6bf2f..d47b13e 100644 --- a/index.html +++ b/index.html @@ -81,10 +81,10 @@ FAQ From 720c5b468b2608701c20780d84cb6afb53bf00a4 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Tue, 21 Jun 2022 14:04:26 +0300 Subject: [PATCH 25/46] Fix --- faq.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/faq.html b/faq.html index ec17f4f..4409a83 100644 --- a/faq.html +++ b/faq.html @@ -124,9 +124,9 @@

System Requirements

- Gamepad: with X-Input. + Gamepad: with X-Input.
Browser: Google Chrome and other Chromium based browser.
- OS: Windows 7 or later.
+ OS: Windows 7 or later.
From ea3658cea48b07f79a19e02596f1ce6207958862 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Tue, 21 Jun 2022 14:33:59 +0300 Subject: [PATCH 26/46] Updated donation --- about.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/about.html b/about.html index c3f80fe..0cf949b 100644 --- a/about.html +++ b/about.html @@ -120,7 +120,9 @@ More money you earn more donation to me

Bitcoin: - BC1QSPZGJ7XRF099S2EJ8F5ZMM52XU0WKFURPEZNY5 + bc1qspzgj7xrf099s2ej8f5zmm52xu0wkfurpezny5 + DonationAlert: + @eugene_serb
From 228732157069209230880d1b48b2f909359849ff Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Tue, 21 Jun 2022 17:05:09 +0300 Subject: [PATCH 27/46] Updated about --- about.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/about.html b/about.html index 0cf949b..b2d84e6 100644 --- a/about.html +++ b/about.html @@ -107,6 +107,10 @@ Follow me on Twitter: @eugene_serb +
+

Advertising and collaboration

+

If you have advertising suggestions, please email above.

+
From 91532c6069b75eb366c0dcb2e6d98b2c856148e1 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Tue, 21 Jun 2022 19:43:09 +0300 Subject: [PATCH 32/46] Deleted buypro page --- about.html | 4 ++-- buypro.html | 10 +++++----- faq.html | 4 ++-- index.html | 2 +- sitemap-internal.xml | 6 ------ 5 files changed, 10 insertions(+), 16 deletions(-) diff --git a/about.html b/about.html index e0aab19..16e33b6 100644 --- a/about.html +++ b/about.html @@ -9,7 +9,7 @@ - + @@ -84,7 +84,7 @@ About diff --git a/buypro.html b/buypro.html index 7f6342e..1732734 100644 --- a/buypro.html +++ b/buypro.html @@ -1,7 +1,7 @@ - Wavelovers – About + Wavelovers – Buy Pro @@ -9,7 +9,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -35,7 +35,7 @@ - + @@ -84,7 +84,7 @@ About diff --git a/faq.html b/faq.html index 38deab1..4ea96b4 100644 --- a/faq.html +++ b/faq.html @@ -9,7 +9,7 @@ - + @@ -84,7 +84,7 @@ About diff --git a/index.html b/index.html index e951b00..d47b13e 100644 --- a/index.html +++ b/index.html @@ -84,7 +84,7 @@ About diff --git a/sitemap-internal.xml b/sitemap-internal.xml index 738b255..7747e12 100644 --- a/sitemap-internal.xml +++ b/sitemap-internal.xml @@ -18,11 +18,5 @@ weekly 1.0 - - https://wavelovers.ru/buypro.html - 2022-06-21 - weekly - 1.0 - From b3b70c54deba62d6798122a4a1e9f5b4105007be Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Tue, 21 Jun 2022 23:06:36 +0300 Subject: [PATCH 33/46] Updated styles and patterns --- buypro.html | 166 ------------------------------------------------- css/styles.css | 14 ++--- js/scripts.js | 76 ++++++++++++++++++++++ 3 files changed, 83 insertions(+), 173 deletions(-) delete mode 100644 buypro.html diff --git a/buypro.html b/buypro.html deleted file mode 100644 index 1732734..0000000 --- a/buypro.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - Wavelovers – Buy Pro - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
- -
-

Wavelovers – Buy Pro

-
-
-

Buy Pro

-

Pre order of the PRO version just for $5. Dates of the Release will be announced later.

-
- Write me: - eugene.serb@gmail.com -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FREEPRO
Additional patterns-+
Desktop-+
2 and more gamepads-+
Control with a Gamepad-+
Full control over gamepads-+
... and so much more later.
-
-
-
- - - - - - - - diff --git a/css/styles.css b/css/styles.css index de7f3af..b614818 100644 --- a/css/styles.css +++ b/css/styles.css @@ -493,15 +493,15 @@ table, th, td { } .pattern-item { - width: 300px; - height: 64px; - padding: 16px; - border-radius: 8px; + width: 200px; + height: 48px; + padding: 8px; + border-radius: var(--number-border-radius); background: var(--color-pattern-button); display: flex; flex-direction: row; justify-content: flex-start; - gap: 32px; + gap: 16px; align-items: center; text-align: center; overflow: hidden; @@ -513,11 +513,11 @@ table, th, td { } .pattern-item__icon{ - font-size: 32px; + font-size: 24px; } .pattern-item__name { - font-size: 18px; + font-size: 14px; white-space: nowrap; overflow: hidden; color: var(--color-pattern-text); diff --git a/js/scripts.js b/js/scripts.js index b85e858..adae607 100644 --- a/js/scripts.js +++ b/js/scripts.js @@ -44,6 +44,25 @@ class Library { } ] }, + { + "name": "Dotted AC", + "type": "Simple", + "icon": "🤨", + "pattern": [ + { + "startDelay": 100, + "duration": 100, + "weakMagnitude": 1.0, + "strongMagnitude": 0.0 + }, + { + "startDelay": 100, + "duration": 100, + "weakMagnitude": 0.0, + "strongMagnitude": 1.0 + } + ] + }, { "name": "Dotted Max", "type": "Simple", @@ -83,6 +102,25 @@ class Library { } ] }, + { + "name": "Short Dashed AC", + "type": "Simple", + "icon": "🤤", + "pattern": [ + { + "startDelay": 100, + "duration": 250, + "weakMagnitude": 1.0, + "strongMagnitude": 0.0 + }, + { + "startDelay": 100, + "duration": 250, + "weakMagnitude": 0.0, + "strongMagnitude": 1.0 + } + ] + }, { "name": "Short Dashed Max", "type": "Simple", @@ -122,6 +160,25 @@ class Library { } ] }, + { + "name": "Long Dashed AC", + "type": "Simple", + "icon": "😝", + "pattern": [ + { + "startDelay": 100, + "duration": 500, + "weakMagnitude": 1.0, + "strongMagnitude": 0.0 + }, + { + "startDelay": 100, + "duration": 500, + "weakMagnitude": 0.0, + "strongMagnitude": 1.0 + } + ] + }, { "name": "Long Dashed Max", "type": "Simple", @@ -161,6 +218,25 @@ class Library { } ] }, + { + "name": "Constant AC", + "type": "Simple", + "icon": "😵", + "pattern": [ + { + "startDelay": 0, + "duration": 1000, + "weakMagnitude": 1.0, + "strongMagnitude": 0.0 + }, + { + "startDelay": 0, + "duration": 1000, + "weakMagnitude": 0.0, + "strongMagnitude": 1.0 + } + ] + }, { "name": "Constant Max", "type": "Simple", From 5b67dcec412a119fe533184e016be6a4f8a460e2 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Wed, 22 Jun 2022 01:26:49 +0300 Subject: [PATCH 34/46] Fixed css styles of patterns, fixed faq --- css/styles.css | 2 +- faq.html | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/css/styles.css b/css/styles.css index b614818..80a1198 100644 --- a/css/styles.css +++ b/css/styles.css @@ -487,7 +487,7 @@ table, th, td { .pattern-list { display: flex; flex-direction: row; - justify-content: space-between; + justify-content: space-around; flex-wrap: wrap; gap: 32px; } diff --git a/faq.html b/faq.html index 4ea96b4..5a26629 100644 --- a/faq.html +++ b/faq.html @@ -106,7 +106,7 @@ I recommend checking the device for correct operation, mechanical damage, and be sure to use an antiseptic.

I'm having problems with the app or connecting my device to the app?
- Go to Troubleshooting.

+ Go to Troubleshooting.

Troubleshooting

@@ -120,13 +120,13 @@ This problem is specific to mozilla firefox browser and d-input mode. Check the system requirements before using the software.

My question is not here.
- Write me eugene.serb@gmail.com

+ Write me eugene.serb@gmail.com

System Requirements

- Gamepad: with X-Input and vibration actuator.
- Browser: Google Chrome and other Chromium based browser.
- OS: Windows 7 or later recommended. + Gamepad: X-Input and vibration actuator required.
+ Browser: Google Chrome or any other Chromium-based browser is recommended.
+ OS: Windows 7 or higher recommended.
From 7bd55bc009d2f7cdc918a06feeca1bf423edfeea Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Wed, 22 Jun 2022 10:28:37 +0300 Subject: [PATCH 35/46] Updated 404.md --- 404.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/404.md b/404.md index 65c076d..c210837 100644 --- a/404.md +++ b/404.md @@ -24,19 +24,14 @@ } - - - - - - + @@ -47,7 +42,7 @@ }) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); - ym(79722217, "init", { + ym(89252711, "init", { clickmap: true, trackLinks: true, accurateTrackBounce: true, @@ -60,12 +55,12 @@ - + From d876ec64c67967bc4f8bf64a19d8a105eba58825 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Wed, 22 Jun 2022 10:34:51 +0300 Subject: [PATCH 36/46] Updated 404 --- 404.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/404.md b/404.md index c210837..e21e09f 100644 --- a/404.md +++ b/404.md @@ -4,8 +4,12 @@ - - + + + + + +