diff --git a/package.json b/package.json index dcdcdac..cbf27b7 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ "react-select": "^3.2.0", "react-slider": "^1.1.2", "react-tabs": "^3.1.2", - "source-map-support": "^0.5.12" + "source-map-support": "^0.5.12", + "tinycolor2": "^1.4.2" }, "devDependencies": { "@babel/preset-react": "^7.9.4", diff --git a/src/devices/anansi.json b/src/devices/anansi.json index 5ea6e01..127127b 100644 --- a/src/devices/anansi.json +++ b/src/devices/anansi.json @@ -4,5 +4,5 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/54/54_anansi.png", "features": null, - "featuresMissing": ["ripple"] + "featuresMissing": ["ripple", "wheel"] } \ No newline at end of file diff --git a/src/devices/blackwidow_2019.json b/src/devices/blackwidow_2019.json index ff8484d..bceb0e3 100644 --- a/src/devices/blackwidow_2019.json +++ b/src/devices/blackwidow_2019.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1501/1501-blackwidow2019.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blackwidow_chroma.json b/src/devices/blackwidow_chroma.json index ade5a86..f905aa9 100644 --- a/src/devices/blackwidow_chroma.json +++ b/src/devices/blackwidow_chroma.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/279/279_blackwidow_chroma.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blackwidow_chroma_te.json b/src/devices/blackwidow_chroma_te.json index ebc221e..16b4452 100644 --- a/src/devices/blackwidow_chroma_te.json +++ b/src/devices/blackwidow_chroma_te.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/571/571_blackwidow_tournament_edition_chroma.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blackwidow_chroma_v2.json b/src/devices/blackwidow_chroma_v2.json index 77e9ffd..106249c 100644 --- a/src/devices/blackwidow_chroma_v2.json +++ b/src/devices/blackwidow_chroma_v2.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1179/1179_blackwidow_chroma_v2_alt.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blackwidow_elite.json b/src/devices/blackwidow_elite.json index 16713ae..eae8f69 100644 --- a/src/devices/blackwidow_elite.json +++ b/src/devices/blackwidow_elite.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1398/1398_blackwidowelite.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blackwidow_essential.json b/src/devices/blackwidow_essential.json index 2857d12..bf2b51f 100644 --- a/src/devices/blackwidow_essential.json +++ b/src/devices/blackwidow_essential.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1501/1501-blackwidow2019.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blackwidow_lite.json b/src/devices/blackwidow_lite.json index 5f9b4bb..01cfaec 100644 --- a/src/devices/blackwidow_lite.json +++ b/src/devices/blackwidow_lite.json @@ -4,5 +4,5 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1456/1456_blackwidowlite_-_2.png", "features": null, - "featuresMissing": ["ripple"] + "featuresMissing": ["ripple", "wheel"] } \ No newline at end of file diff --git a/src/devices/blackwidow_overwatch.json b/src/devices/blackwidow_overwatch.json index 49c55c4..b90e849 100644 --- a/src/devices/blackwidow_overwatch.json +++ b/src/devices/blackwidow_overwatch.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": null, "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blackwidow_stealth.json b/src/devices/blackwidow_stealth.json index 7d49075..3cab44b 100644 --- a/src/devices/blackwidow_stealth.json +++ b/src/devices/blackwidow_stealth.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/products/17559/razer-blackwidow-gallery-01.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blackwidow_stealth_edition.json b/src/devices/blackwidow_stealth_edition.json index b9f859d..fa264c4 100644 --- a/src/devices/blackwidow_stealth_edition.json +++ b/src/devices/blackwidow_stealth_edition.json @@ -8,6 +8,10 @@ "ripple": { "rows": 6, "cols": 22 + }, + "wheel": { + "rows": 6, + "cols": 22 } }] } \ No newline at end of file diff --git a/src/devices/blackwidow_ultimate_2012.json b/src/devices/blackwidow_ultimate_2012.json index 695ead9..077a32b 100644 --- a/src/devices/blackwidow_ultimate_2012.json +++ b/src/devices/blackwidow_ultimate_2012.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/563/563_blackwidow_ultimate_classic.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blackwidow_ultimate_2013.json b/src/devices/blackwidow_ultimate_2013.json index bfa6857..3fd0a3c 100644 --- a/src/devices/blackwidow_ultimate_2013.json +++ b/src/devices/blackwidow_ultimate_2013.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/245/438_blackwidow_ultimate_2014.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blackwidow_ultimate_2016.json b/src/devices/blackwidow_ultimate_2016.json index 71cad78..baf7689 100644 --- a/src/devices/blackwidow_ultimate_2016.json +++ b/src/devices/blackwidow_ultimate_2016.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/616/616_blackwidow_ultimate_2016.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blackwidow_v3_tk.json b/src/devices/blackwidow_v3_tk.json index 62dc6e0..cbab412 100644 --- a/src/devices/blackwidow_v3_tk.json +++ b/src/devices/blackwidow_v3_tk.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1709/1709-blackwidow-v3-tkl.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 18 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 18 + } + }, + { + "wheel": { + "rows": 6, + "cols": 18 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blackwidow_x_chroma.json b/src/devices/blackwidow_x_chroma.json index 59ae643..5282445 100644 --- a/src/devices/blackwidow_x_chroma.json +++ b/src/devices/blackwidow_x_chroma.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/716/716_blackwidow_x_chroma.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blackwidow_x_chroma_te.json b/src/devices/blackwidow_x_chroma_te.json index c8e181c..bee00e7 100644 --- a/src/devices/blackwidow_x_chroma_te.json +++ b/src/devices/blackwidow_x_chroma_te.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/717/717_blackwidow_x_tournament_edition_chroma.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blackwidow_x_ultimate.json b/src/devices/blackwidow_x_ultimate.json index 21849fe..be8badf 100644 --- a/src/devices/blackwidow_x_ultimate.json +++ b/src/devices/blackwidow_x_ultimate.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/718/718_blackwidow_x_ultimate.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blade_2018.json b/src/devices/blade_2018.json index f19b148..72c5bc6 100644 --- a/src/devices/blade_2018.json +++ b/src/devices/blade_2018.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1418/1418_blade_2018__base.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 16 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 16 + } + }, + { + "wheel": { + "rows": 6, + "cols": 16 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blade_2018_base.json b/src/devices/blade_2018_base.json index 980bac5..074d717 100644 --- a/src/devices/blade_2018_base.json +++ b/src/devices/blade_2018_base.json @@ -4,5 +4,5 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1418/1418_blade_2018__base.png", "features": null, - "featuresMissing": ["ripple"] + "featuresMissing": ["ripple", "wheel"] } \ No newline at end of file diff --git a/src/devices/blade_2018_mercury.json b/src/devices/blade_2018_mercury.json index 50b7405..db13ae9 100644 --- a/src/devices/blade_2018_mercury.json +++ b/src/devices/blade_2018_mercury.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": null, "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 16 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 16 + } + }, + { + "wheel": { + "rows": 6, + "cols": 16 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blade_2019_adv.json b/src/devices/blade_2019_adv.json index 0f9e1a6..b98ac30 100644 --- a/src/devices/blade_2019_adv.json +++ b/src/devices/blade_2019_adv.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1482/blade15.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 16 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 16 + } + }, + { + "wheel": { + "rows": 6, + "cols": 16 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blade_2019_base.json b/src/devices/blade_2019_base.json index c2945c7..ff03a27 100644 --- a/src/devices/blade_2019_base.json +++ b/src/devices/blade_2019_base.json @@ -4,5 +4,5 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1518/1518_blade15_mid2019-base.png", "features": null, - "featuresMissing": ["ripple"] + "featuresMissing": ["ripple", "wheel"] } \ No newline at end of file diff --git a/src/devices/blade_late_2016.json b/src/devices/blade_late_2016.json index 10a7f4e..8b67a3a 100644 --- a/src/devices/blade_late_2016.json +++ b/src/devices/blade_late_2016.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/736/736_blade_pro_2016.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 16 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 16 + } + }, + { + "wheel": { + "rows": 6, + "cols": 16 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blade_mid_2019_mercury.json b/src/devices/blade_mid_2019_mercury.json index 4534a99..33efcf9 100644 --- a/src/devices/blade_mid_2019_mercury.json +++ b/src/devices/blade_mid_2019_mercury.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets2.razerzone.com/images/blade-15/shop/blade15-mercury-1.jpg", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 16 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 6 + } + }, + { + "wheel": { + "rows": 6, + "cols": 6 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blade_pro_2017.json b/src/devices/blade_pro_2017.json index 3ee1829..2ea392c 100644 --- a/src/devices/blade_pro_2017.json +++ b/src/devices/blade_pro_2017.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1200/1200_blade_pro_2017.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 25 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 25 + } + }, + { + "wheel": { + "rows": 6, + "cols": 25 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blade_pro_2017_fullhd.json b/src/devices/blade_pro_2017_fullhd.json index 6ec4826..bc00e49 100644 --- a/src/devices/blade_pro_2017_fullhd.json +++ b/src/devices/blade_pro_2017_fullhd.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1200/1200_blade_pro_2017.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 25 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 25 + } + }, + { + "wheel": { + "rows": 6, + "cols": 25 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blade_pro_late_2016.json b/src/devices/blade_pro_late_2016.json index ad04fc7..fefe9ac 100644 --- a/src/devices/blade_pro_late_2016.json +++ b/src/devices/blade_pro_late_2016.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/736/736_blade_pro_2016.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blade_qhd.json b/src/devices/blade_qhd.json index 9380922..e17d6c5 100644 --- a/src/devices/blade_qhd.json +++ b/src/devices/blade_qhd.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/736/736_blade_pro_2016.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 16 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 16 + } + }, + { + "wheel": { + "rows": 6, + "cols": 16 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blade_stealth.json b/src/devices/blade_stealth.json index 2d90aa0..e687c6a 100644 --- a/src/devices/blade_stealth.json +++ b/src/devices/blade_stealth.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/667/667_blade_stealth_2016_6500u.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blade_stealth_2019.json b/src/devices/blade_stealth_2019.json index 55ced8b..479302a 100644 --- a/src/devices/blade_stealth_2019.json +++ b/src/devices/blade_stealth_2019.json @@ -4,5 +4,5 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1475/1475_bladestealth13(2019).png", "features": null, - "featuresMissing": ["ripple"] + "featuresMissing": ["ripple", "wheel"] } \ No newline at end of file diff --git a/src/devices/blade_stealth_late_2016.json b/src/devices/blade_stealth_late_2016.json index 684e26b..87fa13a 100644 --- a/src/devices/blade_stealth_late_2016.json +++ b/src/devices/blade_stealth_late_2016.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/667/667_blade_stealth_2016_6500u.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 16 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 16 + } + }, + { + "wheel": { + "rows": 6, + "cols": 16 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blade_stealth_late_2017.json b/src/devices/blade_stealth_late_2017.json index 6592b6e..1d020b5 100644 --- a/src/devices/blade_stealth_late_2017.json +++ b/src/devices/blade_stealth_late_2017.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1213/1213_blade_stealth_2017_7500u.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 16 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 16 + } + }, + { + "wheel": { + "rows": 6, + "cols": 16 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blade_stealth_late_2019.json b/src/devices/blade_stealth_late_2019.json index e0917e8..01454e3 100644 --- a/src/devices/blade_stealth_late_2019.json +++ b/src/devices/blade_stealth_late_2019.json @@ -4,5 +4,5 @@ "mainType": "keyboard", "image": "https://assets2.razerzone.com/images/blade-stealth-13/shop/stealth-l2p-1.jpg", "features": null, - "featuresMissing": ["ripple"] + "featuresMissing": ["ripple", "wheel"] } \ No newline at end of file diff --git a/src/devices/blade_stealth_mid_2017.json b/src/devices/blade_stealth_mid_2017.json index 6524052..ed0b6fe 100644 --- a/src/devices/blade_stealth_mid_2017.json +++ b/src/devices/blade_stealth_mid_2017.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1213/1213_blade_stealth_2017_7500u.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 16 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 16 + } + }, + { + "wheel": { + "rows": 6, + "cols": 16 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/blade_studio_edition_2019.json b/src/devices/blade_studio_edition_2019.json index c069e0c..e661c1d 100644 --- a/src/devices/blade_studio_edition_2019.json +++ b/src/devices/blade_studio_edition_2019.json @@ -8,6 +8,10 @@ "ripple": { "rows": 6, "cols": 16 + }, + "wheel": { + "rows": 6, + "cols": 16 } }] } \ No newline at end of file diff --git a/src/devices/cynosa_chroma.json b/src/devices/cynosa_chroma.json index db4589b..a977a84 100644 --- a/src/devices/cynosa_chroma.json +++ b/src/devices/cynosa_chroma.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1256/1256_cynosa_chroma.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/cynosa_lite.json b/src/devices/cynosa_lite.json index a88214b..b73c9a2 100644 --- a/src/devices/cynosa_lite.json +++ b/src/devices/cynosa_lite.json @@ -4,5 +4,5 @@ "mainType": "keyboard", "image": "https://assets2.razerzone.com/images/og-image/cynosa-lite-OGimage.jpg", "features": null, - "featuresMissing": ["ripple"] + "featuresMissing": ["ripple", "wheel"] } \ No newline at end of file diff --git a/src/devices/cynosa_v2.json b/src/devices/cynosa_v2.json index 58e8975..a5e6e9a 100644 --- a/src/devices/cynosa_v2.json +++ b/src/devices/cynosa_v2.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1694/1694-2.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/deathstalker_chroma.json b/src/devices/deathstalker_chroma.json index 61c7ad1..2d75f67 100644 --- a/src/devices/deathstalker_chroma.json +++ b/src/devices/deathstalker_chroma.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/665/665_deathstalker_chroma.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 1, - "cols": 6 + "featuresConfig": [ + { + "ripple": { + "rows": 1, + "cols": 6 + } + }, + { + "wheel": { + "rows": 1, + "cols": 6 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/deathstalker_expert.json b/src/devices/deathstalker_expert.json index f59e7d9..81a8cd0 100644 --- a/src/devices/deathstalker_expert.json +++ b/src/devices/deathstalker_expert.json @@ -4,5 +4,5 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/49/49_razer_deathstalker.png", "features": null, - "featuresMissing": ["ripple"] + "featuresMissing": ["ripple", "wheel"] } \ No newline at end of file diff --git a/src/devices/huntsman.json b/src/devices/huntsman.json index 65cfbf2..cacd87e 100644 --- a/src/devices/huntsman.json +++ b/src/devices/huntsman.json @@ -8,6 +8,10 @@ "ripple": { "rows": 6, "cols": 22 + }, + "wheel": { + "rows": 6, + "cols": 22 } }] } \ No newline at end of file diff --git a/src/devices/huntsman_elite.json b/src/devices/huntsman_elite.json index b80d45a..d32b0b6 100644 --- a/src/devices/huntsman_elite.json +++ b/src/devices/huntsman_elite.json @@ -8,6 +8,10 @@ "ripple": { "rows": 9, "cols": 22 + }, + "wheel": { + "rows": 9, + "cols": 22 } }] } \ No newline at end of file diff --git a/src/devices/huntsman_mini.json b/src/devices/huntsman_mini.json index bb674db..a7ab7bb 100644 --- a/src/devices/huntsman_mini.json +++ b/src/devices/huntsman_mini.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1689/1689-huntsmanmini.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 5, - "cols": 15 + "featuresConfig": [ + { + "ripple": { + "rows": 5, + "cols": 15 + } + }, + { + "wheel": { + "rows": 5, + "cols": 15 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/huntsman_te.json b/src/devices/huntsman_te.json index 6f85be1..ec835e2 100644 --- a/src/devices/huntsman_te.json +++ b/src/devices/huntsman_te.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1537/1537_huntsman_te.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 18 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 18 + } + }, + { + "wheel": { + "rows": 6, + "cols": 18 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/nostromo.json b/src/devices/nostromo.json index f1d94c7..f1cbd2d 100644 --- a/src/devices/nostromo.json +++ b/src/devices/nostromo.json @@ -4,5 +4,5 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/564/564_tartarus_classic.png", "features": null, - "featuresMissing": ["ripple"] + "featuresMissing": ["ripple", "wheel"] } \ No newline at end of file diff --git a/src/devices/orbweaver.json b/src/devices/orbweaver.json index 5294902..31ad5ad 100644 --- a/src/devices/orbweaver.json +++ b/src/devices/orbweaver.json @@ -4,5 +4,5 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/56/56_orbweaver.png", "features": null, - "featuresMissing": ["ripple"] + "featuresMissing": ["ripple", "wheel"] } \ No newline at end of file diff --git a/src/devices/orbweaver_chroma.json b/src/devices/orbweaver_chroma.json index db72117..8ca7622 100644 --- a/src/devices/orbweaver_chroma.json +++ b/src/devices/orbweaver_chroma.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/607/607_orbweaver_chroma.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 5, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 5, + "cols": 22 + } + }, + { + "wheel": { + "rows": 5, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/ornata.json b/src/devices/ornata.json index c833746..324b196 100644 --- a/src/devices/ornata.json +++ b/src/devices/ornata.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/726/726_ornata.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/ornata_chroma.json b/src/devices/ornata_chroma.json index d2af4f5..b979964 100644 --- a/src/devices/ornata_chroma.json +++ b/src/devices/ornata_chroma.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/727/727_ornata_chroma.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/ornata_v2.json b/src/devices/ornata_v2.json index e7d58e6..397e701 100644 --- a/src/devices/ornata_v2.json +++ b/src/devices/ornata_v2.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": null, "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 6, - "cols": 22 + "featuresConfig": [ + { + "ripple": { + "rows": 6, + "cols": 22 + } + }, + { + "wheel": { + "rows": 6, + "cols": 22 + } } - }] + ] } \ No newline at end of file diff --git a/src/devices/tartarus.json b/src/devices/tartarus.json index a75a4de..c531bbe 100644 --- a/src/devices/tartarus.json +++ b/src/devices/tartarus.json @@ -4,5 +4,5 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/228/228_tartarus.png", "features": null, - "featuresMissing": ["ripple"] + "featuresMissing": ["ripple", "wheel"] } \ No newline at end of file diff --git a/src/devices/tartarus_chroma.json b/src/devices/tartarus_chroma.json index 705d229..fb07a40 100644 --- a/src/devices/tartarus_chroma.json +++ b/src/devices/tartarus_chroma.json @@ -4,5 +4,5 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/598/598_tartarus_chroma.png", "features": null, - "featuresMissing": ["ripple"] + "featuresMissing": ["ripple", "wheel"] } \ No newline at end of file diff --git a/src/devices/tartarus_v2.json b/src/devices/tartarus_v2.json index c39ac65..883d432 100644 --- a/src/devices/tartarus_v2.json +++ b/src/devices/tartarus_v2.json @@ -4,10 +4,18 @@ "mainType": "keyboard", "image": "https://assets.razerzone.com/eeimages/support/products/1255/1255_tartarus_v2.png", "features": null, - "featuresConfig": [{ - "ripple": { - "rows": 4, - "cols": 6 + "featuresConfig": [ + { + "ripple": { + "rows": 4, + "cols": 6 + } + }, + { + "wheel": { + "rows": 4, + "cols": 6 + } } - }] + ] } \ No newline at end of file diff --git a/src/main/animation/animationwheel.js b/src/main/animation/animationwheel.js new file mode 100644 index 0000000..6c49e36 --- /dev/null +++ b/src/main/animation/animationwheel.js @@ -0,0 +1,59 @@ +import { RazerDeviceAnimation } from './animation'; +import tinycolor from 'tinycolor2'; + +export class RazerAnimationWheel extends RazerDeviceAnimation { + +constructor(device, featureConfiguration, speed) { + super(); + this.wheelEffectInterval = null; + + this.device = device; + + this.nRows = featureConfiguration.rows; + this.nCols = featureConfiguration.cols; + this.speed = speed; // seconds per cycle + } + + start() { + const refreshRate = 0.05; // in seconds + + // initialization + let matrix = Array(this.nRows) + .fill() + .map(() => Array(this.nCols).fill([0,0,0])); + + const midRow = parseInt(this.nRows / 2); + const midCol = parseInt(this.nCols / 2); + + this.wheelEffectInterval = setInterval(() => { + + // set color + for (let i = 0; i < this.nRows; i++) { + for (let j = 0; j < this.nCols; j++) { + let angle = Math.atan((midRow - i) / (j - midCol)) / Math.PI * 180; + if (j < midCol) angle += 180; + if (i == midRow && j == midCol) angle = 0; + + angle += Date.now() % parseInt(this.speed * 1000) / (this.speed * 1000) * 360; + angle = (angle + 360) % 360; + matrix[i][j] = Object.values(tinycolor(`hsv(${360-angle},70%,100%)`).toRgb()).slice(0, 3); + } + } + + // set wheel effect + for (let i = 0; i < this.nRows; i++) { + let row = [i, 0, this.nCols - 1, ...matrix[i].flat()]; + this.device.setCustomFrame(new Uint8Array(row)) + } + this.device.setModeCustom(); + }, refreshRate); + } + + stop() { + clearTimeout(this.wheelEffectInterval); + } + + destroy() { + this.stop(); + } +} \ No newline at end of file diff --git a/src/main/device/razerdevicekeyboard.js b/src/main/device/razerdevicekeyboard.js index b7e73f7..7a72dcf 100644 --- a/src/main/device/razerdevicekeyboard.js +++ b/src/main/device/razerdevicekeyboard.js @@ -1,10 +1,12 @@ import { RazerDevice } from './razerdevice'; import { RazerAnimationRipple } from '../animation/animationripple'; +import { RazerAnimationWheel } from '../animation/animationwheel'; export class RazerDeviceKeyboard extends RazerDevice { constructor(addon, settingsManager, stateManager, razerProperties) { super(addon, settingsManager, stateManager, razerProperties); this.rippleAnimation = null; + this.wheelAnimation = null; } async init() { @@ -21,7 +23,7 @@ export class RazerDeviceKeyboard extends RazerDevice { } getSerializeIgnoredProperties() { - return super.getSerializeIgnoredProperties().concat(['rippleAnimation']); + return super.getSerializeIgnoredProperties().concat(['rippleAnimation', 'wheelAnimation']); } getState() { @@ -40,6 +42,9 @@ export class RazerDeviceKeyboard extends RazerDevice { if(this.rippleAnimation != null) { this.rippleAnimation.destroy(); } + if(this.wheelAnimation != null) { + this.wheelAnimation.destroy(); + } } setModeNone() { @@ -101,6 +106,9 @@ export class RazerDeviceKeyboard extends RazerDevice { if(this.rippleAnimation != null) { this.rippleAnimation.stop(); } + if(this.wheelAnimation != null) { + this.wheelAnimation.stop(); + } } setRippleEffect(featureConfiguration, color, backgroundColor) { @@ -110,6 +118,13 @@ export class RazerDeviceKeyboard extends RazerDevice { this.rippleAnimation.start(); } + setWheelEffect(featureConfiguration, speed) { + this.setModeState('wheel', [featureConfiguration, speed]); + this.stopAnimations(); + this.wheelAnimation = new RazerAnimationWheel(this, featureConfiguration, speed); + this.wheelAnimation.start(); + } + setCustomFrame(frame) { this.addon.kbdSetCustomFrame(this.internalId, new Uint8Array(frame)); } diff --git a/src/main/feature/featurehelper.js b/src/main/feature/featurehelper.js index 24c6080..f7692ee 100644 --- a/src/main/feature/featurehelper.js +++ b/src/main/feature/featurehelper.js @@ -6,6 +6,7 @@ import { FeatureReactive } from './featurereactive'; import { FeatureBreathe } from './featurebreathe'; import { FeatureStarlight } from './featurestarlight'; import { FeatureRipple } from './featureripple'; +import { FeatureWheel } from './featurewheel'; import { FeatureBrightness } from './featurebrightness'; import { FeatureWaveSimple } from './featurewavesimple'; import { FeatureOldMouseEffects } from './featureoldmouseeffects'; @@ -31,6 +32,7 @@ export class FeatureHelper { case FeatureIdentifier.STARLIGHT: return new FeatureStarlight(configuration); case FeatureIdentifier.BRIGHTNESS: return new FeatureBrightness(configuration); case FeatureIdentifier.RIPPLE: return new FeatureRipple(configuration); + case FeatureIdentifier.WHEEL: return new FeatureWheel(configuration); case FeatureIdentifier.OLD_MOUSE_EFFECTS: return new FeatureOldMouseEffects(configuration); case FeatureIdentifier.MOUSE_BRIGHTNESS: return new FeatureMouseBrightness(configuration); case FeatureIdentifier.POLL_RATE: return new FeatureMousePollRate(configuration); @@ -52,6 +54,7 @@ export class FeatureHelper { new FeatureBreathe(), new FeatureStarlight(), new FeatureRipple(), + new FeatureWheel(), new FeatureBrightness(), ]; case RazerDeviceType.MOUSE: diff --git a/src/main/feature/featureidentifier.js b/src/main/feature/featureidentifier.js index b9678c9..20eb91b 100644 --- a/src/main/feature/featureidentifier.js +++ b/src/main/feature/featureidentifier.js @@ -10,6 +10,7 @@ FeatureIdentifier.BREATHE = 'breathe'; FeatureIdentifier.STARLIGHT = 'starlight'; FeatureIdentifier.BRIGHTNESS = 'brightness'; FeatureIdentifier.RIPPLE = 'ripple'; +FeatureIdentifier.WHEEL = 'wheel'; FeatureIdentifier.OLD_MOUSE_EFFECTS = 'oldMouseEffects'; FeatureIdentifier.MOUSE_BRIGHTNESS = 'mouseBrightness'; FeatureIdentifier.POLL_RATE = 'pollRate'; diff --git a/src/main/feature/featurewheel.js b/src/main/feature/featurewheel.js new file mode 100644 index 0000000..831a0f3 --- /dev/null +++ b/src/main/feature/featurewheel.js @@ -0,0 +1,15 @@ +import { Feature } from './feature'; +import { FeatureIdentifier } from './featureidentifier'; + +export class FeatureWheel extends Feature { + constructor(config) { + super(FeatureIdentifier.WHEEL, config); + } + + getDefaultConfiguration() { + return { + rows: -1, + cols: -1, + }; + } +} diff --git a/src/main/menu/menubuilderdevice.js b/src/main/menu/menubuilderdevice.js index e1136a6..8c32bef 100644 --- a/src/main/menu/menubuilderdevice.js +++ b/src/main/menu/menubuilderdevice.js @@ -75,6 +75,8 @@ function getFeatureMenuFor(application, device, feature) { return getFeatureBrightness(application, device, feature); case FeatureIdentifier.RIPPLE: return getFeatureRipple(application, device, feature); + case FeatureIdentifier.WHEEL: + return getFeatureWheel(application, device, feature); case FeatureIdentifier.OLD_MOUSE_EFFECTS: return getFeatureOldMouseEffect(application, device, feature); case FeatureIdentifier.MOUSE_BRIGHTNESS: @@ -225,6 +227,34 @@ function getFeatureRipple(application, device, feature) { }; } +function getFeatureWheel(application, device, feature) { + + if(feature.configuration == null || feature.configuration.rows === -1 || feature.configuration.cols === -1) { + return { + label: 'Wheel (missing rows, cols config)', + enabled: false + }; + } + + const singleItem = (label, speed) => { + return { + label: label, + click() { + device.setWheelEffect(feature.configuration, speed); + }, + }; + }; + + return { + label: 'Wheel', + submenu: [ + singleItem('Slow Speed', 3), + singleItem('Medium Speed', 2), + singleItem('Fast Speed', 1), + ], + }; +} + function getFeatureSpectrum(application, device, feature) { return { label: 'Spectrum', diff --git a/src/main/statemanager.js b/src/main/statemanager.js index 23d02ce..d683801 100644 --- a/src/main/statemanager.js +++ b/src/main/statemanager.js @@ -199,6 +199,9 @@ export class StateManager { case 'ripple': device.setRippleEffect(state.args[0], state.args[1], state.args[2]); break; + case 'wheel': + device.setWheelEffect(state.args[0], state.args[1]); + break; default: console.error('Unknown State mode ' + state.mode); } diff --git a/yarn.lock b/yarn.lock index 7acb04a..ca17720 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7357,7 +7357,7 @@ timers-browserify@^2.0.4: dependencies: setimmediate "^1.0.4" -tinycolor2@^1.4.1: +tinycolor2@^1.4.1, tinycolor2@^1.4.2: version "1.4.2" resolved "https://registry.yarnpkg.com/tinycolor2/-/tinycolor2-1.4.2.tgz#3f6a4d1071ad07676d7fa472e1fac40a719d8803" integrity sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA==