mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
refactor: don't store summonerSpell json in frontend anymore
This commit is contained in:
parent
eed57126ba
commit
cdfdb814ca
4 changed files with 5 additions and 335 deletions
|
|
@ -59,11 +59,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col ml-2">
|
<div class="flex flex-col ml-2">
|
||||||
<div
|
<div
|
||||||
:style="{backgroundImage: `url(${getSummonerLink(player.spell1Id)})`}"
|
:style="{backgroundImage: `url(${player.summonerSpell1.icon})`}"
|
||||||
class="w-4 h-4 bg-center bg-cover rounded-md bg-blue-1000"
|
class="w-4 h-4 bg-center bg-cover rounded-md bg-blue-1000"
|
||||||
></div>
|
></div>
|
||||||
<div
|
<div
|
||||||
:style="{backgroundImage: `url(${getSummonerLink(player.spell2Id)})`}"
|
:style="{backgroundImage: `url(${player.summonerSpell2.icon})`}"
|
||||||
class="w-4 h-4 mt-1 bg-center bg-cover rounded-md bg-blue-1000"
|
class="w-4 h-4 mt-1 bg-center bg-cover rounded-md bg-blue-1000"
|
||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -191,7 +191,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapActions, mapState } from 'vuex'
|
import { mapActions, mapState } from 'vuex'
|
||||||
import { getSummonerLink, getPrimarRune, getSecondaryRune } from '@/helpers/summoner.js'
|
import { getPrimarRune, getSecondaryRune } from '@/helpers/summoner.js'
|
||||||
import { ContentLoader } from 'vue-content-loader'
|
import { ContentLoader } from 'vue-content-loader'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -274,7 +274,6 @@ export default {
|
||||||
return
|
return
|
||||||
this.displayOrHideRunes(player.perks)
|
this.displayOrHideRunes(player.perks)
|
||||||
},
|
},
|
||||||
getSummonerLink,
|
|
||||||
getPrimarRune,
|
getPrimarRune,
|
||||||
getSecondaryRune,
|
getSecondaryRune,
|
||||||
...mapActions('cdragon', ['displayOrHideRunes']),
|
...mapActions('cdragon', ['displayOrHideRunes']),
|
||||||
|
|
|
||||||
|
|
@ -1,320 +0,0 @@
|
||||||
[
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "Cleanse",
|
|
||||||
"description": "Removes all disables (excluding suppression and airborne) and summoner spell debuffs affecting your champion and lowers the duration of incoming disables by 65% for 3 seconds.",
|
|
||||||
"summonerLevel": 9,
|
|
||||||
"cooldown": 210,
|
|
||||||
"gameModes": [
|
|
||||||
"CLASSIC",
|
|
||||||
"ODIN",
|
|
||||||
"TUTORIAL",
|
|
||||||
"ARAM",
|
|
||||||
"ASCENSION",
|
|
||||||
"FIRSTBLOOD",
|
|
||||||
"URF",
|
|
||||||
"ARSR",
|
|
||||||
"DOOMBOTSTEEMO",
|
|
||||||
"PROJECT",
|
|
||||||
"ONEFORALL",
|
|
||||||
"GAMEMODEX",
|
|
||||||
"PRACTICETOOL"
|
|
||||||
],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/Summoner_boost.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"name": "Exhaust",
|
|
||||||
"description": "Exhausts target enemy champion, reducing their Movement Speed by 30%, and their damage dealt by 40% for 2.5 seconds.",
|
|
||||||
"summonerLevel": 4,
|
|
||||||
"cooldown": 210,
|
|
||||||
"gameModes": [
|
|
||||||
"ARAM",
|
|
||||||
"TUTORIAL",
|
|
||||||
"CLASSIC",
|
|
||||||
"GAMEMODEX",
|
|
||||||
"URF",
|
|
||||||
"ARSR",
|
|
||||||
"DOOMBOTSTEEMO",
|
|
||||||
"ONEFORALL",
|
|
||||||
"PRACTICETOOL"
|
|
||||||
],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/Summoner_exhaust.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 4,
|
|
||||||
"name": "Flash",
|
|
||||||
"description": "Teleports your champion a short distance toward your cursor's location.",
|
|
||||||
"summonerLevel": 7,
|
|
||||||
"cooldown": 300,
|
|
||||||
"gameModes": [
|
|
||||||
"CLASSIC",
|
|
||||||
"ODIN",
|
|
||||||
"TUTORIAL",
|
|
||||||
"ARAM",
|
|
||||||
"ASCENSION",
|
|
||||||
"FIRSTBLOOD",
|
|
||||||
"ASSASSINATE",
|
|
||||||
"URF",
|
|
||||||
"ARSR",
|
|
||||||
"DOOMBOTSTEEMO",
|
|
||||||
"STARGUARDIAN",
|
|
||||||
"PROJECT",
|
|
||||||
"SNOWURF",
|
|
||||||
"ONEFORALL",
|
|
||||||
"GAMEMODEX",
|
|
||||||
"PRACTICETOOL"
|
|
||||||
],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/Summoner_flash.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 5,
|
|
||||||
"name": "Backtrack",
|
|
||||||
"description": "Temporarily shields 75-330 (depending on champion level) damage from your champion. After 2.5 seconds the shield expires and your champion is teleported to safety. Melee champions travel extra distance.",
|
|
||||||
"summonerLevel": 4,
|
|
||||||
"cooldown": 180,
|
|
||||||
"gameModes": [],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/Summoner_Backtrack.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 6,
|
|
||||||
"name": "Ghost",
|
|
||||||
"description": "Your champion gains increased Movement Speed and can move through units for 10 seconds. Grants a maximum of 28-45% (depending on champion level) Movement Speed after accelerating for 2 seconds.",
|
|
||||||
"summonerLevel": 1,
|
|
||||||
"cooldown": 180,
|
|
||||||
"gameModes": [
|
|
||||||
"CLASSIC",
|
|
||||||
"ODIN",
|
|
||||||
"TUTORIAL",
|
|
||||||
"ARAM",
|
|
||||||
"ASCENSION",
|
|
||||||
"FIRSTBLOOD",
|
|
||||||
"ASSASSINATE",
|
|
||||||
"URF",
|
|
||||||
"ARSR",
|
|
||||||
"DOOMBOTSTEEMO",
|
|
||||||
"STARGUARDIAN",
|
|
||||||
"PROJECT",
|
|
||||||
"ONEFORALL",
|
|
||||||
"TUTORIAL_MODULE_1",
|
|
||||||
"TUTORIAL_MODULE_2",
|
|
||||||
"GAMEMODEX",
|
|
||||||
"PRACTICETOOL"
|
|
||||||
],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/Summoner_haste.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 7,
|
|
||||||
"name": "Heal",
|
|
||||||
"description": "Restores 90-345 Health (depending on champion level) and grants 30% Movement Speed for 1 second to you and target allied champion. This healing is halved for units recently affected by Summoner Heal.",
|
|
||||||
"summonerLevel": 1,
|
|
||||||
"cooldown": 240,
|
|
||||||
"gameModes": [
|
|
||||||
"ARAM",
|
|
||||||
"TUTORIAL",
|
|
||||||
"CLASSIC",
|
|
||||||
"STARGUARDIAN",
|
|
||||||
"GAMEMODEX",
|
|
||||||
"TUTORIAL_MODULE_2",
|
|
||||||
"URF",
|
|
||||||
"ARSR",
|
|
||||||
"ASSASSINATE",
|
|
||||||
"DOOMBOTSTEEMO",
|
|
||||||
"ONEFORALL",
|
|
||||||
"PRACTICETOOL",
|
|
||||||
"TUTORIAL_MODULE_1",
|
|
||||||
"PROJECT"
|
|
||||||
],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/Summoner_heal.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 11,
|
|
||||||
"name": "Smite",
|
|
||||||
"description": "Deals 390-1000 true damage (depending on champion level) to target epic, large, or medium monster or enemy minion. Restores Health based on your maximum life when used against monsters.",
|
|
||||||
"summonerLevel": 9,
|
|
||||||
"cooldown": 15,
|
|
||||||
"gameModes": [
|
|
||||||
"URF",
|
|
||||||
"CLASSIC",
|
|
||||||
"ARSR",
|
|
||||||
"DOOMBOTSTEEMO",
|
|
||||||
"ONEFORALL",
|
|
||||||
"PRACTICETOOL",
|
|
||||||
"TUTORIAL",
|
|
||||||
"GAMEMODEX"
|
|
||||||
],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/Summoner_smite.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 12,
|
|
||||||
"name": "Teleport",
|
|
||||||
"description": "After channeling for 4 seconds, teleports your champion to target allied structure, minion, or ward.",
|
|
||||||
"summonerLevel": 7,
|
|
||||||
"cooldown": 360,
|
|
||||||
"gameModes": [
|
|
||||||
"CLASSIC",
|
|
||||||
"TUTORIAL",
|
|
||||||
"ASSASSINATE",
|
|
||||||
"ARSR",
|
|
||||||
"DOOMBOTSTEEMO",
|
|
||||||
"ONEFORALL",
|
|
||||||
"PRACTICETOOL",
|
|
||||||
"GAMEMODEX"
|
|
||||||
],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/Summoner_teleport.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 13,
|
|
||||||
"name": "Clarity",
|
|
||||||
"description": "Restores 50% of your champion's maximum Mana. Also restores allies for 25% of their maximum Mana.",
|
|
||||||
"summonerLevel": 6,
|
|
||||||
"cooldown": 240,
|
|
||||||
"gameModes": [
|
|
||||||
"ODIN",
|
|
||||||
"ARAM",
|
|
||||||
"ASCENSION",
|
|
||||||
"FIRSTBLOOD"
|
|
||||||
],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/SummonerMana.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 14,
|
|
||||||
"name": "Ignite",
|
|
||||||
"description": "Ignites target enemy champion, dealing 70-410 true damage (depending on champion level) over 5 seconds, grants you vision of the target, and reduces healing effects on them for the duration.",
|
|
||||||
"summonerLevel": 9,
|
|
||||||
"cooldown": 180,
|
|
||||||
"gameModes": [
|
|
||||||
"CLASSIC",
|
|
||||||
"ODIN",
|
|
||||||
"TUTORIAL",
|
|
||||||
"ARAM",
|
|
||||||
"ASCENSION",
|
|
||||||
"FIRSTBLOOD",
|
|
||||||
"ASSASSINATE",
|
|
||||||
"URF",
|
|
||||||
"ARSR",
|
|
||||||
"DOOMBOTSTEEMO",
|
|
||||||
"ONEFORALL",
|
|
||||||
"GAMEMODEX",
|
|
||||||
"PRACTICETOOL"
|
|
||||||
],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/SummonerIgnite.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 21,
|
|
||||||
"name": "Barrier",
|
|
||||||
"description": "Shields your champion from 115-455 damage (depending on champion level) for 2 seconds.",
|
|
||||||
"summonerLevel": 4,
|
|
||||||
"cooldown": 180,
|
|
||||||
"gameModes": [
|
|
||||||
"ARAM",
|
|
||||||
"FIRSTBLOOD",
|
|
||||||
"TUTORIAL",
|
|
||||||
"CLASSIC",
|
|
||||||
"STARGUARDIAN",
|
|
||||||
"GAMEMODEX",
|
|
||||||
"PROJECT",
|
|
||||||
"ARSR",
|
|
||||||
"ASSASSINATE",
|
|
||||||
"DOOMBOTSTEEMO",
|
|
||||||
"ONEFORALL",
|
|
||||||
"PRACTICETOOL",
|
|
||||||
"URF"
|
|
||||||
],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/SummonerBarrier.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 30,
|
|
||||||
"name": "To the King!",
|
|
||||||
"description": "Quickly travel to the Poro King's side.",
|
|
||||||
"summonerLevel": 1,
|
|
||||||
"cooldown": 10,
|
|
||||||
"gameModes": [
|
|
||||||
"KINGPORO"
|
|
||||||
],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/Benevolence_Of_King_Poro_Icon.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 31,
|
|
||||||
"name": "Poro Toss",
|
|
||||||
"description": "Toss a Poro at your enemies. If it hits, you can quickly travel to your target as a follow up.",
|
|
||||||
"summonerLevel": 1,
|
|
||||||
"cooldown": 20,
|
|
||||||
"gameModes": [
|
|
||||||
"KINGPORO"
|
|
||||||
],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/Trailblazer_Poro_Icon.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 32,
|
|
||||||
"name": "Mark",
|
|
||||||
"description": "Throw a snowball in a straight line at your enemies. If it hits an enemy, they become marked, granting True Sight, and your champion can quickly travel to the marked target as a follow up.",
|
|
||||||
"summonerLevel": 6,
|
|
||||||
"cooldown": 80,
|
|
||||||
"gameModes": [
|
|
||||||
"ARAM",
|
|
||||||
"FIRSTBLOOD"
|
|
||||||
],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/Summoner_Mark.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 39,
|
|
||||||
"name": "Ultra (Rapidly Flung) Mark",
|
|
||||||
"description": "It's a snowball! It's a Poro! It's...uh...one of those.",
|
|
||||||
"summonerLevel": 6,
|
|
||||||
"cooldown": 80,
|
|
||||||
"gameModes": [
|
|
||||||
"SNOWURF"
|
|
||||||
],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/Summoner_Mark.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 50,
|
|
||||||
"name": "Resuscitate",
|
|
||||||
"description": "Revive a fallen friend by remaining next to them for 2 seconds. Exiting the area early does not consume your cooldown. ",
|
|
||||||
"summonerLevel": 1,
|
|
||||||
"cooldown": 100,
|
|
||||||
"gameModes": [
|
|
||||||
"ODYSSEY"
|
|
||||||
],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/SummonerTemp2.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 51,
|
|
||||||
"name": "Ghost",
|
|
||||||
"description": "Your champion gains increased Movement Speed and can move through units for 10 seconds. Grants a maximum of 28-45% (depending on champion level) Movement Speed after accelerating for 2 seconds.",
|
|
||||||
"summonerLevel": 1,
|
|
||||||
"cooldown": 120,
|
|
||||||
"gameModes": [],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/Summoner_haste.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 52,
|
|
||||||
"name": "Warp",
|
|
||||||
"description": "Dash through spacetime, becoming briefly untargetable and invulnerable as you rapidly move towards a location.",
|
|
||||||
"summonerLevel": 1,
|
|
||||||
"cooldown": 0,
|
|
||||||
"gameModes": [
|
|
||||||
"ODYSSEY"
|
|
||||||
],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/SummonerTemp1.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 54,
|
|
||||||
"name": "Placeholder",
|
|
||||||
"description": "",
|
|
||||||
"summonerLevel": 1,
|
|
||||||
"cooldown": 0,
|
|
||||||
"gameModes": ["ULTBOOK"],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/Summoner_Empty.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 55,
|
|
||||||
"name": "Placeholder and Attack-Smite",
|
|
||||||
"description": "This slot will be replaced by another champion's ultimate and you will gain Attack-Smite. There will be 30 seconds to select an ultimate. Be prepared!",
|
|
||||||
"summonerLevel": 1,
|
|
||||||
"cooldown": 0,
|
|
||||||
"gameModes": ["ULTBOOK"],
|
|
||||||
"iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/Summoner_EmptySmite.png"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import { createCDragonAssetUrl, secToTime, timeDifference } from '@/helpers/functions.js'
|
import { createCDragonAssetUrl, secToTime, timeDifference } from '@/helpers/functions.js'
|
||||||
import { maps, gameModes } from '@/data/data.js'
|
import { maps, gameModes } from '@/data/data.js'
|
||||||
import summonerSpells from '@/data/summonerSpells.json'
|
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
|
|
||||||
const leaguesNumbers = { 'I': 1, 'II': 2, 'III': 3, 'IV': 4 }
|
const leaguesNumbers = { 'I': 1, 'II': 2, 'III': 3, 'IV': 4 }
|
||||||
|
|
@ -117,13 +116,3 @@ function getLeagueData(leagueData, leagueName) {
|
||||||
export function getRankImg(leagueData) {
|
export function getRankImg(leagueData) {
|
||||||
return `https://res.cloudinary.com/kln/image/upload/v1571671133/ranks/${leagueData.tier}_${leaguesNumbers[leagueData.rank]}.png`
|
return `https://res.cloudinary.com/kln/image/upload/v1571671133/ranks/${leagueData.tier}_${leaguesNumbers[leagueData.rank]}.png`
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getSummonerLink(id) {
|
|
||||||
if (id === 0) return null
|
|
||||||
|
|
||||||
const spell = summonerSpells.find((s) => s.id === id)
|
|
||||||
if (!spell) return null
|
|
||||||
|
|
||||||
const spellName = spell.iconPath.split('/assets/')[1].toLowerCase()
|
|
||||||
return `https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/${spellName}`
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,8 @@ class LiveMatchSerializer extends MatchSerializer {
|
||||||
rank: ranks[index],
|
rank: ranks[index],
|
||||||
champion: this.getChampion(player.championId),
|
champion: this.getChampion(player.championId),
|
||||||
perks,
|
perks,
|
||||||
|
summonerSpell1: this.getSummonerSpell(player.spell1Id),
|
||||||
|
summonerSpell2: this.getSummonerSpell(player.spell2Id),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue