From 0636e45108b3f52e835e103f5c94d542c719ec9b Mon Sep 17 00:00:00 2001 From: Codrin Pavel Date: Sat, 6 Jun 2020 18:19:15 +0300 Subject: [PATCH] Remove <600k toe teams + perf imporvements --- _assets/js/toe.js | 14 +- _assets/sass/main.scss | 3 +- _assets/sass/modules/_titan_thumbs.scss | 29 +++ _assets/sass/modules/_toe.scss | 8 +- _layouts/toe.html | 22 +- _toe/{ => 01.06}/82.json | 0 _toe/{ => 01.06}/83.json | 0 _toe/{ => 01.06}/84.json | 0 _toe/{ => 01.06}/85.json | 0 _toe/{ => 01.06}/86.json | 0 _toe/{ => 01.06}/87.json | 0 _toe/{ => 01.06}/88.json | 0 _toe/{ => 01.06}/89.json | 0 _toe/{ => 01.06}/90.json | 0 _toe/{ => 01.06}/91.json | 0 _toe/{ => 01.06}/92.json | 0 _toe/{ => 01.06}/93.json | 0 _toe/{ => 02.06}/94.json | 0 _toe/{ => 02.06}/95.json | 0 _toe/{ => 02.06}/96.json | 0 _toe/{ => 02.06}/97.json | 0 _toe/{ => 02.06}/98.json | 0 _toe/{ => 02.06}/99.json | 0 _toe/{ => 02.06}/LIGHT_7_3_200602.json | 0 _toe/{ => 02.06}/LIGHT_7_5_200602.json | 0 _toe/{ => 02.06}/LIGHT_7_7_200602.json | 0 _toe/{ => 03.06}/100.json | 0 _toe/{ => 03.06}/101.json | 0 _toe/{ => 03.06}/102.json | 0 _toe/{ => 03.06}/103.json | 0 _toe/{ => 03.06}/104.json | 0 _toe/{ => 03.06}/105.json | 0 _toe/{ => 03.06}/LIGHT_7_4_200603.json | 0 _toe/{ => 03.06}/LIGHT_7_5_200603.json | 0 _toe/{ => 03.06}/LIGHT_7_7_200603.json | 0 _toe/{ => 03.06}/OPM_26_4_200603.json | 0 _toe/{ => 03.06}/OPM_26_5_200603.json | 0 _toe/{ => 03.06}/OPM_26_7_200603.json | 0 _toe/{ => 03.06}/OPM_7_3_200603.json | 0 _toe/{ => 03.06}/OPM_7_4_200603.json | 0 _toe/{ => 03.06}/OPM_7_5_200603.json | 0 _toe/{ => 03.06}/OPM_7_7_200603.json | 0 _toe/{ => 03.06}/ZERO_31_3_200603.json | 0 _toe/{ => 03.06}/ZERO_31_4_200603.json | 0 _toe/{ => 03.06}/ZERO_31_5_200603.json | 0 _toe/{ => 03.06}/ZERO_31_7_200603.json | 0 _toe/{ => 04.06}/LIGHT_7_4_200604.json | 0 _toe/{ => 04.06}/LIGHT_7_5_200604.json | 0 _toe/{ => 04.06}/LIGHT_7_7_200604.json | 0 _toe/{ => 04.06}/OPM_26_3_200604.json | 0 _toe/{ => 04.06}/OPM_26_4_200604.json | 0 _toe/{ => 04.06}/OPM_26_5_200604.json | 0 _toe/{ => 04.06}/OPM_26_7_200604.json | 0 _toe/{ => 04.06}/OPM_7_4_200604.json | 0 _toe/{ => 04.06}/OPM_7_5_200604.json | 0 _toe/{ => 04.06}/OPM_7_7_200604.json | 0 _toe/{ => 04.06}/ZERO_31_3_200604.json | 0 _toe/{ => 04.06}/ZERO_31_4_200604.json | 0 _toe/{ => 04.06}/ZERO_31_5_200604.json | 0 _toe/{ => 04.06}/ZERO_31_7_200604.json | 0 _toe/{ => 05.06}/OPM_26_3_200605.json | 0 _toe/{ => 05.06}/OPM_26_4_200605.json | 0 _toe/{ => 05.06}/OPM_26_5_200605.json | 0 _toe/{ => 05.06}/OPM_26_7_200605.json | 0 _toe/{ => 05.06}/OPM_7_3_200605.json | 0 _toe/{ => 05.06}/OPM_7_4_200605.json | 0 _toe/{ => 05.06}/OPM_7_5_200605.json | 0 _toe/{ => 05.06}/OPM_7_7_200605.json | 0 _toe/{ => 05.06}/ZERO_31_2_200605.json | 0 _toe/{ => 05.06}/ZERO_31_3_200605.json | 0 _toe/{ => 05.06}/ZERO_31_4_200605.json | 0 _toe/{ => 05.06}/ZERO_31_5_200605.json | 0 _toe/{ => 05.06}/ZERO_31_7_200605.json | 0 _toe/{ => may}/1.json | 0 _toe/{ => may}/10.json | 0 _toe/{ => may}/11.json | 0 _toe/{ => may}/12.json | 0 _toe/{ => may}/13.json | 0 _toe/{ => may}/14.json | 0 _toe/{ => may}/15.json | 0 _toe/{ => may}/16.json | 0 _toe/{ => may}/17.json | 0 _toe/{ => may}/18.json | 0 _toe/{ => may}/19.json | 0 _toe/{ => may}/2.json | 0 _toe/{ => may}/20.json | 0 _toe/{ => may}/21.json | 0 _toe/{ => may}/22.json | 0 _toe/{ => may}/23.json | 0 _toe/{ => may}/24.json | 0 _toe/{ => may}/25.json | 0 _toe/{ => may}/26.json | 0 _toe/{ => may}/27.json | 0 _toe/{ => may}/28.json | 0 _toe/{ => may}/29.json | 0 _toe/{ => may}/3.json | 0 _toe/{ => may}/30.json | 0 _toe/{ => may}/31.json | 0 _toe/{ => may}/32.json | 0 _toe/{ => may}/33.json | 0 _toe/{ => may}/34.json | 0 _toe/{ => may}/35.json | 0 _toe/{ => may}/36.json | 0 _toe/{ => may}/37.json | 0 _toe/{ => may}/38.json | 0 _toe/{ => may}/39.json | 0 _toe/{ => may}/4.json | 0 _toe/{ => may}/40.json | 0 _toe/{ => may}/41.json | 0 _toe/{ => may}/42.json | 0 _toe/{ => may}/43.json | 0 _toe/{ => may}/44.json | 0 _toe/{ => may}/45.json | 0 _toe/{ => may}/46.json | 0 _toe/{ => may}/47.json | 0 _toe/{ => may}/48.json | 0 _toe/{ => may}/49.json | 0 _toe/{ => may}/5.json | 0 _toe/{ => may}/50.json | 0 _toe/{ => may}/51.json | 0 _toe/{ => may}/52.json | 0 _toe/{ => may}/53.json | 0 _toe/{ => may}/54.json | 0 _toe/{ => may}/55.json | 0 _toe/{ => may}/56.json | 0 _toe/{ => may}/57.json | 0 _toe/{ => may}/58.json | 0 _toe/{ => may}/59.json | 0 _toe/{ => may}/6.json | 0 _toe/{ => may}/60.json | 0 _toe/{ => may}/61.json | 0 _toe/{ => may}/62.json | 0 _toe/{ => may}/63.json | 0 _toe/{ => may}/64.json | 0 _toe/{ => may}/65.json | 0 _toe/{ => may}/66.json | 0 _toe/{ => may}/67.json | 0 _toe/{ => may}/68.json | 0 _toe/{ => may}/69.json | 0 _toe/{ => may}/7.json | 0 _toe/{ => may}/70.json | 0 _toe/{ => may}/71.json | 0 _toe/{ => may}/72.json | 0 _toe/{ => may}/73.json | 0 _toe/{ => may}/74.json | 0 _toe/{ => may}/75.json | 0 _toe/{ => may}/76.json | 0 _toe/{ => may}/77.json | 0 _toe/{ => may}/78.json | 0 _toe/{ => may}/79.json | 0 _toe/{ => may}/8.json | 0 _toe/{ => may}/80.json | 0 _toe/{ => may}/81.json | 0 _toe/{ => may}/9.json | 0 assets/js/main.min.js | 2 +- assets/json/toedata.combined.min.json | 2 +- assets/sass/main.css | 2 +- gulpfile.js | 282 ++++++++++++------------ toe.md | 2 +- 159 files changed, 196 insertions(+), 170 deletions(-) create mode 100644 _assets/sass/modules/_titan_thumbs.scss rename _toe/{ => 01.06}/82.json (100%) rename _toe/{ => 01.06}/83.json (100%) rename _toe/{ => 01.06}/84.json (100%) rename _toe/{ => 01.06}/85.json (100%) rename _toe/{ => 01.06}/86.json (100%) rename _toe/{ => 01.06}/87.json (100%) rename _toe/{ => 01.06}/88.json (100%) rename _toe/{ => 01.06}/89.json (100%) rename _toe/{ => 01.06}/90.json (100%) rename _toe/{ => 01.06}/91.json (100%) rename _toe/{ => 01.06}/92.json (100%) rename _toe/{ => 01.06}/93.json (100%) rename _toe/{ => 02.06}/94.json (100%) rename _toe/{ => 02.06}/95.json (100%) rename _toe/{ => 02.06}/96.json (100%) rename _toe/{ => 02.06}/97.json (100%) rename _toe/{ => 02.06}/98.json (100%) rename _toe/{ => 02.06}/99.json (100%) rename _toe/{ => 02.06}/LIGHT_7_3_200602.json (100%) rename _toe/{ => 02.06}/LIGHT_7_5_200602.json (100%) rename _toe/{ => 02.06}/LIGHT_7_7_200602.json (100%) rename _toe/{ => 03.06}/100.json (100%) rename _toe/{ => 03.06}/101.json (100%) rename _toe/{ => 03.06}/102.json (100%) rename _toe/{ => 03.06}/103.json (100%) rename _toe/{ => 03.06}/104.json (100%) rename _toe/{ => 03.06}/105.json (100%) rename _toe/{ => 03.06}/LIGHT_7_4_200603.json (100%) rename _toe/{ => 03.06}/LIGHT_7_5_200603.json (100%) rename _toe/{ => 03.06}/LIGHT_7_7_200603.json (100%) rename _toe/{ => 03.06}/OPM_26_4_200603.json (100%) rename _toe/{ => 03.06}/OPM_26_5_200603.json (100%) rename _toe/{ => 03.06}/OPM_26_7_200603.json (100%) rename _toe/{ => 03.06}/OPM_7_3_200603.json (100%) rename _toe/{ => 03.06}/OPM_7_4_200603.json (100%) rename _toe/{ => 03.06}/OPM_7_5_200603.json (100%) rename _toe/{ => 03.06}/OPM_7_7_200603.json (100%) rename _toe/{ => 03.06}/ZERO_31_3_200603.json (100%) rename _toe/{ => 03.06}/ZERO_31_4_200603.json (100%) rename _toe/{ => 03.06}/ZERO_31_5_200603.json (100%) rename _toe/{ => 03.06}/ZERO_31_7_200603.json (100%) rename _toe/{ => 04.06}/LIGHT_7_4_200604.json (100%) rename _toe/{ => 04.06}/LIGHT_7_5_200604.json (100%) rename _toe/{ => 04.06}/LIGHT_7_7_200604.json (100%) rename _toe/{ => 04.06}/OPM_26_3_200604.json (100%) rename _toe/{ => 04.06}/OPM_26_4_200604.json (100%) rename _toe/{ => 04.06}/OPM_26_5_200604.json (100%) rename _toe/{ => 04.06}/OPM_26_7_200604.json (100%) rename _toe/{ => 04.06}/OPM_7_4_200604.json (100%) rename _toe/{ => 04.06}/OPM_7_5_200604.json (100%) rename _toe/{ => 04.06}/OPM_7_7_200604.json (100%) rename _toe/{ => 04.06}/ZERO_31_3_200604.json (100%) rename _toe/{ => 04.06}/ZERO_31_4_200604.json (100%) rename _toe/{ => 04.06}/ZERO_31_5_200604.json (100%) rename _toe/{ => 04.06}/ZERO_31_7_200604.json (100%) rename _toe/{ => 05.06}/OPM_26_3_200605.json (100%) rename _toe/{ => 05.06}/OPM_26_4_200605.json (100%) rename _toe/{ => 05.06}/OPM_26_5_200605.json (100%) rename _toe/{ => 05.06}/OPM_26_7_200605.json (100%) rename _toe/{ => 05.06}/OPM_7_3_200605.json (100%) rename _toe/{ => 05.06}/OPM_7_4_200605.json (100%) rename _toe/{ => 05.06}/OPM_7_5_200605.json (100%) rename _toe/{ => 05.06}/OPM_7_7_200605.json (100%) rename _toe/{ => 05.06}/ZERO_31_2_200605.json (100%) rename _toe/{ => 05.06}/ZERO_31_3_200605.json (100%) rename _toe/{ => 05.06}/ZERO_31_4_200605.json (100%) rename _toe/{ => 05.06}/ZERO_31_5_200605.json (100%) rename _toe/{ => 05.06}/ZERO_31_7_200605.json (100%) rename _toe/{ => may}/1.json (100%) rename _toe/{ => may}/10.json (100%) rename _toe/{ => may}/11.json (100%) rename _toe/{ => may}/12.json (100%) rename _toe/{ => may}/13.json (100%) rename _toe/{ => may}/14.json (100%) rename _toe/{ => may}/15.json (100%) rename _toe/{ => may}/16.json (100%) rename _toe/{ => may}/17.json (100%) rename _toe/{ => may}/18.json (100%) rename _toe/{ => may}/19.json (100%) rename _toe/{ => may}/2.json (100%) rename _toe/{ => may}/20.json (100%) rename _toe/{ => may}/21.json (100%) rename _toe/{ => may}/22.json (100%) rename _toe/{ => may}/23.json (100%) rename _toe/{ => may}/24.json (100%) rename _toe/{ => may}/25.json (100%) rename _toe/{ => may}/26.json (100%) rename _toe/{ => may}/27.json (100%) rename _toe/{ => may}/28.json (100%) rename _toe/{ => may}/29.json (100%) rename _toe/{ => may}/3.json (100%) rename _toe/{ => may}/30.json (100%) rename _toe/{ => may}/31.json (100%) rename _toe/{ => may}/32.json (100%) rename _toe/{ => may}/33.json (100%) rename _toe/{ => may}/34.json (100%) rename _toe/{ => may}/35.json (100%) rename _toe/{ => may}/36.json (100%) rename _toe/{ => may}/37.json (100%) rename _toe/{ => may}/38.json (100%) rename _toe/{ => may}/39.json (100%) rename _toe/{ => may}/4.json (100%) rename _toe/{ => may}/40.json (100%) rename _toe/{ => may}/41.json (100%) rename _toe/{ => may}/42.json (100%) rename _toe/{ => may}/43.json (100%) rename _toe/{ => may}/44.json (100%) rename _toe/{ => may}/45.json (100%) rename _toe/{ => may}/46.json (100%) rename _toe/{ => may}/47.json (100%) rename _toe/{ => may}/48.json (100%) rename _toe/{ => may}/49.json (100%) rename _toe/{ => may}/5.json (100%) rename _toe/{ => may}/50.json (100%) rename _toe/{ => may}/51.json (100%) rename _toe/{ => may}/52.json (100%) rename _toe/{ => may}/53.json (100%) rename _toe/{ => may}/54.json (100%) rename _toe/{ => may}/55.json (100%) rename _toe/{ => may}/56.json (100%) rename _toe/{ => may}/57.json (100%) rename _toe/{ => may}/58.json (100%) rename _toe/{ => may}/59.json (100%) rename _toe/{ => may}/6.json (100%) rename _toe/{ => may}/60.json (100%) rename _toe/{ => may}/61.json (100%) rename _toe/{ => may}/62.json (100%) rename _toe/{ => may}/63.json (100%) rename _toe/{ => may}/64.json (100%) rename _toe/{ => may}/65.json (100%) rename _toe/{ => may}/66.json (100%) rename _toe/{ => may}/67.json (100%) rename _toe/{ => may}/68.json (100%) rename _toe/{ => may}/69.json (100%) rename _toe/{ => may}/7.json (100%) rename _toe/{ => may}/70.json (100%) rename _toe/{ => may}/71.json (100%) rename _toe/{ => may}/72.json (100%) rename _toe/{ => may}/73.json (100%) rename _toe/{ => may}/74.json (100%) rename _toe/{ => may}/75.json (100%) rename _toe/{ => may}/76.json (100%) rename _toe/{ => may}/77.json (100%) rename _toe/{ => may}/78.json (100%) rename _toe/{ => may}/79.json (100%) rename _toe/{ => may}/8.json (100%) rename _toe/{ => may}/80.json (100%) rename _toe/{ => may}/81.json (100%) rename _toe/{ => may}/9.json (100%) diff --git a/_assets/js/toe.js b/_assets/js/toe.js index 64bca7c..2ee09bd 100644 --- a/_assets/js/toe.js +++ b/_assets/js/toe.js @@ -59,19 +59,8 @@ $(function () { var matches = data.results[0].result.response.results; var matchesArray = []; - // @TODO should move everything below to the build process - // speed things up a little for (match in matches) { - var thisMatch = matches[match]; - // add enemy total power to match data - var power = 0; - var attackerTeam = thisMatch.defBattle.attackers; - for (titan in attackerTeam) { - power += attackerTeam[titan].power; - } - thisMatch.enemypower = power; - - matchesArray.push(thisMatch); + matchesArray.push(matches[match]); } var orderedMatches = matchesArray.sort(function (a, b) { @@ -79,6 +68,7 @@ $(function () { }); toe.matches = orderedMatches; + console.log(toe.matches); }); } }); diff --git a/_assets/sass/main.scss b/_assets/sass/main.scss index a025cc9..5a25e0d 100644 --- a/_assets/sass/main.scss +++ b/_assets/sass/main.scss @@ -19,6 +19,7 @@ // Modules "modules/wrapper", "modules/buttons", + "modules/titan_thumbs", "modules/war", "modules/hamburger", "modules/header", @@ -27,4 +28,4 @@ // Print "base/print" -; \ No newline at end of file +; diff --git a/_assets/sass/modules/_titan_thumbs.scss b/_assets/sass/modules/_titan_thumbs.scss new file mode 100644 index 0000000..fac13a5 --- /dev/null +++ b/_assets/sass/modules/_titan_thumbs.scss @@ -0,0 +1,29 @@ +[data-titan-thumb] { + display: inline-block; + width: 32px; + height: 32px; + background: $black; + border-radius: 50%; + vertical-align: middle; + margin: 1px; + border: 1px solid #666; + background-size: cover; + + &.thumb--large { + width: 46px; + height: 46px; + margin: 2px; + } +} + +$titans: 0, 1, 2, 3; +$elements: 400, 401, 402; + +@each $element in $elements { + @each $titan in $titans { + $id: #{$element}#{$titan}; + [data-titan-thumb="#{$id}"] { + background-image: url("../img/Titans/#{$id}.png"); + } + } +} diff --git a/_assets/sass/modules/_toe.scss b/_assets/sass/modules/_toe.scss index cfb7e88..6f09143 100644 --- a/_assets/sass/modules/_toe.scss +++ b/_assets/sass/modules/_toe.scss @@ -19,7 +19,7 @@ text-transform: uppercase; letter-spacing: .2px; display: block; - padding: 3px 12px; + padding: 3px 16px; line-height: 20px; margin: 0 5px; box-shadow: 0 0 0 1px #eee; @@ -56,7 +56,7 @@ &__shortcut { display: flex; flex-direction: column; - margin-left: 37px; + margin-left: 15px; button { width: 46px; @@ -106,7 +106,7 @@ max-width: 25%; } - img { + .thumb--large { opacity: .5; max-width: 46px; margin: 2px; @@ -115,7 +115,7 @@ input { display: none; - &:checked + img { + &:checked + .thumb--large { opacity: 1; } } diff --git a/_layouts/toe.html b/_layouts/toe.html index d623f09..e651487 100644 --- a/_layouts/toe.html +++ b/_layouts/toe.html @@ -12,15 +12,11 @@
-