mirror of
https://github.com/chaoticbackup/chaoticbackup.github.io.git
synced 2026-03-21 17:24:14 -05:00
mugic player beta #28
This commit is contained in:
parent
85af86ec1c
commit
ba72a4beb2
|
|
@ -1,4 +1,4 @@
|
|||
export default exports = {
|
||||
module.exports = {
|
||||
"root": true,
|
||||
"parser": "babel-eslint",
|
||||
"extends": [
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{384:function(e,t,n){},387:function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return y});function a(){return v.a.createElement("a",{href:"https://github.com/chaoticbackup",className:"name",rel:"noreferrer noopener",target:"_blank"},"Chaotic Backup Project")}function r(e){var t=e.block,n=e.text;return v.a.createElement("div",{className:"lore"},v.a.createElement("div",{className:"title"},t),n.map(function(e,t){return v.a.createElement("div",{key:t},e)}))}var l=n(121),o=n.n(l),i=n(61),c=n.n(i),s=n(52),u=n.n(s),d=n(118),m=n.n(d),h=n(119),f=n.n(h),b=n(120),p=n.n(b),E=n(0),v=n.n(E),w=n(53),k=n(34),y=(n(384),n(6),function(e){function l(){var e,t;c()(this,l);for(var n=arguments.length,a=new Array(n),r=0;r<n;r++)a[r]=arguments[r];return(t=m()(this,(e=f()(l)).call.apply(e,[this].concat(a)))).state={lore:[]},t}return p()(l,e),u()(l,[{key:"componentDidMount",value:function(){var t=this;fetch("/src/json/starter_lore.json").then(function(e){return e.json()}).then(function(e){t.setState({lore:e})}).catch(function(){t.setState({lore:[{block:"Unable to load lore...",text:[]}]})})}},{key:"render",value:function(){return v.a.createElement("div",null,v.a.createElement("br",null),v.a.createElement("div",{className:"with-love"},v.a.createElement("div",null,"Welcome to the ",v.a.createElement(a,null),"."),v.a.createElement("span",null,"Built by fans for fans."),v.a.createElement("br",null),v.a.createElement("br",null),v.a.createElement("div",null,"Made with ",v.a.createElement("span",{className:"heart"},"♥")," by",v.a.createElement("br",null),"Danude Sandstorm (Project Lead)",v.a.createElement("br",null),"Chiodosin1 (Database Contributions)",v.a.createElement("br",null),"Afjak and Blitser (Art and Knowledge)"),v.a.createElement("div",null,"Do you like the site? You can donate to support it!"),v.a.createElement("div",{className:"donate"},v.a.createElement(k.e,null)),v.a.createElement("div",{className:"lore"},"We were unsatisfied with the options on how to search for cards. I took the design of the old Chaotic website and added my own modernizations. With an extensive lists of search options in the ",v.a.createElement(w.b,{to:"/collection"},"collection"),", you'll find deck building mores streamlined than ever before. Chaotic is full of rich lore, but unfortunately the best database of official lore disapeared when the ",v.a.createElement(w.b,{to:"/portal"},"Portal to Perim")," disapeared along with the site. You can again explore the official lore and information of Creatures!"),v.a.createElement("br",null),0<this.state.lore.length?this.state.lore.map(function(e,t){return v.a.createElement(r,o()({key:t},e))}):"Loading lore entries..."))}}]),l}(v.a.Component))}}]);
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{393:function(e,t,n){},396:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return y}));var a=n(122),r=n.n(a),l=n(62),o=n.n(l),i=n(53),c=n.n(i),s=n(119),u=n.n(s),d=n(120),m=n.n(d),h=n(121),f=n.n(h),b=n(0),p=n.n(b),E=n(54),v=n(34),w=(n(393),n(6),function(){return p.a.createElement("a",{href:"https://github.com/chaoticbackup",className:"name",rel:"noreferrer noopener",target:"_blank"},"Chaotic Backup Project")}),k=function(e){var t=e.block,n=e.text;return p.a.createElement("div",{className:"lore"},p.a.createElement("div",{className:"title"},t),n.map((function(e,t){return p.a.createElement("div",{key:t},e)})))},y=function(e){function t(){var e,n;o()(this,t);for(var a=arguments.length,r=new Array(a),l=0;l<a;l++)r[l]=arguments[l];return(n=u()(this,(e=m()(t)).call.apply(e,[this].concat(r)))).state={lore:[]},n}return f()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this;fetch("/src/json/starter_lore.json").then((function(e){return e.json()})).then((function(t){e.setState({lore:t})})).catch((function(){e.setState({lore:[{block:"Unable to load lore...",text:[]}]})}))}},{key:"render",value:function(){return p.a.createElement("div",null,p.a.createElement("br",null),p.a.createElement("div",{className:"with-love"},p.a.createElement("div",null,"Welcome to the ",p.a.createElement(w,null),"."),p.a.createElement("span",null,"Built by fans for fans."),p.a.createElement("br",null),p.a.createElement("br",null),p.a.createElement("div",null,"Made with ",p.a.createElement("span",{className:"heart"},"♥")," by",p.a.createElement("br",null),"Danude Sandstorm (Project Lead)",p.a.createElement("br",null),"Chiodosin1 (Database Contributions)",p.a.createElement("br",null),"Afjak and Blitser (Art and Knowledge)"),p.a.createElement("div",null,"Do you like the site? You can donate to support it!"),p.a.createElement("div",{className:"donate"},p.a.createElement(v.e,null)),p.a.createElement("div",{className:"lore"},"We were unsatisfied with the options on how to search for cards. I took the design of the old Chaotic website and added my own modernizations. With an extensive lists of search options in the ",p.a.createElement(E.b,{to:"/collection"},"collection"),", you'll find deck building mores streamlined than ever before. Chaotic is full of rich lore, but unfortunately the best database of official lore disapeared when the ",p.a.createElement(E.b,{to:"/portal"},"Portal to Perim")," disapeared along with the site. You can again explore the official lore and information of Creatures!"),p.a.createElement("br",null),this.state.lore.length>0?this.state.lore.map((function(e,t){return p.a.createElement(k,r()({key:t},e))})):"Loading lore entries..."))}}]),t}(p.a.Component)}}]);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -62,7 +62,7 @@ object-assign
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/** @license React v16.12.0
|
||||
/** @license React v16.9.0
|
||||
* react-is.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
|
@ -70,3 +70,10 @@ object-assign
|
|||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Tone.js
|
||||
* @author Yotam Mann
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright 2014-2019 Yotam Mann
|
||||
*/
|
||||
|
|
|
|||
367
package-lock.json
generated
367
package-lock.json
generated
|
|
@ -2350,7 +2350,8 @@
|
|||
"@types/history": {
|
||||
"version": "4.7.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.3.tgz",
|
||||
"integrity": "sha512-cS5owqtwzLN5kY+l+KgKdRJ/Cee8tlmQoGQuIE9tWnSmS3JMKzmxo2HIAk2wODMifGwO20d62xZQLYz+RLfXmw=="
|
||||
"integrity": "sha512-cS5owqtwzLN5kY+l+KgKdRJ/Cee8tlmQoGQuIE9tWnSmS3JMKzmxo2HIAk2wODMifGwO20d62xZQLYz+RLfXmw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/minimatch": {
|
||||
"version": "3.0.3",
|
||||
|
|
@ -2393,6 +2394,7 @@
|
|||
"version": "16.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.4.tgz",
|
||||
"integrity": "sha512-fya9xteU/n90tda0s+FtN5Ym4tbgxpq/hb/Af24dvs6uYnYn+fspaxw5USlw0R8apDNwxsqumdRoCoKitckQqw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/react": "*"
|
||||
}
|
||||
|
|
@ -2401,6 +2403,7 @@
|
|||
"version": "5.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.3.tgz",
|
||||
"integrity": "sha512-0gGhmerBqN8CzlnDmSgGNun3tuZFXerUclWkqEhozdLaJtfcJRUTGkKaEKk+/MpHd1KDS1+o2zb/3PkBUiv2qQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/history": "*",
|
||||
"@types/react": "*"
|
||||
|
|
@ -2410,6 +2413,7 @@
|
|||
"version": "5.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.1.3.tgz",
|
||||
"integrity": "sha512-pCq7AkOvjE65jkGS5fQwQhvUp4+4PVD9g39gXLZViP2UqFiFzsEpB3PKf0O6mdbKsewSK8N14/eegisa/0CwnA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/history": "*",
|
||||
"@types/react": "*",
|
||||
|
|
@ -2640,6 +2644,24 @@
|
|||
"integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==",
|
||||
"dev": true
|
||||
},
|
||||
"aggregate-error": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz",
|
||||
"integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"clean-stack": "^2.0.0",
|
||||
"indent-string": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"indent-string": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz",
|
||||
"integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"ajv": {
|
||||
"version": "6.10.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz",
|
||||
|
|
@ -2923,6 +2945,25 @@
|
|||
"integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==",
|
||||
"dev": true
|
||||
},
|
||||
"automation-events": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/automation-events/-/automation-events-1.0.8.tgz",
|
||||
"integrity": "sha512-eDqi+KyMiNRm4HgC7HbOPaSCwO2pa3IWxp7CFZ9l4pyf5Dd58CYBeS9pxw0InpVuML9JVo5Goaep2G+7zwQ3pA==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.7.6",
|
||||
"tslib": "^1.10.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": {
|
||||
"version": "7.7.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.6.tgz",
|
||||
"integrity": "sha512-BWAJxpNVa0QlE5gZdWjSxXtemZyZ9RmrmVozxt3NUXeZhVIJ5ANyqmMc0JDrivBZyxUuQvFxlvH4OWWOogGfUw==",
|
||||
"requires": {
|
||||
"regenerator-runtime": "^0.13.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"aws-sign2": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
|
||||
|
|
@ -3541,6 +3582,12 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"clean-stack": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz",
|
||||
"integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==",
|
||||
"dev": true
|
||||
},
|
||||
"cli-cursor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz",
|
||||
|
|
@ -5563,6 +5610,15 @@
|
|||
"readable-stream": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"fs-minipass": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.0.0.tgz",
|
||||
"integrity": "sha512-40Qz+LFXmd9tzYVnnBmZvFfvAADfUA14TXPK1s7IfElJTIZ97rA8w4Kin7Wt5JBrC3ShnnFJO/5vPjPEeJIq9A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minipass": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"fs-readdir-recursive": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz",
|
||||
|
|
@ -7164,6 +7220,27 @@
|
|||
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
|
||||
"dev": true
|
||||
},
|
||||
"jest-worker": {
|
||||
"version": "24.9.0",
|
||||
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.9.0.tgz",
|
||||
"integrity": "sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"merge-stream": "^2.0.0",
|
||||
"supports-color": "^6.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"supports-color": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
|
||||
"integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-flag": "^3.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"js-base64": {
|
||||
"version": "2.5.1",
|
||||
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz",
|
||||
|
|
@ -7718,6 +7795,12 @@
|
|||
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=",
|
||||
"dev": true
|
||||
},
|
||||
"merge-stream": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
|
||||
"integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
|
||||
"dev": true
|
||||
},
|
||||
"methods": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
|
||||
|
|
@ -7844,6 +7927,50 @@
|
|||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
|
||||
"dev": true
|
||||
},
|
||||
"minipass": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.1.tgz",
|
||||
"integrity": "sha512-UFqVihv6PQgwj8/yTGvl9kPz7xIAY+R5z6XYjRInD3Gk3qx6QGSD6zEcpeG4Dy/lQnv1J6zv8ejV90hyYIKf3w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"minipass-collect": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz",
|
||||
"integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minipass": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"minipass-flush": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz",
|
||||
"integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minipass": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"minipass-pipeline": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.2.tgz",
|
||||
"integrity": "sha512-3JS5A2DKhD2g0Gg8x3yamO0pj7YeKGwVlDS90pF++kxptwx/F+B//roxf9SqYil5tQo65bijy+dAuAFZmYOouA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minipass": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"mississippi": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz",
|
||||
|
|
@ -10868,6 +10995,26 @@
|
|||
"integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==",
|
||||
"dev": true
|
||||
},
|
||||
"standardized-audio-context": {
|
||||
"version": "23.0.5",
|
||||
"resolved": "https://registry.npmjs.org/standardized-audio-context/-/standardized-audio-context-23.0.5.tgz",
|
||||
"integrity": "sha512-IjKXMDdSp1c3MooPFYh8K+GAGaF6Ht2LW3PV+jRRW7YSofZFUuf6fTQlL5ySz79jUIl5ygNEKCxEBndRuFuw0A==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.7.6",
|
||||
"automation-events": "^1.0.8",
|
||||
"tslib": "^1.10.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": {
|
||||
"version": "7.7.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.6.tgz",
|
||||
"integrity": "sha512-BWAJxpNVa0QlE5gZdWjSxXtemZyZ9RmrmVozxt3NUXeZhVIJ5ANyqmMc0JDrivBZyxUuQvFxlvH4OWWOogGfUw==",
|
||||
"requires": {
|
||||
"regenerator-runtime": "^0.13.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"static-extend": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz",
|
||||
|
|
@ -11182,37 +11329,157 @@
|
|||
}
|
||||
},
|
||||
"terser-webpack-plugin": {
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.2.tgz",
|
||||
"integrity": "sha512-fdEb91kR2l+BVgES77N/NTXWZlpX6vX+pYPjnX5grcDYBF2CMnzJiXX4NNlna4l04lvCW39lZ+O/jSvUhHH/ew==",
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.2.2.tgz",
|
||||
"integrity": "sha512-/CHMNswPMAwuD2kd++qys8UmBRmsshPSzHw4BlDwurPtK9YjeK93OV89YWkJulHk972cs07K/7Z92V6PNjWF8A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"cacache": "^12.0.2",
|
||||
"find-cache-dir": "^2.1.0",
|
||||
"is-wsl": "^1.1.0",
|
||||
"schema-utils": "^1.0.0",
|
||||
"cacache": "^13.0.1",
|
||||
"find-cache-dir": "^3.1.0",
|
||||
"jest-worker": "^24.9.0",
|
||||
"schema-utils": "^2.6.1",
|
||||
"serialize-javascript": "^2.1.1",
|
||||
"source-map": "^0.6.1",
|
||||
"terser": "^4.1.2",
|
||||
"webpack-sources": "^1.4.0",
|
||||
"worker-farm": "^1.7.0"
|
||||
"terser": "^4.4.2",
|
||||
"webpack-sources": "^1.4.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"schema-utils": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz",
|
||||
"integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==",
|
||||
"cacache": {
|
||||
"version": "13.0.1",
|
||||
"resolved": "https://registry.npmjs.org/cacache/-/cacache-13.0.1.tgz",
|
||||
"integrity": "sha512-5ZvAxd05HDDU+y9BVvcqYu2LLXmPnQ0hW62h32g4xBTgL/MppR4/04NHfj/ycM2y6lmTnbw6HVi+1eN0Psba6w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ajv": "^6.1.0",
|
||||
"ajv-errors": "^1.0.0",
|
||||
"ajv-keywords": "^3.1.0"
|
||||
"chownr": "^1.1.2",
|
||||
"figgy-pudding": "^3.5.1",
|
||||
"fs-minipass": "^2.0.0",
|
||||
"glob": "^7.1.4",
|
||||
"graceful-fs": "^4.2.2",
|
||||
"infer-owner": "^1.0.4",
|
||||
"lru-cache": "^5.1.1",
|
||||
"minipass": "^3.0.0",
|
||||
"minipass-collect": "^1.0.2",
|
||||
"minipass-flush": "^1.0.5",
|
||||
"minipass-pipeline": "^1.2.2",
|
||||
"mkdirp": "^0.5.1",
|
||||
"move-concurrently": "^1.0.1",
|
||||
"p-map": "^3.0.0",
|
||||
"promise-inflight": "^1.0.1",
|
||||
"rimraf": "^2.7.1",
|
||||
"ssri": "^7.0.0",
|
||||
"unique-filename": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"find-cache-dir": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.1.0.tgz",
|
||||
"integrity": "sha512-zw+EFiNBNPgI2NTrKkDd1xd7q0cs6wr/iWnr/oUkI0yF9K9GqQ+riIt4aiyFaaqpaWbxPrJXHI+QvmNUQbX+0Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"commondir": "^1.0.1",
|
||||
"make-dir": "^3.0.0",
|
||||
"pkg-dir": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"find-up": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
|
||||
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"locate-path": "^5.0.0",
|
||||
"path-exists": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"locate-path": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
|
||||
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"p-locate": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"lru-cache": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
|
||||
"integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"yallist": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"make-dir": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz",
|
||||
"integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"semver": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"p-locate": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
|
||||
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"p-limit": "^2.2.0"
|
||||
}
|
||||
},
|
||||
"p-map": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz",
|
||||
"integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"aggregate-error": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"path-exists": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
|
||||
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
|
||||
"dev": true
|
||||
},
|
||||
"pkg-dir": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
|
||||
"integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"find-up": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
|
||||
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"glob": "^7.1.3"
|
||||
}
|
||||
},
|
||||
"schema-utils": {
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.6.1.tgz",
|
||||
"integrity": "sha512-0WXHDs1VDJyo+Zqs9TKLKyD/h7yDpHUhEFsM2CzkICFdoX1av+GBq/J2xRTFfsQO5kBfhZzANf2VcIm84jqDbg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ajv": "^6.10.2",
|
||||
"ajv-keywords": "^3.4.1"
|
||||
}
|
||||
},
|
||||
"semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"dev": true
|
||||
},
|
||||
"serialize-javascript": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.1.tgz",
|
||||
"integrity": "sha512-MPLPRpD4FNqWq9tTIjYG5LesFouDhdyH0EPY3gVK4DRD5+g4aDqdNSzLIwceulo3Yj+PL1bPh6laE5+H6LTcrQ==",
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz",
|
||||
"integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==",
|
||||
"dev": true
|
||||
},
|
||||
"source-map": {
|
||||
|
|
@ -11220,6 +11487,22 @@
|
|||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true
|
||||
},
|
||||
"ssri": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ssri/-/ssri-7.1.0.tgz",
|
||||
"integrity": "sha512-77/WrDZUWocK0mvA5NTRQyveUf+wsrIc6vyrxpS8tVvYBcX215QbafrJR3KtkpskIzoFLqqNuuYQvxaMjXJ/0g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"figgy-pudding": "^3.5.1",
|
||||
"minipass": "^3.1.1"
|
||||
}
|
||||
},
|
||||
"yallist": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
|
||||
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -11346,9 +11629,13 @@
|
|||
"dev": true
|
||||
},
|
||||
"tone": {
|
||||
"version": "13.8.25",
|
||||
"resolved": "https://registry.npmjs.org/tone/-/tone-13.8.25.tgz",
|
||||
"integrity": "sha512-8QqmLn+/R+Urib/78zf93+NqFLddXS777kQO7+EbJHwqy+nmug+SJFRp2KIytT0LQY2sJBiopNb2ceHA8uQQJg=="
|
||||
"version": "14.5.0",
|
||||
"resolved": "https://registry.npmjs.org/tone/-/tone-14.5.0.tgz",
|
||||
"integrity": "sha512-4T9hlWrfQuD9toow1aRiBkGDy0FqbVci+z8OToFWitv/WMrTs+iVG7skccUetbXujkjOubGlENWcJ32LWmd37A==",
|
||||
"requires": {
|
||||
"standardized-audio-context": "^23.0.3",
|
||||
"tslib": "^1.10.0"
|
||||
}
|
||||
},
|
||||
"tough-cookie": {
|
||||
"version": "2.4.3",
|
||||
|
|
@ -11386,8 +11673,7 @@
|
|||
"tslib": {
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
|
||||
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ=="
|
||||
},
|
||||
"tty-browserify": {
|
||||
"version": "0.0.0",
|
||||
|
|
@ -11881,6 +12167,35 @@
|
|||
"ajv-errors": "^1.0.0",
|
||||
"ajv-keywords": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"serialize-javascript": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz",
|
||||
"integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==",
|
||||
"dev": true
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true
|
||||
},
|
||||
"terser-webpack-plugin": {
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.2.tgz",
|
||||
"integrity": "sha512-fdEb91kR2l+BVgES77N/NTXWZlpX6vX+pYPjnX5grcDYBF2CMnzJiXX4NNlna4l04lvCW39lZ+O/jSvUhHH/ew==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"cacache": "^12.0.2",
|
||||
"find-cache-dir": "^2.1.0",
|
||||
"is-wsl": "^1.1.0",
|
||||
"schema-utils": "^1.0.0",
|
||||
"serialize-javascript": "^2.1.1",
|
||||
"source-map": "^0.6.1",
|
||||
"terser": "^4.1.2",
|
||||
"webpack-sources": "^1.4.0",
|
||||
"worker-farm": "^1.7.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
10
package.json
10
package.json
|
|
@ -18,9 +18,6 @@
|
|||
"@material-ui/core": "^4.5.1",
|
||||
"@material-ui/icons": "^4.5.1",
|
||||
"@material-ui/styles": "^4.5.0",
|
||||
"@types/react": "^16.9.15",
|
||||
"@types/react-dom": "^16.9.4",
|
||||
"@types/react-router-dom": "^5.1.2",
|
||||
"lokijs": "^1.5.8",
|
||||
"mobx": "^5.15.0",
|
||||
"mobx-react": "^5.4.4",
|
||||
|
|
@ -35,7 +32,7 @@
|
|||
"react-process-string": "^1.2.0",
|
||||
"react-router": "^5.1.2",
|
||||
"react-router-dom": "^5.1.2",
|
||||
"tone": "^13.8.25",
|
||||
"tone": "^14.5.0",
|
||||
"universal-cookie": "^4.0.2",
|
||||
"whatwg-fetch": "^3.0.0"
|
||||
},
|
||||
|
|
@ -47,6 +44,7 @@
|
|||
"@babel/plugin-proposal-decorators": "^7.7.4",
|
||||
"@babel/plugin-proposal-dynamic-import": "^7.7.0",
|
||||
"@babel/plugin-proposal-object-rest-spread": "^7.7.4",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
|
||||
"@babel/plugin-transform-computed-properties": "^7.7.4",
|
||||
"@babel/plugin-transform-runtime": "^7.7.5",
|
||||
"@babel/polyfill": "^7.7.0",
|
||||
|
|
@ -56,6 +54,9 @@
|
|||
"@babel/preset-typescript": "^7.7.4",
|
||||
"@babel/register": "^7.7.4",
|
||||
"@babel/runtime": "^7.7.1",
|
||||
"@types/react": "^16.9.15",
|
||||
"@types/react-dom": "^16.9.4",
|
||||
"@types/react-router-dom": "^5.1.2",
|
||||
"babel-eslint": "^10.0.3",
|
||||
"babel-loader": "^8.0.5",
|
||||
"css-loader": "^3.2.1",
|
||||
|
|
@ -69,6 +70,7 @@
|
|||
"optimize-css-assets-webpack-plugin": "^5.0.3",
|
||||
"sass-loader": "^8.0.0",
|
||||
"style-loader": "^1.0.1",
|
||||
"terser-webpack-plugin": "^2.2.2",
|
||||
"typescript": "^3.7.3",
|
||||
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||
"webpack": "^4.41.2",
|
||||
|
|
|
|||
|
|
@ -3,12 +3,13 @@ import API from '../../SpreadsheetData';
|
|||
import {observer, inject} from 'mobx-react';
|
||||
import {Rarity, Unique, Name, Mugic, Ability, Tribe} from '../../Snippets';
|
||||
import MugicPlay from '../../mugicplayer/playbutton.tsx';
|
||||
import {withRouter} from 'react-router';
|
||||
|
||||
@inject((stores, props, context) => props) @observer
|
||||
export default class Attack extends React.Component {
|
||||
class Attack extends React.Component {
|
||||
|
||||
render() {
|
||||
let card = this.props.card;
|
||||
let {card, history} = this.props;
|
||||
|
||||
let mugicCounters = [];
|
||||
if (card.gsx$cost == 0) {
|
||||
|
|
@ -35,7 +36,8 @@ export default class Attack extends React.Component {
|
|||
<Name name={card.gsx$name} /><br />
|
||||
<Rarity set={card.gsx$set} rarity={card.gsx$rarity} /> <br />
|
||||
<Tribe size="icon16" tribe={card.gsx$tribe} /> Mugic - {card.gsx$tribe}<br />
|
||||
<span>{mugicCounters}</span><MugicPlay notes={card.gsx$notes}/><br />
|
||||
<span>{mugicCounters}</span>{location.pathname.includes("/beta/") &&
|
||||
<MugicPlay notes={card.gsx$notes}/>}<br />
|
||||
</div>
|
||||
<br />
|
||||
<div className="right" >
|
||||
|
|
@ -62,3 +64,5 @@ export default class Attack extends React.Component {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
export default withRouter(Attack);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react';
|
||||
import {render} from 'react-dom';
|
||||
import {BrowserRouter as Router, Link, Route, Switch} from 'react-router-dom';
|
||||
import {BrowserRouter as Router, Link, Route, Switch, Redirect} from 'react-router-dom';
|
||||
import loadable from '@loadable/component';
|
||||
import s from '../styles/app.style';
|
||||
|
||||
|
|
@ -29,6 +29,21 @@ const Collection = loadable(
|
|||
{fallback: <Loading />}
|
||||
);
|
||||
|
||||
/**
|
||||
* This function is to define beta routes
|
||||
*/
|
||||
function BetaRoutingWrapper(props) {
|
||||
return (
|
||||
<Switch>
|
||||
<Route path="/beta/collection" component={Collection} />
|
||||
<Route path="/beta">
|
||||
{({location}) => <Redirect to={location.pathname.replace("/beta", "")} /> }
|
||||
</Route>
|
||||
<Route component={Routing} />
|
||||
</Switch>
|
||||
);
|
||||
}
|
||||
|
||||
function Routing(props) {
|
||||
return (
|
||||
<Switch>
|
||||
|
|
@ -49,7 +64,7 @@ function Base(props) {
|
|||
const language = "ENG";
|
||||
const bkgrnd = "05";
|
||||
|
||||
const children = <Routing {...props} />;
|
||||
const children = <BetaRoutingWrapper />;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
|
|
@ -173,4 +188,4 @@ render(
|
|||
<Base path="/*" href="/" />
|
||||
</Router>
|
||||
, document.getElementById('root'),
|
||||
);
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
const Tone = require('tone');
|
||||
import {Transport, Synth, Part} from 'tone';
|
||||
|
||||
// https://github.com/Tonejs/Tone.js/wiki/Time
|
||||
// https://github.com/Tonejs/Tone.js/wiki/Events
|
||||
|
|
@ -14,13 +14,13 @@ export class Note {
|
|||
}
|
||||
|
||||
get pair() {
|
||||
return [this.time + "/4n", this.pitch + this.octave.toString()];
|
||||
return [this.time + "/4m", this.pitch + this.octave.toString()];
|
||||
}
|
||||
}
|
||||
|
||||
class MugicPlayer {
|
||||
private static instance: MugicPlayer;
|
||||
synth: any;
|
||||
synth: Synth;
|
||||
|
||||
// Singleton
|
||||
static getInstance() {
|
||||
|
|
@ -29,68 +29,81 @@ class MugicPlayer {
|
|||
}
|
||||
|
||||
constructor() {
|
||||
this.synth = new Tone.Synth().toMaster();
|
||||
Tone.Transport.bpm.value = 100;
|
||||
this.synth = new Synth().toMaster();
|
||||
Transport.bpm.value = 100;
|
||||
}
|
||||
|
||||
// Example: Canon of Casuality
|
||||
// 2Eb 2F 2D 2G 2Bb 1A 3D
|
||||
// up down up up down up
|
||||
/**
|
||||
* Composes and plays a tune parsed from the Mugic entry
|
||||
* @input the string of Mugic notes
|
||||
*/
|
||||
// Example: Canon of Casuality
|
||||
// 2Eb 2F 2D 2G 2Bb 1A 3D
|
||||
// up down up up down up
|
||||
play(input: string) {
|
||||
let tune: Note[] = [];
|
||||
input.split(" ").forEach((note) => {
|
||||
// db notation uses duration (quarter notes) and pitch
|
||||
let d = note.match(/(?:[1-8]{1})/)[0];
|
||||
let n = note.split(/(?:[1-8]{1})/)[1];
|
||||
tune.push(new Note(parseInt(d), parseNote(n, tune)));
|
||||
});
|
||||
let tune: Note[];
|
||||
|
||||
let output = tune.map((note) => {return note.pair});
|
||||
|
||||
console.log(output);
|
||||
try {
|
||||
tune = parseTune(input);
|
||||
}
|
||||
catch (error) {
|
||||
// TODO show user the error
|
||||
return;
|
||||
}
|
||||
|
||||
// new Tone.Part(
|
||||
// (time: any, pitch: any) => {
|
||||
// this.synth.triggerAttackRelease(pitch, "4n", time);
|
||||
// },
|
||||
// tune.map((note) => {return note.pair})
|
||||
// ).start(0);
|
||||
new Part(
|
||||
(time: any, pitch: any) => {
|
||||
this.synth.triggerAttackRelease(pitch, "4n", time);
|
||||
},
|
||||
tune.map((note) => {return note.pair})
|
||||
).start(0);
|
||||
|
||||
// Tone.Transport.start();
|
||||
Transport.start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// db notation uses duration (quarter notes) and pitch
|
||||
// 2Eb => E flat for 2 quarter notes
|
||||
const parseTune = (input: string): Note[] => {
|
||||
let tune: Note[] = [];
|
||||
|
||||
input.split(" ").forEach((note) => {
|
||||
|
||||
let match = note.match(/(?:[1-8]{1})/);
|
||||
if (match === null) throw new Error("invalid_input");
|
||||
|
||||
let dur = parseInt(match[0]);
|
||||
let pitch = note.split(/(?:[1-8]{1})/)[1];
|
||||
|
||||
tune.push(new Note(dur, parseNote(pitch, tune)));
|
||||
});
|
||||
|
||||
return tune;
|
||||
}
|
||||
|
||||
/*
|
||||
We have an array of previous notes; for the first to cases the octave is middle (4).
|
||||
Now for the third and further note, we'll need to look at the previous notes.
|
||||
First check the "closeness" to the last note (if its within 2.5 notes).
|
||||
Go with the appropriate octave (an A above a G4 would be an A5)
|
||||
But if its not within that closeness, look at the trend.
|
||||
*/
|
||||
/**
|
||||
* Tries to find the closer note to match of the previous notes octave
|
||||
* @note The note's
|
||||
*/
|
||||
/*
|
||||
We have an array of previous notes; for the first to cases the octave is middle (4) easy.
|
||||
Now for the third and further note, we'll need to look at the previous notes.
|
||||
First check the "closness" to the last note. (if its within 2.5 notes lets say).
|
||||
Go with the appropriate octave (an A above a G4 would be an A5)
|
||||
But if its not within that closeness. Look at the trend.
|
||||
Is the last note a step down from the note before?
|
||||
If so consider that to be a higher weight. If going up, go up, if going down go down with repeated notes
|
||||
Example, a note 4 away but on a downward trend would be prioritized over a 3 away in the other direction.
|
||||
If there is no change. Pick the octive the previous notes used.
|
||||
*/
|
||||
export const parseNote = (note: string, seq: Note[]): {pitch: string, octave: number} => {
|
||||
const parseNote = (note: string, seq: Note[]): {pitch: string, octave: number} => {
|
||||
let octave: number = (() => {
|
||||
// If its the first two notes
|
||||
if (seq.length < 2) return 4;
|
||||
// If its the first note
|
||||
if (seq.length === 0) return 4;
|
||||
|
||||
const l = seq.length;
|
||||
const current = letter_to_number(note);
|
||||
const previous = letter_to_number(seq[l-1].pitch);
|
||||
const distance = compare(previous, current);
|
||||
|
||||
let previous = letter_to_number(seq[l-1].pitch);
|
||||
let current = letter_to_number(note);
|
||||
let distance = compare(previous, current);
|
||||
|
||||
// If its within two pitches of the previous, use the closest note
|
||||
// If its less than 3 pitches of the previous note, use the closest pitch
|
||||
if (distance < 3) {
|
||||
if (distance === 0) return seq[l-1].octave;
|
||||
|
||||
|
|
@ -113,33 +126,52 @@ export const parseNote = (note: string, seq: Note[]): {pitch: string, octave: nu
|
|||
return seq[l-1].octave;
|
||||
}
|
||||
|
||||
// If its slightly further away, look at the last two notes for a trend
|
||||
let prev2 = letter_to_number(seq[l-2].pitch);
|
||||
// Downward trend
|
||||
if (prev2 > previous) {
|
||||
if (previous < current) {
|
||||
return seq[l-1].octave;
|
||||
}
|
||||
return seq[l-1].octave - 1;
|
||||
}
|
||||
// upward trend
|
||||
else if (prev2 < previous) {
|
||||
if (previous < current) {
|
||||
return seq[l-1].octave;
|
||||
}
|
||||
return seq[l-1].octave + 1;
|
||||
}
|
||||
// same notes
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
return 1; // debug shouldn't reach 1
|
||||
// If its further away, look at the previous notes for a trend
|
||||
return trend(current, l, seq);
|
||||
})();
|
||||
|
||||
return {pitch: note, octave};
|
||||
}
|
||||
|
||||
/*
|
||||
* Is the last note a step down from the note before?
|
||||
* If so consider that to be a higher weight.
|
||||
* If the pattern is going up, go up, if going down go down with repeated notes
|
||||
* Example, a note 4 away but on a downward trend would be prioritized over a 3 away in the other direction.
|
||||
* If there is no change. Pick the octive the previous notes used.
|
||||
*/
|
||||
/**
|
||||
* Searches for a trend in previous notes to calculate the current octave to be used
|
||||
* For each iteration, the length is reduced so that an older set of notes is compared
|
||||
* @param current The note being calculated
|
||||
* @param length The length of the array to be compared
|
||||
*/
|
||||
const trend = (current: number, l: number, seq: Note[]): number => {
|
||||
if (l < 2) return seq[l-1].octave;
|
||||
|
||||
let prev = letter_to_number(seq[l-1].pitch);
|
||||
let prev2 = letter_to_number(seq[l-2].pitch);
|
||||
|
||||
// downward trend
|
||||
if (prev2 > prev) {
|
||||
if (prev < current) {
|
||||
return seq[l-1].octave;
|
||||
}
|
||||
return seq[l-1].octave - 1;
|
||||
}
|
||||
// upward trend
|
||||
else if (prev2 < prev) {
|
||||
if (prev < current) {
|
||||
return seq[l-1].octave;
|
||||
}
|
||||
return seq[l-1].octave + 1;
|
||||
}
|
||||
// same notes
|
||||
else {
|
||||
return trend(current, l-1, seq);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes two pitches and returns the distance between them
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
/*eslint global-require: "off"*/
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
||||
const TerserWebpackPlugin = require('terser-webpack-plugin');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
||||
require('@babel/register');
|
||||
|
||||
const devMode = (process.env.NODE_ENV !== 'production' && process.argv.indexOf('-p') === -1);
|
||||
|
||||
const config = {
|
||||
module.exports = {
|
||||
entry: ['@babel/polyfill', './src/components/index.js'],
|
||||
|
||||
resolve: {
|
||||
|
|
@ -31,11 +31,20 @@ const config = {
|
|||
|
||||
optimization: {
|
||||
minimizer: [
|
||||
new UglifyJsPlugin({
|
||||
// https://www.stackery.io/blog/webpack-upgrade/
|
||||
new TerserWebpackPlugin({
|
||||
cache: true,
|
||||
parallel: true,
|
||||
sourceMap: true,
|
||||
extractComments: true,
|
||||
terserOptions: {
|
||||
parse: {
|
||||
ecma: 8
|
||||
},
|
||||
output: {
|
||||
comments: false
|
||||
}
|
||||
}
|
||||
}),
|
||||
new OptimizeCSSAssetsPlugin({}),
|
||||
],
|
||||
|
|
@ -78,13 +87,14 @@ const config = {
|
|||
options: {
|
||||
presets: [
|
||||
'@babel/typescript',
|
||||
"@babel/preset-env",
|
||||
'@babel/preset-env',
|
||||
'@babel/preset-react',
|
||||
'@babel/preset-flow',
|
||||
],
|
||||
plugins: [
|
||||
'@babel/plugin-transform-runtime',
|
||||
'@babel/plugin-proposal-object-rest-spread',
|
||||
'@babel/plugin-syntax-dynamic-import',
|
||||
['@babel/plugin-proposal-decorators', {legacy: true}],
|
||||
['@babel/plugin-proposal-class-properties', {loose: true}],
|
||||
['@babel/plugin-transform-computed-properties', {loose: true}],
|
||||
|
|
@ -118,6 +128,3 @@ const config = {
|
|||
}),
|
||||
],
|
||||
};
|
||||
|
||||
// Exports
|
||||
module.exports = config;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user