From 5f68afca1b4ced1d89aad57e3010c27846cedd7e Mon Sep 17 00:00:00 2001 From: Durvenson Date: Thu, 21 May 2020 22:21:44 -0400 Subject: [PATCH 01/20] yes adding game --- elementalthing/elemental.css | 22 ++++++++++++++++++++++ elementalthing/elemental.html | 12 ++++++++++++ elementalthing/elemental.js | 16 ++++++++++++++++ elementalthing/elemental.json | 0 4 files changed, 50 insertions(+) create mode 100644 elementalthing/elemental.json diff --git a/elementalthing/elemental.css b/elementalthing/elemental.css index e69de29..acf8779 100644 --- a/elementalthing/elemental.css +++ b/elementalthing/elemental.css @@ -0,0 +1,22 @@ +body { + font-family: 'Balsamiq Sans', cursive; +} +button { + margin-top: 3px; + margin-bottom: 3px; + margin-left: 3px; + margin-right: 3px; + width: 100px; + height: 100px; + font-size: 12px; + outline: 0px; + border: 1px solid black; + border-radius: 12px; + animation: textshrink 1s; + transition:all 0.3s ease; +} +button:hover { + -webkit-transform: scale(1.33); + -ms-transform: scale(1.33); + transform: scale(1.33); +} \ No newline at end of file diff --git a/elementalthing/elemental.html b/elementalthing/elemental.html index e69de29..7407482 100644 --- a/elementalthing/elemental.html +++ b/elementalthing/elemental.html @@ -0,0 +1,12 @@ + + + Elemental + + + + + + + +

+ \ No newline at end of file diff --git a/elementalthing/elemental.js b/elementalthing/elemental.js index e69de29..b89d6ab 100644 --- a/elementalthing/elemental.js +++ b/elementalthing/elemental.js @@ -0,0 +1,16 @@ +function combinationof() { + var element = event.srcElement.id; + combo = combo.concat([' ' + element]); + document.getElementById("combo").style.width = Math.pow(combo.length,0.5)*100; + document.getElementById("combo").style.height = Math.pow(combo.length,0.5)*100; + document.getElementById("combo").innerHTML = combo.toString(); +} +function createButton(element, color) { + var button = document.createElement("button"); + button.innerHTML = element; + button.id = element; + button.style.backgroundColor = color; + button.setAttribute( "onClick", "combinationof()"); + document.getElementById("elements").appendChild(button); +} +let combo = []; diff --git a/elementalthing/elemental.json b/elementalthing/elemental.json new file mode 100644 index 0000000..e69de29 From 727d4b29983a0410a6149412f85b1975cbfda063 Mon Sep 17 00:00:00 2001 From: Durvenson Date: Fri, 22 May 2020 04:55:42 -0400 Subject: [PATCH 02/20] yes adding game --- elementalthing/elemental.html | 11 +++++++--- elementalthing/elemental.js | 38 ++++++++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/elementalthing/elemental.html b/elementalthing/elemental.html index 7407482..ce4b2a1 100644 --- a/elementalthing/elemental.html +++ b/elementalthing/elemental.html @@ -3,10 +3,15 @@ Elemental + + - -

- \ No newline at end of file + +

+ + +

+ diff --git a/elementalthing/elemental.js b/elementalthing/elemental.js index b89d6ab..d249358 100644 --- a/elementalthing/elemental.js +++ b/elementalthing/elemental.js @@ -4,13 +4,49 @@ function combinationof() { document.getElementById("combo").style.width = Math.pow(combo.length,0.5)*100; document.getElementById("combo").style.height = Math.pow(combo.length,0.5)*100; document.getElementById("combo").innerHTML = combo.toString(); + document.getElementById("combo").style.backgroundColor = "#44FF44";; +} +function getRGBValues(str) { + var vals = str.substring(str.indexOf('(') +1, a.length -1).split(', '); + return { + 'r': vals[0], + 'g': vals[1], + 'b': vals[2] + }; } function createButton(element, color) { var button = document.createElement("button"); button.innerHTML = element; button.id = element; button.style.backgroundColor = color; + var rgb = color.match(/\d+/g); + if (rgb[0] + rgb[1] + rgb[2] < 383) { + button.style.color = "#FFFFFF"; + } button.setAttribute( "onClick", "combinationof()"); document.getElementById("elements").appendChild(button); } -let combo = []; +document.addEventListener('keyup', function (event) { + if (event.defaultPrevented) { + return; + } + + var key = event.key || event.keyCode; + + if (key === 'Backspace') { + combo.length = combo.length - 1; + if (combo.length == 0) { + document.getElementById("combo").innerHTML = "Click on elements to add them to the combo list."; + document.getElementById("combo").style.width = 200; + document.getElementById("combo").style.height = 200; + document.getElementById("combo").style.backgroundColor = "#FF4444"; + } + else { + document.getElementById("combo").style.width = Math.pow(combo.length,0.5)*100; + document.getElementById("combo").style.height = Math.pow(combo.length,0.5)*100; + document.getElementById("combo").innerHTML = combo.toString(); + document.getElementById("combo").style.backgroundColor = "#44FF44"; + } + } +}); +let combo = []; \ No newline at end of file From 6c3ef010259613537cc44e6d3af789ee72ca6647 Mon Sep 17 00:00:00 2001 From: Durvenson Date: Fri, 22 May 2020 05:34:21 -0400 Subject: [PATCH 03/20] e e --- elementalthing/elemental.html | 2 ++ elementalthing/elemental.js | 15 ++++++++++++++- elementalthing/elemental.json | 10 ++++++++++ elementalthing/jquery-3.5.1.min.js | 2 ++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 elementalthing/jquery-3.5.1.min.js diff --git a/elementalthing/elemental.html b/elementalthing/elemental.html index ce4b2a1..b6b0220 100644 --- a/elementalthing/elemental.html +++ b/elementalthing/elemental.html @@ -3,9 +3,11 @@ Elemental + + diff --git a/elementalthing/elemental.js b/elementalthing/elemental.js index d249358..2a62cc5 100644 --- a/elementalthing/elemental.js +++ b/elementalthing/elemental.js @@ -26,6 +26,14 @@ function createButton(element, color) { button.setAttribute( "onClick", "combinationof()"); document.getElementById("elements").appendChild(button); } +function getthestuff() { + $.getJSON('elemental.json', function (data) { + starterElements = data.starter; + compoundElements = data.compound; + }).error(function(){ + console.log('error: json not loaded'); + }); +} document.addEventListener('keyup', function (event) { if (event.defaultPrevented) { return; @@ -49,4 +57,9 @@ document.addEventListener('keyup', function (event) { } } }); -let combo = []; \ No newline at end of file + +let combo = []; +var allQuestions = new Array(); +getthestuff(); +var firstfour = starter.starter; +var keys = Object.keys(firstfour); \ No newline at end of file diff --git a/elementalthing/elemental.json b/elementalthing/elemental.json index e69de29..4468324 100644 --- a/elementalthing/elemental.json +++ b/elementalthing/elemental.json @@ -0,0 +1,10 @@ +"starter": {"starter": [ + "earth": { + "id": 1 + "color": "rgb(191,128,64) + } + } +]} +"compound": {[ + +]} \ No newline at end of file diff --git a/elementalthing/jquery-3.5.1.min.js b/elementalthing/jquery-3.5.1.min.js new file mode 100644 index 0000000..d467083 --- /dev/null +++ b/elementalthing/jquery-3.5.1.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0 Date: Fri, 22 May 2020 06:14:44 -0400 Subject: [PATCH 04/20] s s --- elementalthing/elemental.html | 1 - elementalthing/elemental.js | 20 ++++++++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/elementalthing/elemental.html b/elementalthing/elemental.html index b6b0220..537fecf 100644 --- a/elementalthing/elemental.html +++ b/elementalthing/elemental.html @@ -3,7 +3,6 @@ Elemental - diff --git a/elementalthing/elemental.js b/elementalthing/elemental.js index 2a62cc5..441be1d 100644 --- a/elementalthing/elemental.js +++ b/elementalthing/elemental.js @@ -14,6 +14,13 @@ function getRGBValues(str) { 'b': vals[2] }; } +function init() { + loadJSON(function(response) { + // Parse JSON string into object + var actual_JSON = JSON.parse(response); + console.log(actual_JSON); + }); +} function createButton(element, color) { var button = document.createElement("button"); button.innerHTML = element; @@ -26,14 +33,6 @@ function createButton(element, color) { button.setAttribute( "onClick", "combinationof()"); document.getElementById("elements").appendChild(button); } -function getthestuff() { - $.getJSON('elemental.json', function (data) { - starterElements = data.starter; - compoundElements = data.compound; - }).error(function(){ - console.log('error: json not loaded'); - }); -} document.addEventListener('keyup', function (event) { if (event.defaultPrevented) { return; @@ -59,7 +58,4 @@ document.addEventListener('keyup', function (event) { }); let combo = []; -var allQuestions = new Array(); -getthestuff(); -var firstfour = starter.starter; -var keys = Object.keys(firstfour); \ No newline at end of file +init(); \ No newline at end of file From 8166d77f1f603d1b50cb6973825ec765187a0d5b Mon Sep 17 00:00:00 2001 From: Durvenson Date: Fri, 22 May 2020 12:23:14 -0400 Subject: [PATCH 05/20] fewa --- elementalthing/elemental.css | 2 +- elementalthing/elemental.html | 5 ++--- elementalthing/elemental.js | 30 +++++++++++++++--------------- elementalthing/package.json | 6 ++++++ elementalthing/socket.io.js | 9 +++++++++ 5 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 elementalthing/package.json create mode 100644 elementalthing/socket.io.js diff --git a/elementalthing/elemental.css b/elementalthing/elemental.css index acf8779..7973407 100644 --- a/elementalthing/elemental.css +++ b/elementalthing/elemental.css @@ -11,7 +11,7 @@ button { font-size: 12px; outline: 0px; border: 1px solid black; - border-radius: 12px; + border-radius: 12.5%; animation: textshrink 1s; transition:all 0.3s ease; } diff --git a/elementalthing/elemental.html b/elementalthing/elemental.html index 537fecf..86a717e 100644 --- a/elementalthing/elemental.html +++ b/elementalthing/elemental.html @@ -3,14 +3,13 @@ Elemental + - - - +

diff --git a/elementalthing/elemental.js b/elementalthing/elemental.js index 441be1d..ee37d9e 100644 --- a/elementalthing/elemental.js +++ b/elementalthing/elemental.js @@ -1,10 +1,10 @@ function combinationof() { - var element = event.srcElement.id; - combo = combo.concat([' ' + element]); + var elemental = event.srcElement.id; + combo = combo.concat([' ' + elemental]); document.getElementById("combo").style.width = Math.pow(combo.length,0.5)*100; document.getElementById("combo").style.height = Math.pow(combo.length,0.5)*100; document.getElementById("combo").innerHTML = combo.toString(); - document.getElementById("combo").style.backgroundColor = "#44FF44";; + document.getElementById("combo").style.backgroundColor = "#44FF44"; } function getRGBValues(str) { var vals = str.substring(str.indexOf('(') +1, a.length -1).split(', '); @@ -14,17 +14,10 @@ function getRGBValues(str) { 'b': vals[2] }; } -function init() { - loadJSON(function(response) { - // Parse JSON string into object - var actual_JSON = JSON.parse(response); - console.log(actual_JSON); - }); -} -function createButton(element, color) { +function createButton(elementthing, color) { var button = document.createElement("button"); - button.innerHTML = element; - button.id = element; + button.innerHTML = elementthing; + button.id = elementthing; button.style.backgroundColor = color; var rgb = color.match(/\d+/g); if (rgb[0] + rgb[1] + rgb[2] < 383) { @@ -33,6 +26,13 @@ function createButton(element, color) { button.setAttribute( "onClick", "combinationof()"); document.getElementById("elements").appendChild(button); } +function elemresult(combinations,id) { + for (var i = 0; i < Object.values(json).length; i++) { + if (Object.values(json)[i][id] == combinations) { + return i; + } + } +} document.addEventListener('keyup', function (event) { if (event.defaultPrevented) { return; @@ -55,7 +55,7 @@ document.addEventListener('keyup', function (event) { document.getElementById("combo").style.backgroundColor = "#44FF44"; } } -}); +}) let combo = []; -init(); \ No newline at end of file +var json = {"Earth": [[],1,"#BB6644"], "Fire": [[],2,"#FF8844"], "Air": [[],3,"#8888FF"], "Water": [[],4,"#4444FF"], "Dust": [[1,3],5,"#888888"]} \ No newline at end of file diff --git a/elementalthing/package.json b/elementalthing/package.json new file mode 100644 index 0000000..e42265a --- /dev/null +++ b/elementalthing/package.json @@ -0,0 +1,6 @@ +{ + "name": "elemental", + "version": "0.0.1", + "description": "my first socket.io app", + "dependencies": {} +} \ No newline at end of file diff --git a/elementalthing/socket.io.js b/elementalthing/socket.io.js new file mode 100644 index 0000000..270777b --- /dev/null +++ b/elementalthing/socket.io.js @@ -0,0 +1,9 @@ +/*! + * Socket.IO v2.3.0 + * (c) 2014-2019 Guillermo Rauch + * Released under the MIT License. + */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.io=e():t.io=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){function r(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,r=o(t),i=r.source,u=r.id,p=r.path,h=c[u]&&p in c[u].nsps,f=e.forceNew||e["force new connection"]||!1===e.multiplex||h;return f?(a("ignoring socket cache for %s",i),n=s(i,e)):(c[u]||(a("new io instance for %s",i),c[u]=s(i,e)),n=c[u]),r.query&&!e.query&&(e.query=r.query),n.socket(r.path,e)}var o=n(1),i=n(7),s=n(15),a=n(3)("socket.io-client");t.exports=e=r;var c=e.managers={};e.protocol=i.protocol,e.connect=r,e.Manager=n(15),e.Socket=n(39)},function(t,e,n){function r(t,e){var n=t;e=e||"undefined"!=typeof location&&location,null==t&&(t=e.protocol+"//"+e.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?e.protocol+t:e.host+t),/^(https?|wss?):\/\//.test(t)||(i("protocol-less url %s",t),t="undefined"!=typeof e?e.protocol+"//"+t:"https://"+t),i("parse %s",t),n=o(t)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";var r=n.host.indexOf(":")!==-1,s=r?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port,n.href=n.protocol+"://"+s+(e&&e.port===n.port?"":":"+n.port),n}var o=n(2),i=n(3)("socket.io-client:url");t.exports=r},function(t,e){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(t){var e=t,o=t.indexOf("["),i=t.indexOf("]");o!=-1&&i!=-1&&(t=t.substring(0,o)+t.substring(o,i).replace(/:/g,";")+t.substring(i,t.length));for(var s=n.exec(t||""),a={},c=14;c--;)a[r[c]]=s[c]||"";return o!=-1&&i!=-1&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a}},function(t,e,n){(function(r){"use strict";function o(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function i(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),this.useColors){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var r=0,o=0;e[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&(r++,"%c"===t&&(o=r))}),e.splice(o,0,n)}}function s(){var t;return"object"===("undefined"==typeof console?"undefined":p(console))&&console.log&&(t=console).log.apply(t,arguments)}function a(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(n){}}function c(){var t=void 0;try{t=e.storage.getItem("debug")}catch(n){}return!t&&"undefined"!=typeof r&&"env"in r&&(t=r.env.DEBUG),t}function u(){try{return localStorage}catch(t){}}var p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.log=s,e.formatArgs=i,e.save=a,e.load=c,e.useColors=o,e.storage=u(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.exports=n(5)(e);var h=t.exports.formatters;h.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(e,n(4))},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(p===setTimeout)return setTimeout(t,0);if((p===n||!p)&&setTimeout)return p=setTimeout,setTimeout(t,0);try{return p(t,0)}catch(e){try{return p.call(null,t,0)}catch(e){return p.call(this,t,0)}}}function i(t){if(h===clearTimeout)return clearTimeout(t);if((h===r||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function s(){y&&l&&(y=!1,l.length?d=l.concat(d):m=-1,d.length&&a())}function a(){if(!y){var t=o(s);y=!0;for(var e=d.length;e;){for(l=d,d=[];++m1)for(var n=1;n100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*h;case"weeks":case"week":case"w":return n*p;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"hrs":case"hr":case"h":return n*c;case"minutes":case"minute":case"mins":case"min":case"m":return n*a;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function r(t){var e=Math.abs(t);return e>=u?Math.round(t/u)+"d":e>=c?Math.round(t/c)+"h":e>=a?Math.round(t/a)+"m":e>=s?Math.round(t/s)+"s":t+"ms"}function o(t){var e=Math.abs(t);return e>=u?i(t,e,u,"day"):e>=c?i(t,e,c,"hour"):e>=a?i(t,e,a,"minute"):e>=s?i(t,e,s,"second"):t+" ms"}function i(t,e,n,r){var o=e>=1.5*n;return Math.round(t/n)+" "+r+(o?"s":"")}var s=1e3,a=60*s,c=60*a,u=24*c,p=7*u,h=365.25*u;t.exports=function(t,e){e=e||{};var i=typeof t;if("string"===i&&t.length>0)return n(t);if("number"===i&&isFinite(t))return e["long"]?o(t):r(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,n){function r(){}function o(t){var n=""+t.type;if(e.BINARY_EVENT!==t.type&&e.BINARY_ACK!==t.type||(n+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(n+=t.nsp+","),null!=t.id&&(n+=t.id),null!=t.data){var r=i(t.data);if(r===!1)return g;n+=r}return f("encoded %j as %s",t,n),n}function i(t){try{return JSON.stringify(t)}catch(e){return!1}}function s(t,e){function n(t){var n=d.deconstructPacket(t),r=o(n.packet),i=n.buffers;i.unshift(r),e(i)}d.removeBlobs(t,n)}function a(){this.reconstructor=null}function c(t){var n=0,r={type:Number(t.charAt(0))};if(null==e.types[r.type])return h("unknown packet type "+r.type);if(e.BINARY_EVENT===r.type||e.BINARY_ACK===r.type){for(var o="";"-"!==t.charAt(++n)&&(o+=t.charAt(n),n!=t.length););if(o!=Number(o)||"-"!==t.charAt(n))throw new Error("Illegal attachments");r.attachments=Number(o)}if("/"===t.charAt(n+1))for(r.nsp="";++n;){var i=t.charAt(n);if(","===i)break;if(r.nsp+=i,n===t.length)break}else r.nsp="/";var s=t.charAt(n+1);if(""!==s&&Number(s)==s){for(r.id="";++n;){var i=t.charAt(n);if(null==i||Number(i)!=i){--n;break}if(r.id+=t.charAt(n),n===t.length)break}r.id=Number(r.id)}if(t.charAt(++n)){var a=u(t.substr(n)),c=a!==!1&&(r.type===e.ERROR||y(a));if(!c)return h("invalid payload");r.data=a}return f("decoded %s as %j",t,r),r}function u(t){try{return JSON.parse(t)}catch(e){return!1}}function p(t){this.reconPack=t,this.buffers=[]}function h(t){return{type:e.ERROR,data:"parser error: "+t}}var f=n(8)("socket.io-parser"),l=n(11),d=n(12),y=n(13),m=n(14);e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=r,e.Decoder=a;var g=e.ERROR+'"encode error"';r.prototype.encode=function(t,n){if(f("encoding packet %j",t),e.BINARY_EVENT===t.type||e.BINARY_ACK===t.type)s(t,n);else{var r=o(t);n([r])}},l(a.prototype),a.prototype.add=function(t){var n;if("string"==typeof t)n=c(t),e.BINARY_EVENT===n.type||e.BINARY_ACK===n.type?(this.reconstructor=new p(n),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",n)):this.emit("decoded",n);else{if(!m(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,this.emit("decoded",n))}},a.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},p.prototype.takeBinaryData=function(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var e=d.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null},p.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(t,e,n){(function(r){"use strict";function o(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function i(t){var n=this.useColors;if(t[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+t[0]+(n?"%c ":" ")+"+"+e.humanize(this.diff),n){var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&(o++,"%c"===t&&(i=o))}),t.splice(i,0,r)}}function s(){return"object"===("undefined"==typeof console?"undefined":p(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(n){}}function c(){var t;try{t=e.storage.debug}catch(n){}return!t&&"undefined"!=typeof r&&"env"in r&&(t=r.env.DEBUG),t}function u(){try{return window.localStorage}catch(t){}}var p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e=t.exports=n(9),e.log=s,e.formatArgs=i,e.save=a,e.load=c,e.useColors=o,e.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:u(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},e.enable(c())}).call(e,n(4))},function(t,e,n){"use strict";function r(t){var n,r=0;for(n in t)r=(r<<5)-r+t.charCodeAt(n),r|=0;return e.colors[Math.abs(r)%e.colors.length]}function o(t){function n(){if(n.enabled){var t=n,r=+new Date,i=r-(o||r);t.diff=i,t.prev=o,t.curr=r,o=r;for(var s=new Array(arguments.length),a=0;a100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*p;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"hrs":case"hr":case"h":return n*c;case"minutes":case"minute":case"mins":case"min":case"m":return n*a;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function r(t){return t>=u?Math.round(t/u)+"d":t>=c?Math.round(t/c)+"h":t>=a?Math.round(t/a)+"m":t>=s?Math.round(t/s)+"s":t+"ms"}function o(t){return i(t,u,"day")||i(t,c,"hour")||i(t,a,"minute")||i(t,s,"second")||t+" ms"}function i(t,e,n){if(!(t0)return n(t);if("number"===i&&isNaN(t)===!1)return e["long"]?o(t):r(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,n){function r(t){if(t)return o(t)}function o(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}t.exports=r,r.prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},r.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var r,o=0;o0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},r.prototype.cleanup=function(){p("cleanup");for(var t=this.subs.length,e=0;e=this._reconnectionAttempts)p("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();p("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var n=setTimeout(function(){t.skipReconnect||(p("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open(function(e){e?(p("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):(p("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(n)}})}},r.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},function(t,e,n){t.exports=n(17),t.exports.parser=n(24)},function(t,e,n){function r(t,e){return this instanceof r?(e=e||{},t&&"object"==typeof t&&(e=t,t=null),t?(t=p(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=p(e.host).host),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.agent=e.agent||!1,this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?443:80),this.query=e.query||{},"string"==typeof this.query&&(this.query=h.decode(this.query)),this.upgrade=!1!==e.upgrade,this.path=(e.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!e.forceJSONP,this.jsonp=!1!==e.jsonp,this.forceBase64=!!e.forceBase64,this.enablesXDR=!!e.enablesXDR,this.withCredentials=!1!==e.withCredentials,this.timestampParam=e.timestampParam||"t",this.timestampRequests=e.timestampRequests,this.transports=e.transports||["polling","websocket"],this.transportOptions=e.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=e.policyPort||843,this.rememberUpgrade=e.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=e.onlyBinaryUpgrades,this.perMessageDeflate=!1!==e.perMessageDeflate&&(e.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=e.pfx||null,this.key=e.key||null,this.passphrase=e.passphrase||null,this.cert=e.cert||null,this.ca=e.ca||null,this.ciphers=e.ciphers||null,this.rejectUnauthorized=void 0===e.rejectUnauthorized||e.rejectUnauthorized,this.forceNode=!!e.forceNode,this.isReactNative="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),("undefined"==typeof self||this.isReactNative)&&(e.extraHeaders&&Object.keys(e.extraHeaders).length>0&&(this.extraHeaders=e.extraHeaders),e.localAddress&&(this.localAddress=e.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,void this.open()):new r(t,e)}function o(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var i=n(18),s=n(11),a=n(3)("engine.io-client:socket"),c=n(38),u=n(24),p=n(2),h=n(32);t.exports=r,r.priorWebsocketSuccess=!1,s(r.prototype),r.protocol=u.protocol,r.Socket=r,r.Transport=n(23),r.transports=n(18),r.parser=n(24),r.prototype.createTransport=function(t){a('creating transport "%s"',t);var e=o(this.query);e.EIO=u.protocol,e.transport=t;var n=this.transportOptions[t]||{};this.id&&(e.sid=this.id);var r=new i[t]({query:e,socket:this,agent:n.agent||this.agent,hostname:n.hostname||this.hostname,port:n.port||this.port,secure:n.secure||this.secure,path:n.path||this.path,forceJSONP:n.forceJSONP||this.forceJSONP,jsonp:n.jsonp||this.jsonp,forceBase64:n.forceBase64||this.forceBase64,enablesXDR:n.enablesXDR||this.enablesXDR,withCredentials:n.withCredentials||this.withCredentials,timestampRequests:n.timestampRequests||this.timestampRequests,timestampParam:n.timestampParam||this.timestampParam,policyPort:n.policyPort||this.policyPort,pfx:n.pfx||this.pfx,key:n.key||this.key,passphrase:n.passphrase||this.passphrase,cert:n.cert||this.cert,ca:n.ca||this.ca,ciphers:n.ciphers||this.ciphers,rejectUnauthorized:n.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:n.perMessageDeflate||this.perMessageDeflate,extraHeaders:n.extraHeaders||this.extraHeaders,forceNode:n.forceNode||this.forceNode,localAddress:n.localAddress||this.localAddress,requestTimeout:n.requestTimeout||this.requestTimeout,protocols:n.protocols||void 0,isReactNative:this.isReactNative});return r},r.prototype.open=function(){var t;if(this.rememberUpgrade&&r.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else{ +if(0===this.transports.length){var e=this;return void setTimeout(function(){e.emit("error","No transports available")},0)}t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(n){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)},r.prototype.setTransport=function(t){a("setting transport %s",t.name);var e=this;this.transport&&(a("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",function(){e.onDrain()}).on("packet",function(t){e.onPacket(t)}).on("error",function(t){e.onError(t)}).on("close",function(){e.onClose("transport close")})},r.prototype.probe=function(t){function e(){if(f.onlyBinaryUpgrades){var e=!this.supportsBinary&&f.transport.supportsBinary;h=h||e}h||(a('probe transport "%s" opened',t),p.send([{type:"ping",data:"probe"}]),p.once("packet",function(e){if(!h)if("pong"===e.type&&"probe"===e.data){if(a('probe transport "%s" pong',t),f.upgrading=!0,f.emit("upgrading",p),!p)return;r.priorWebsocketSuccess="websocket"===p.name,a('pausing current transport "%s"',f.transport.name),f.transport.pause(function(){h||"closed"!==f.readyState&&(a("changing transport and sending upgrade packet"),u(),f.setTransport(p),p.send([{type:"upgrade"}]),f.emit("upgrade",p),p=null,f.upgrading=!1,f.flush())})}else{a('probe transport "%s" failed',t);var n=new Error("probe error");n.transport=p.name,f.emit("upgradeError",n)}}))}function n(){h||(h=!0,u(),p.close(),p=null)}function o(e){var r=new Error("probe error: "+e);r.transport=p.name,n(),a('probe transport "%s" failed because of error: %s',t,e),f.emit("upgradeError",r)}function i(){o("transport closed")}function s(){o("socket closed")}function c(t){p&&t.name!==p.name&&(a('"%s" works - aborting "%s"',t.name,p.name),n())}function u(){p.removeListener("open",e),p.removeListener("error",o),p.removeListener("close",i),f.removeListener("close",s),f.removeListener("upgrading",c)}a('probing transport "%s"',t);var p=this.createTransport(t,{probe:1}),h=!1,f=this;r.priorWebsocketSuccess=!1,p.once("open",e),p.once("error",o),p.once("close",i),this.once("close",s),this.once("upgrading",c),p.open()},r.prototype.onOpen=function(){if(a("socket open"),this.readyState="open",r.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){a("starting upgrade probes");for(var t=0,e=this.upgrades.length;t1?{type:b[o],data:t.substring(1)}:{type:b[o]}:C}var i=new Uint8Array(t),o=i[0],s=f(t,1);return w&&"blob"===n&&(s=new w([s])),{type:b[o],data:s}},e.decodeBase64Packet=function(t,e){var n=b[t.charAt(0)];if(!u)return{type:n,data:{base64:!0,data:t.substr(1)}};var r=u.decode(t.substr(1));return"blob"===e&&w&&(r=new w([r])),{type:n,data:r}},e.encodePayload=function(t,n,r){function o(t){return t.length+":"+t}function i(t,r){e.encodePacket(t,!!s&&n,!1,function(t){r(null,o(t))})}"function"==typeof n&&(r=n,n=null);var s=h(t);return n&&s?w&&!g?e.encodePayloadAsBlob(t,r):e.encodePayloadAsArrayBuffer(t,r):t.length?void c(t,i,function(t,e){return r(e.join(""))}):r("0:")},e.decodePayload=function(t,n,r){if("string"!=typeof t)return e.decodePayloadAsBinary(t,n,r);"function"==typeof n&&(r=n,n=null);var o;if(""===t)return r(C,0,1);for(var i,s,a="",c=0,u=t.length;c0;){for(var s=new Uint8Array(o),a=0===s[0],c="",u=1;255!==s[u];u++){if(c.length>310)return r(C,0,1);c+=s[u]}o=f(o,2+c.length),c=parseInt(c);var p=f(o,0,c);if(a)try{p=String.fromCharCode.apply(null,new Uint8Array(p))}catch(h){var l=new Uint8Array(p);p="";for(var u=0;ur&&(n=r),e>=r||e>=n||0===r)return new ArrayBuffer(0);for(var o=new Uint8Array(t),i=new Uint8Array(n-e),s=e,a=0;s=55296&&e<=56319&&o65535&&(e-=65536,o+=d(e>>>10&1023|55296),e=56320|1023&e),o+=d(e);return o}function o(t,e){if(t>=55296&&t<=57343){if(e)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function i(t,e){return d(t>>e&63|128)}function s(t,e){if(0==(4294967168&t))return d(t);var n="";return 0==(4294965248&t)?n=d(t>>6&31|192):0==(4294901760&t)?(o(t,e)||(t=65533),n=d(t>>12&15|224),n+=i(t,6)):0==(4292870144&t)&&(n=d(t>>18&7|240),n+=i(t,12),n+=i(t,6)),n+=d(63&t|128)}function a(t,e){e=e||{};for(var r,o=!1!==e.strict,i=n(t),a=i.length,c=-1,u="";++c=f)throw Error("Invalid byte index");var t=255&h[l];if(l++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function u(t){var e,n,r,i,s;if(l>f)throw Error("Invalid byte index");if(l==f)return!1;if(e=255&h[l],l++,0==(128&e))return e;if(192==(224&e)){if(n=c(),s=(31&e)<<6|n,s>=128)return s;throw Error("Invalid continuation byte")}if(224==(240&e)){if(n=c(),r=c(),s=(15&e)<<12|n<<6|r,s>=2048)return o(s,t)?s:65533;throw Error("Invalid continuation byte")}if(240==(248&e)&&(n=c(),r=c(),i=c(),s=(7&e)<<18|n<<12|r<<6|i,s>=65536&&s<=1114111))return s;throw Error("Invalid UTF-8 detected")}function p(t,e){e=e||{};var o=!1!==e.strict;h=n(t),f=h.length,l=0;for(var i,s=[];(i=u(o))!==!1;)s.push(i);return r(s)}/*! https://mths.be/utf8js v2.1.2 by @mathias */ +var h,f,l,d=String.fromCharCode;t.exports={version:"2.1.2",encode:a,decode:p}},function(t,e){!function(){"use strict";for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(256),r=0;r>2],i+=t[(3&r[n])<<4|r[n+1]>>4],i+=t[(15&r[n+1])<<2|r[n+2]>>6],i+=t[63&r[n+2]];return o%3===2?i=i.substring(0,i.length-1)+"=":o%3===1&&(i=i.substring(0,i.length-2)+"=="),i},e.decode=function(t){var e,r,o,i,s,a=.75*t.length,c=t.length,u=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var p=new ArrayBuffer(a),h=new Uint8Array(p);for(e=0;e>4,h[u++]=(15&o)<<4|i>>2,h[u++]=(3&i)<<6|63&s;return p}}()},function(t,e){function n(t){return t.map(function(t){if(t.buffer instanceof ArrayBuffer){var e=t.buffer;if(t.byteLength!==e.byteLength){var n=new Uint8Array(t.byteLength);n.set(new Uint8Array(e,t.byteOffset,t.byteLength)),e=n.buffer}return e}return t})}function r(t,e){e=e||{};var r=new i;return n(t).forEach(function(t){r.append(t)}),e.type?r.getBlob(e.type):r.getBlob()}function o(t,e){return new Blob(n(t),e||{})}var i="undefined"!=typeof i?i:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,s=function(){try{var t=new Blob(["hi"]);return 2===t.size}catch(e){return!1}}(),a=s&&function(){try{var t=new Blob([new Uint8Array([1,2])]);return 2===t.size}catch(e){return!1}}(),c=i&&i.prototype.append&&i.prototype.getBlob;"undefined"!=typeof Blob&&(r.prototype=Blob.prototype,o.prototype=Blob.prototype),t.exports=function(){return s?a?Blob:o:c?r:void 0}()},function(t,e){e.encode=function(t){var e="";for(var n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e},e.decode=function(t){for(var e={},n=t.split("&"),r=0,o=n.length;r0);return e}function r(t){var e=0;for(p=0;p';i=document.createElement(e)}catch(t){i=document.createElement("iframe"),i.name=o.iframeId,i.src="javascript:0"}i.id=o.iframeId,o.form.appendChild(i),o.iframe=i}var o=this;if(!this.form){var i,s=document.createElement("form"),a=document.createElement("textarea"),c=this.iframeId="eio_iframe_"+this.index;s.className="socketio",s.style.position="absolute",s.style.top="-1000px",s.style.left="-1000px",s.target=c,s.method="POST",s.setAttribute("accept-charset","utf-8"),a.name="d",s.appendChild(a),document.body.appendChild(s),this.form=s,this.area=a}this.form.action=this.uri(),r(),t=t.replace(p,"\\\n"),this.area.value=t.replace(u,"\\n");try{this.form.submit()}catch(h){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===o.iframe.readyState&&n()}:this.iframe.onload=n}}).call(e,function(){return this}())},function(t,e,n){function r(t){var e=t&&t.forceBase64;e&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=o&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(l=i),s.call(this,t)}var o,i,s=n(23),a=n(24),c=n(32),u=n(33),p=n(34),h=n(3)("engine.io-client:websocket");if("undefined"!=typeof WebSocket?o=WebSocket:"undefined"!=typeof self&&(o=self.WebSocket||self.MozWebSocket),"undefined"==typeof window)try{i=n(37)}catch(f){}var l=o||i;t.exports=r,u(r,s),r.prototype.name="websocket",r.prototype.supportsBinary=!0,r.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e=this.protocols,n={agent:this.agent,perMessageDeflate:this.perMessageDeflate};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(n.headers=this.extraHeaders),this.localAddress&&(n.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?e?new l(t,e):new l(t):new l(t,e,n)}catch(r){return this.emit("error",r)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},r.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},r.prototype.write=function(t){function e(){n.emit("flush"),setTimeout(function(){n.writable=!0,n.emit("drain")},0)}var n=this;this.writable=!1;for(var r=t.length,o=0,i=r;o0&&t.jitter<=1?t.jitter:0,this.attempts=0}t.exports=n,n.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-n:t+n}return 0|Math.min(t,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(t){this.ms=t},n.prototype.setMax=function(t){this.max=t},n.prototype.setJitter=function(t){this.jitter=t}}])}); +//# sourceMappingURL=socket.io.js.map \ No newline at end of file From c63cad4b7af9ad0e0c2d60b7078c041ec63e6395 Mon Sep 17 00:00:00 2001 From: Durvenson Date: Fri, 22 May 2020 13:59:43 -0400 Subject: [PATCH 06/20] MAJOR changes combining elements ftw! --- elementalthing/elemental.css | 4 ---- elementalthing/elemental.html | 10 ++++++---- elementalthing/elemental.js | 35 +++++++++++++++++++++++++++-------- 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/elementalthing/elemental.css b/elementalthing/elemental.css index 7973407..be017fc 100644 --- a/elementalthing/elemental.css +++ b/elementalthing/elemental.css @@ -2,10 +2,6 @@ body { font-family: 'Balsamiq Sans', cursive; } button { - margin-top: 3px; - margin-bottom: 3px; - margin-left: 3px; - margin-right: 3px; width: 100px; height: 100px; font-size: 12px; diff --git a/elementalthing/elemental.html b/elementalthing/elemental.html index 86a717e..e1ef374 100644 --- a/elementalthing/elemental.html +++ b/elementalthing/elemental.html @@ -9,9 +9,11 @@ +

Controls:

+ Press backspace to remove the last element from the combination square.
+ Click the combination square to combine elements.
+ Press CTRL+F to find elements.
-

- - -

+ + diff --git a/elementalthing/elemental.js b/elementalthing/elemental.js index ee37d9e..e18b432 100644 --- a/elementalthing/elemental.js +++ b/elementalthing/elemental.js @@ -1,9 +1,10 @@ function combinationof() { var elemental = event.srcElement.id; combo = combo.concat([' ' + elemental]); + comboshow = comboshow.concat([' ' + elemresult2(elemental,1)]); document.getElementById("combo").style.width = Math.pow(combo.length,0.5)*100; document.getElementById("combo").style.height = Math.pow(combo.length,0.5)*100; - document.getElementById("combo").innerHTML = combo.toString(); + document.getElementById("combo").innerHTML = comboshow.toString(); document.getElementById("combo").style.backgroundColor = "#44FF44"; } function getRGBValues(str) { @@ -14,22 +15,38 @@ function getRGBValues(str) { 'b': vals[2] }; } -function createButton(elementthing, color) { +function createButton(elementthing, elementthing2, color) { + if (document.getElementById(elementthing2) == null) { var button = document.createElement("button"); button.innerHTML = elementthing; - button.id = elementthing; + button.id = elementthing2; button.style.backgroundColor = color; + button.style.marginTop = "3px"; + button.style.marginBottom = "3px"; + button.style.marginLeft = "3px"; + button.style.marginRight = "3px"; var rgb = color.match(/\d+/g); if (rgb[0] + rgb[1] + rgb[2] < 383) { button.style.color = "#FFFFFF"; } button.setAttribute( "onClick", "combinationof()"); document.getElementById("elements").appendChild(button); + } +} +function elemresult(array) { + createButton(elemresult2(array,0),elemresult3(array,0)[1], elemresult3(array,0)[2]); +} +function elemresult2(combinations,id) { + for (var i = 0; i < Object.values(json).length; i++) { + if (Object.values(json)[i][id].toString()==combinations.toString()) { + return Object.keys(json)[i]; + } + } } -function elemresult(combinations,id) { +function elemresult3(combinations,id) { for (var i = 0; i < Object.values(json).length; i++) { - if (Object.values(json)[i][id] == combinations) { - return i; + if (Object.values(json)[i][id].toString()==combinations.toString()) { + return Object.values(json)[i]; } } } @@ -42,6 +59,7 @@ document.addEventListener('keyup', function (event) { if (key === 'Backspace') { combo.length = combo.length - 1; + comboshow.length = comboshow.length - 1; if (combo.length == 0) { document.getElementById("combo").innerHTML = "Click on elements to add them to the combo list."; document.getElementById("combo").style.width = 200; @@ -51,11 +69,12 @@ document.addEventListener('keyup', function (event) { else { document.getElementById("combo").style.width = Math.pow(combo.length,0.5)*100; document.getElementById("combo").style.height = Math.pow(combo.length,0.5)*100; - document.getElementById("combo").innerHTML = combo.toString(); + document.getElementById("combo").innerHTML = comboshow.toString(); document.getElementById("combo").style.backgroundColor = "#44FF44"; } } }) let combo = []; -var json = {"Earth": [[],1,"#BB6644"], "Fire": [[],2,"#FF8844"], "Air": [[],3,"#8888FF"], "Water": [[],4,"#4444FF"], "Dust": [[1,3],5,"#888888"]} \ No newline at end of file +let comboshow = []; +var json = {"Earth": [[1],"1","#BB6644"], "Fire": [[1],"2","#FF8844"], "Air": [[1],"3","#8888FF"], "Water": [[1],"4","#4444FF"], "Dust": [[" 1"," 3"],"5","#888888"]} \ No newline at end of file From 3c9356182543b8a7e1dc0e7ac0945514b3a5b835 Mon Sep 17 00:00:00 2001 From: Durvenson Date: Fri, 22 May 2020 14:02:52 -0400 Subject: [PATCH 07/20] communicative combinations yay... --- elementalthing/elemental.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elementalthing/elemental.html b/elementalthing/elemental.html index e1ef374..e9ab55e 100644 --- a/elementalthing/elemental.html +++ b/elementalthing/elemental.html @@ -13,7 +13,7 @@

Controls:

Press backspace to remove the last element from the combination square.
Click the combination square to combine elements.
Press CTRL+F to find elements.
- + From 468e7fc6f787f6a9a960d3d2cd37010e6e903efc Mon Sep 17 00:00:00 2001 From: Durvenson Date: Fri, 22 May 2020 14:13:12 -0400 Subject: [PATCH 08/20] credit credits! --- elementalthing/elemental.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/elementalthing/elemental.html b/elementalthing/elemental.html index e9ab55e..22f8e47 100644 --- a/elementalthing/elemental.html +++ b/elementalthing/elemental.html @@ -12,7 +12,8 @@

Controls:

Press backspace to remove the last element from the combination square.
Click the combination square to combine elements.
- Press CTRL+F to find elements.
+ Press CTRL+F to find elements. +

This game was developed by newderv#1868.

From 2db47b0a8973e065a26513ed00088e589102ca1d Mon Sep 17 00:00:00 2001 From: Durvenson Date: Fri, 22 May 2020 16:24:51 -0400 Subject: [PATCH 09/20] idk lol --- elementalthing/elemental.css | 13 +++++++++++++ elementalthing/elemental.html | 1 + elementalthing/elemental.js | 7 ++++++- elementalthing/index.js | 0 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 elementalthing/index.js diff --git a/elementalthing/elemental.css b/elementalthing/elemental.css index be017fc..0f5524d 100644 --- a/elementalthing/elemental.css +++ b/elementalthing/elemental.css @@ -1,6 +1,19 @@ body { font-family: 'Balsamiq Sans', cursive; } +div.scroll { + margin:4px, 4px; + padding:4px; + background-color: #DDDDDD; + width: 326px; + height: 226px; + overflow-x: hidden; + overflow-x: auto; + text-align:justify; + position: fixed; + right: 0%; + font-size: 13px; +} button { width: 100px; height: 100px; diff --git a/elementalthing/elemental.html b/elementalthing/elemental.html index 22f8e47..6f427dd 100644 --- a/elementalthing/elemental.html +++ b/elementalthing/elemental.html @@ -9,6 +9,7 @@ +

Controls:

Press backspace to remove the last element from the combination square.
Click the combination square to combine elements.
diff --git a/elementalthing/elemental.js b/elementalthing/elemental.js index e18b432..a917f3a 100644 --- a/elementalthing/elemental.js +++ b/elementalthing/elemental.js @@ -14,7 +14,7 @@ function getRGBValues(str) { 'g': vals[1], 'b': vals[2] }; -} +}3 function createButton(elementthing, elementthing2, color) { if (document.getElementById(elementthing2) == null) { var button = document.createElement("button"); @@ -34,7 +34,12 @@ function createButton(elementthing, elementthing2, color) { } } function elemresult(array) { + if (elemresult2(array,0) == undefined) { + elementnotfound(); + } + else { createButton(elemresult2(array,0),elemresult3(array,0)[1], elemresult3(array,0)[2]); + } } function elemresult2(combinations,id) { for (var i = 0; i < Object.values(json).length; i++) { diff --git a/elementalthing/index.js b/elementalthing/index.js new file mode 100644 index 0000000..e69de29 From 5395348d5756a2f5ff73f414adb34d4d359a26db Mon Sep 17 00:00:00 2001 From: Durvenson Date: Fri, 22 May 2020 16:25:27 -0400 Subject: [PATCH 10/20] unnoticable change why the 3 --- elementalthing/elemental.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elementalthing/elemental.js b/elementalthing/elemental.js index a917f3a..65290c1 100644 --- a/elementalthing/elemental.js +++ b/elementalthing/elemental.js @@ -14,7 +14,7 @@ function getRGBValues(str) { 'g': vals[1], 'b': vals[2] }; -}3 +} function createButton(elementthing, elementthing2, color) { if (document.getElementById(elementthing2) == null) { var button = document.createElement("button"); From e9ba49f8c2c78c6fc856977b17920c09549fc593 Mon Sep 17 00:00:00 2001 From: Durvenson Date: Fri, 22 May 2020 19:31:46 -0400 Subject: [PATCH 11/20] Saving elements You can now save. --- elementalthing/elemental.html | 2 +- elementalthing/elemental.js | 20 +++++++++++++++----- elementalthing/index.js | 0 3 files changed, 16 insertions(+), 6 deletions(-) delete mode 100644 elementalthing/index.js diff --git a/elementalthing/elemental.html b/elementalthing/elemental.html index 6f427dd..d2aa11e 100644 --- a/elementalthing/elemental.html +++ b/elementalthing/elemental.html @@ -5,7 +5,6 @@ - @@ -18,4 +17,5 @@

This game was developed by newderv#1868.

+ diff --git a/elementalthing/elemental.js b/elementalthing/elemental.js index 65290c1..b5d0318 100644 --- a/elementalthing/elemental.js +++ b/elementalthing/elemental.js @@ -29,7 +29,7 @@ function createButton(elementthing, elementthing2, color) { if (rgb[0] + rgb[1] + rgb[2] < 383) { button.style.color = "#FFFFFF"; } - button.setAttribute( "onClick", "combinationof()"); + button.setAttribute("onClick", "combinationof()"); document.getElementById("elements").appendChild(button); } } @@ -39,6 +39,8 @@ function elemresult(array) { } else { createButton(elemresult2(array,0),elemresult3(array,0)[1], elemresult3(array,0)[2]); + stuff = stuff.concat(elemresult3(array,0)[1]); + localStorage.setItem('elements', stuff); } } function elemresult2(combinations,id) { @@ -79,7 +81,15 @@ document.addEventListener('keyup', function (event) { } } }) - -let combo = []; -let comboshow = []; -var json = {"Earth": [[1],"1","#BB6644"], "Fire": [[1],"2","#FF8844"], "Air": [[1],"3","#8888FF"], "Water": [[1],"4","#4444FF"], "Dust": [[" 1"," 3"],"5","#888888"]} \ No newline at end of file +var combo = []; +var comboshow = []; +var json = {"Earth": [[1],"1","#BB6644"], "Fire": [[1],"2","#FF8844"], "Air": [[1],"3","#8888FF"], "Water": [[1],"4","#4444FF"], "Dust": [[" 1"," 3"],"5","#888888"]}; +if (localStorage.getItem('elements') == "null") { + var stuff = new Array(""); + localStorage.setItem('elements', stuff); +} else { + var stuff = localStorage.getItem('elements').split(','); +}; +for (i = 0; i < stuff.length; i++) { + createButton(elemresult2(stuff[i],1),elemresult3(stuff[i],1)[1], elemresult3(stuff[i],1)[2]); +} \ No newline at end of file diff --git a/elementalthing/index.js b/elementalthing/index.js deleted file mode 100644 index e69de29..0000000 From f74a879b2f8e077f1843cf1f434dce7753c95ccf Mon Sep 17 00:00:00 2001 From: Durvenson Date: Sat, 23 May 2020 12:41:42 -0400 Subject: [PATCH 12/20] bruh bruh --- elementalthing/elemental.css | 5 +++- elementalthing/elemental.js | 47 ++++++++++++++++++++++++++++++++---- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/elementalthing/elemental.css b/elementalthing/elemental.css index 0f5524d..0be055a 100644 --- a/elementalthing/elemental.css +++ b/elementalthing/elemental.css @@ -13,16 +13,19 @@ div.scroll { position: fixed; right: 0%; font-size: 13px; + border: 1px solid #444444; + border-radius: 15.5px; } button { width: 100px; height: 100px; font-size: 12px; outline: 0px; - border: 1px solid black; + border: 1px solid #444444; border-radius: 12.5%; animation: textshrink 1s; transition:all 0.3s ease; + font-family: 'Balsamiq Sans', cursive; } button:hover { -webkit-transform: scale(1.33); diff --git a/elementalthing/elemental.js b/elementalthing/elemental.js index b5d0318..e8c8aa8 100644 --- a/elementalthing/elemental.js +++ b/elementalthing/elemental.js @@ -33,11 +33,24 @@ function createButton(elementthing, elementthing2, color) { document.getElementById("elements").appendChild(button); } } +function display(elementthing, color) { + var button = document.createElement("button"); + button.innerHTML = elementthing; + button.style.backgroundColor = color; + button.style.marginTop = "3px"; + button.style.marginBottom = "3px"; + button.style.marginLeft = "3px"; + button.style.marginRight = "3px"; + var rgb = color.match(/\d+/g); + if (rgb[0] + rgb[1] + rgb[2] < 383) { + button.style.color = "#FFFFFF"; + } + document.getElementById("suggestions").appendChild(button); +} function elemresult(array) { if (elemresult2(array,0) == undefined) { elementnotfound(); - } - else { + } else { createButton(elemresult2(array,0),elemresult3(array,0)[1], elemresult3(array,0)[2]); stuff = stuff.concat(elemresult3(array,0)[1]); localStorage.setItem('elements', stuff); @@ -56,6 +69,9 @@ function elemresult3(combinations,id) { return Object.values(json)[i]; } } +} +function elementnotfound() { + } document.addEventListener('keyup', function (event) { if (event.defaultPrevented) { @@ -83,13 +99,34 @@ document.addEventListener('keyup', function (event) { }) var combo = []; var comboshow = []; -var json = {"Earth": [[1],"1","#BB6644"], "Fire": [[1],"2","#FF8844"], "Air": [[1],"3","#8888FF"], "Water": [[1],"4","#4444FF"], "Dust": [[" 1"," 3"],"5","#888888"]}; +var json = {"Earth": [[1],"1","rgb(224,96,64)"], "Fire": [[1],"2","#rgb(255,128,64)"], "Air": [[1],"3","rgb(128,128,255)"], "Water": [[1],"4","rgb(64,64,255)"], "Dust": [[" 1"," 3"],"5","rgb(128,128,128)"]}; +var suggestions = {"Elements": [[" 1"," 2"," 3"," 4"],"rgb(255,255,64)",10,10]}; if (localStorage.getItem('elements') == "null") { var stuff = new Array(""); localStorage.setItem('elements', stuff); } else { var stuff = localStorage.getItem('elements').split(','); -}; +} for (i = 0; i < stuff.length; i++) { - createButton(elemresult2(stuff[i],1),elemresult3(stuff[i],1)[1], elemresult3(stuff[i],1)[2]); + var thetype = typeof stuff[i] + if (thetype == "string" && !(stuff[i] == "")) { + createButton(elemresult2(stuff[i],1),stuff[i], elemresult3(stuff[i],1)[2]); + } +} +for (i = 0; i < suggestions.length; i++) { + var count = Object.values(suggestions)[i][0]; + document.getElementById("suggestions").innerHTML = document.getElementById("suggestions").innerHTML.concat('+('); + for (j = 0; j < count.length; i++) { + var tonumber = parseInt(count[j]).toString(); + var elems = elemresult2(tonumber,1); + var elemcolors = Object.values(json)[elemresult3(tonumber,1)][2]; + display(elems,elemcolors); + if (!(j = count.length)) { + document.getElementById("suggestions").innerHTML = document.getElementById("suggestions").innerHTML.concat(', '); + }; + }; + document.getElementById("suggestions").innerHTML = document.getElementById("suggestions").innerHTML.concat(') ='); + var elemresult = Object.keys(suggestions)[i]; + var elemresultcolor = Object.values(suggestions)[i][1]; + display(elemresult,elemresultcolor); } \ No newline at end of file From 06bfb4dc0fab806cdb85395d8b98ce87bee2d7ec Mon Sep 17 00:00:00 2001 From: Durvenson Date: Sat, 23 May 2020 12:45:22 -0400 Subject: [PATCH 13/20] transparent stuff bruh --- elementalthing/elemental.css | 2 +- elementalthing/elemental.html | 2 +- elementalthing/elemental.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/elementalthing/elemental.css b/elementalthing/elemental.css index 0be055a..d7866ee 100644 --- a/elementalthing/elemental.css +++ b/elementalthing/elemental.css @@ -4,7 +4,7 @@ body { div.scroll { margin:4px, 4px; padding:4px; - background-color: #DDDDDD; + background-color: #DDDDDDBB; width: 326px; height: 226px; overflow-x: hidden; diff --git a/elementalthing/elemental.html b/elementalthing/elemental.html index d2aa11e..f0658a4 100644 --- a/elementalthing/elemental.html +++ b/elementalthing/elemental.html @@ -14,7 +14,7 @@

Controls:

Click the combination square to combine elements.
Press CTRL+F to find elements.

This game was developed by newderv#1868.

- + diff --git a/elementalthing/elemental.js b/elementalthing/elemental.js index e8c8aa8..f60293c 100644 --- a/elementalthing/elemental.js +++ b/elementalthing/elemental.js @@ -5,7 +5,7 @@ function combinationof() { document.getElementById("combo").style.width = Math.pow(combo.length,0.5)*100; document.getElementById("combo").style.height = Math.pow(combo.length,0.5)*100; document.getElementById("combo").innerHTML = comboshow.toString(); - document.getElementById("combo").style.backgroundColor = "#44FF44"; + document.getElementById("combo").style.backgroundColor = "#44FF44BB"; } function getRGBValues(str) { var vals = str.substring(str.indexOf('(') +1, a.length -1).split(', '); @@ -87,13 +87,13 @@ document.addEventListener('keyup', function (event) { document.getElementById("combo").innerHTML = "Click on elements to add them to the combo list."; document.getElementById("combo").style.width = 200; document.getElementById("combo").style.height = 200; - document.getElementById("combo").style.backgroundColor = "#FF4444"; + document.getElementById("combo").style.backgroundColor = "#FF4444BB"; } else { document.getElementById("combo").style.width = Math.pow(combo.length,0.5)*100; document.getElementById("combo").style.height = Math.pow(combo.length,0.5)*100; document.getElementById("combo").innerHTML = comboshow.toString(); - document.getElementById("combo").style.backgroundColor = "#44FF44"; + document.getElementById("combo").style.backgroundColor = "#44FF44BB"; } } }) From 4a160c2b616245a8a950c073ebfec4776473bfdb Mon Sep 17 00:00:00 2001 From: Durvenson Date: Sat, 23 May 2020 13:30:55 -0400 Subject: [PATCH 14/20] suggestions gui bruh --- elementalthing/elemental.css | 2 +- elementalthing/elemental.html | 2 +- elementalthing/elemental.js | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/elementalthing/elemental.css b/elementalthing/elemental.css index d7866ee..b199cc0 100644 --- a/elementalthing/elemental.css +++ b/elementalthing/elemental.css @@ -5,7 +5,7 @@ div.scroll { margin:4px, 4px; padding:4px; background-color: #DDDDDDBB; - width: 326px; + width: 597px; height: 226px; overflow-x: hidden; overflow-x: auto; diff --git a/elementalthing/elemental.html b/elementalthing/elemental.html index f0658a4..2f0b88e 100644 --- a/elementalthing/elemental.html +++ b/elementalthing/elemental.html @@ -16,6 +16,6 @@

Controls:

This game was developed by newderv#1868.

- + diff --git a/elementalthing/elemental.js b/elementalthing/elemental.js index f60293c..c0ccd5b 100644 --- a/elementalthing/elemental.js +++ b/elementalthing/elemental.js @@ -99,8 +99,8 @@ document.addEventListener('keyup', function (event) { }) var combo = []; var comboshow = []; -var json = {"Earth": [[1],"1","rgb(224,96,64)"], "Fire": [[1],"2","#rgb(255,128,64)"], "Air": [[1],"3","rgb(128,128,255)"], "Water": [[1],"4","rgb(64,64,255)"], "Dust": [[" 1"," 3"],"5","rgb(128,128,128)"]}; -var suggestions = {"Elements": [[" 1"," 2"," 3"," 4"],"rgb(255,255,64)",10,10]}; +var json = {"Earth": [[1],"1","rgb(224,96,64)"], "Fire": [[1],"2","rgb(255,128,64)"], "Air": [[1],"3","rgb(128,128,255)"], "Water": [[1],"4","rgb(64,64,255)"], "Dust": [[" 1"," 3"],"5","rgb(128,128,128)"]}; +var suggestions = {"Elements": [[" 1", " 2", " 3", " 4"],"rgb(255,255,64)",10,10]}; if (localStorage.getItem('elements') == "null") { var stuff = new Array(""); localStorage.setItem('elements', stuff); @@ -113,16 +113,16 @@ for (i = 0; i < stuff.length; i++) { createButton(elemresult2(stuff[i],1),stuff[i], elemresult3(stuff[i],1)[2]); } } -for (i = 0; i < suggestions.length; i++) { +for (i = 0; i < Object.values(suggestions).length; i++) { var count = Object.values(suggestions)[i][0]; document.getElementById("suggestions").innerHTML = document.getElementById("suggestions").innerHTML.concat('+('); - for (j = 0; j < count.length; i++) { + for (j = 0; j < count.length; j++) { var tonumber = parseInt(count[j]).toString(); var elems = elemresult2(tonumber,1); - var elemcolors = Object.values(json)[elemresult3(tonumber,1)][2]; + var elemcolors = elemresult3(tonumber,1)[2]; display(elems,elemcolors); - if (!(j = count.length)) { - document.getElementById("suggestions").innerHTML = document.getElementById("suggestions").innerHTML.concat(', '); + if (!(j == count.length - 1)) { + document.getElementById("suggestions").innerHTML = document.getElementById("suggestions").innerHTML.concat(','); }; }; document.getElementById("suggestions").innerHTML = document.getElementById("suggestions").innerHTML.concat(') ='); From c95a6813b528d23c22385dc4bd4c1dba08337e00 Mon Sep 17 00:00:00 2001 From: Durvenson Date: Sat, 23 May 2020 14:50:55 -0400 Subject: [PATCH 15/20] gui update --- elementalthing/elemental.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/elementalthing/elemental.js b/elementalthing/elemental.js index c0ccd5b..22ea4b0 100644 --- a/elementalthing/elemental.js +++ b/elementalthing/elemental.js @@ -33,6 +33,25 @@ function createButton(elementthing, elementthing2, color) { document.getElementById("elements").appendChild(button); } } +function createButton2(elementthing, elementthing2, color) { + if (document.getElementById(elementthing2) == null) { + var button = document.createElement("button"); + button.innerHTML = elementthing; + button.id = elementthing2; + button.style.height = '50px'; + button.style.backgroundColor = color; + button.style.marginTop = "3px"; + button.style.marginBottom = "3px"; + button.style.marginLeft = "3px"; + button.style.marginRight = "3px"; + var rgb = color.match(/\d+/g); + if (rgb[0] + rgb[1] + rgb[2] < 383) { + button.style.color = "#FFFFFF"; + } + button.setAttribute("onClick", "vote()"); + document.getElementById("center").appendChild(button); + } +} function display(elementthing, color) { var button = document.createElement("button"); button.innerHTML = elementthing; @@ -125,8 +144,14 @@ for (i = 0; i < Object.values(suggestions).length; i++) { document.getElementById("suggestions").innerHTML = document.getElementById("suggestions").innerHTML.concat(','); }; }; - document.getElementById("suggestions").innerHTML = document.getElementById("suggestions").innerHTML.concat(') ='); + document.getElementById("suggestions").innerHTML = document.getElementById("suggestions").innerHTML.concat(')='); var elemresult = Object.keys(suggestions)[i]; var elemresultcolor = Object.values(suggestions)[i][1]; display(elemresult,elemresultcolor); + likes = 'Likes:' + Object.values(suggestions)[i][2]; + dislikes = 'Dislikes:' + Object.values(suggestions)[i][3]; + document.getElementById("suggestions").innerHTML = document.getElementById("suggestions").innerHTML.concat('
'); + createButton2(likes,"like","#44FF44"); + createButton2(dislikes,"dislike","#FF4444"); + document.getElementById("suggestions").innerHTML = document.getElementById("suggestions").innerHTML.concat('
'); } \ No newline at end of file From fac3c245c0206ed356724154b0e48dd6f2a8f4b2 Mon Sep 17 00:00:00 2001 From: Durvenson Date: Sat, 23 May 2020 14:51:32 -0400 Subject: [PATCH 16/20] e --- elementalthing/elemental.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/elementalthing/elemental.js b/elementalthing/elemental.js index 22ea4b0..6d251c5 100644 --- a/elementalthing/elemental.js +++ b/elementalthing/elemental.js @@ -150,8 +150,7 @@ for (i = 0; i < Object.values(suggestions).length; i++) { display(elemresult,elemresultcolor); likes = 'Likes:' + Object.values(suggestions)[i][2]; dislikes = 'Dislikes:' + Object.values(suggestions)[i][3]; - document.getElementById("suggestions").innerHTML = document.getElementById("suggestions").innerHTML.concat('
'); createButton2(likes,"like","#44FF44"); createButton2(dislikes,"dislike","#FF4444"); - document.getElementById("suggestions").innerHTML = document.getElementById("suggestions").innerHTML.concat('
'); + document.getElementById("suggestions").innerHTML = document.getElementById("suggestions").innerHTML.concat('
'); } \ No newline at end of file From 4216df6487c26c14aa6d9f16e0c09a122e0dce0a Mon Sep 17 00:00:00 2001 From: Durvenson Date: Sat, 23 May 2020 14:54:57 -0400 Subject: [PATCH 17/20] e --- elementalthing/elemental.css | 1 + elementalthing/elemental.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/elementalthing/elemental.css b/elementalthing/elemental.css index b199cc0..ebdfff3 100644 --- a/elementalthing/elemental.css +++ b/elementalthing/elemental.css @@ -15,6 +15,7 @@ div.scroll { font-size: 13px; border: 1px solid #444444; border-radius: 15.5px; + text-align: center; } button { width: 100px; diff --git a/elementalthing/elemental.js b/elementalthing/elemental.js index 6d251c5..3e767fa 100644 --- a/elementalthing/elemental.js +++ b/elementalthing/elemental.js @@ -49,7 +49,7 @@ function createButton2(elementthing, elementthing2, color) { button.style.color = "#FFFFFF"; } button.setAttribute("onClick", "vote()"); - document.getElementById("center").appendChild(button); + document.getElementById("suggestions").appendChild(button); } } function display(elementthing, color) { From f3736d66ce11909937b44bad21fe42dc1266a02c Mon Sep 17 00:00:00 2001 From: Durvenson Date: Sat, 23 May 2020 15:04:44 -0400 Subject: [PATCH 18/20] bug fixed likes/dislikes now show for all elements --- elementalthing/elemental.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/elementalthing/elemental.js b/elementalthing/elemental.js index 3e767fa..4fbcd4f 100644 --- a/elementalthing/elemental.js +++ b/elementalthing/elemental.js @@ -34,7 +34,6 @@ function createButton(elementthing, elementthing2, color) { } } function createButton2(elementthing, elementthing2, color) { - if (document.getElementById(elementthing2) == null) { var button = document.createElement("button"); button.innerHTML = elementthing; button.id = elementthing2; @@ -50,7 +49,6 @@ function createButton2(elementthing, elementthing2, color) { } button.setAttribute("onClick", "vote()"); document.getElementById("suggestions").appendChild(button); - } } function display(elementthing, color) { var button = document.createElement("button"); @@ -119,7 +117,7 @@ document.addEventListener('keyup', function (event) { var combo = []; var comboshow = []; var json = {"Earth": [[1],"1","rgb(224,96,64)"], "Fire": [[1],"2","rgb(255,128,64)"], "Air": [[1],"3","rgb(128,128,255)"], "Water": [[1],"4","rgb(64,64,255)"], "Dust": [[" 1"," 3"],"5","rgb(128,128,128)"]}; -var suggestions = {"Elements": [[" 1", " 2", " 3", " 4"],"rgb(255,255,64)",10,10]}; +var suggestions = {"Elements": [[" 1", " 2", " 3", " 4"],"rgb(255,255,64)",10,10], "Elementses": [[" 1", " 2", " 3", " 4"],"rgb(255,255,64)",10,10]}; if (localStorage.getItem('elements') == "null") { var stuff = new Array(""); localStorage.setItem('elements', stuff); From 5d1be82a48db6de087a3c0d30f24726b56dd95f7 Mon Sep 17 00:00:00 2001 From: Durvenson Date: Sat, 23 May 2020 15:08:18 -0400 Subject: [PATCH 19/20] we don't need this file lol --- elementalthing/jquery-3.5.1.min.js | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 elementalthing/jquery-3.5.1.min.js diff --git a/elementalthing/jquery-3.5.1.min.js b/elementalthing/jquery-3.5.1.min.js deleted file mode 100644 index d467083..0000000 --- a/elementalthing/jquery-3.5.1.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0 Date: Sat, 23 May 2020 15:28:03 -0400 Subject: [PATCH 20/20] gwae gwa --- elementalthing/elemental.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elementalthing/elemental.js b/elementalthing/elemental.js index 4fbcd4f..b35d7e3 100644 --- a/elementalthing/elemental.js +++ b/elementalthing/elemental.js @@ -117,7 +117,7 @@ document.addEventListener('keyup', function (event) { var combo = []; var comboshow = []; var json = {"Earth": [[1],"1","rgb(224,96,64)"], "Fire": [[1],"2","rgb(255,128,64)"], "Air": [[1],"3","rgb(128,128,255)"], "Water": [[1],"4","rgb(64,64,255)"], "Dust": [[" 1"," 3"],"5","rgb(128,128,128)"]}; -var suggestions = {"Elements": [[" 1", " 2", " 3", " 4"],"rgb(255,255,64)",10,10], "Elementses": [[" 1", " 2", " 3", " 4"],"rgb(255,255,64)",10,10]}; +var suggestions = {"Elements": [[" 1", " 2", " 3", " 4"],"rgb(255,255,64)",10,10], "Elementses": [[" 1", " 2"],"rgb(255,255,64)",10,10]}; if (localStorage.getItem('elements') == "null") { var stuff = new Array(""); localStorage.setItem('elements', stuff);