armory
This commit is contained in:
@@ -1,4 +1,9 @@
|
|||||||
<div class="header-container">
|
<div class="header-container">
|
||||||
|
<div>
|
||||||
|
<a (click)="toggleSidebar()" href="#" class="sidebar-toggle">
|
||||||
|
<nb-icon icon="menu-2-outline"></nb-icon>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
<div class="logo-container">
|
<div class="logo-container">
|
||||||
<a (click)="toggleSidebar()" href="#" class="sidebar-toggle">
|
<a (click)="toggleSidebar()" href="#" class="sidebar-toggle">
|
||||||
<nb-icon icon="menu-2-outline"></nb-icon>
|
<nb-icon icon="menu-2-outline"></nb-icon>
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<nb-card
|
||||||
|
class = "col-12 col-xl-9"
|
||||||
|
status="control">
|
||||||
|
<nb-card-header style="text-transform: capitalize;">
|
||||||
|
<h4>
|
||||||
|
Armory
|
||||||
|
</h4>
|
||||||
|
</nb-card-header>
|
||||||
|
|
||||||
|
<nb-card-body>
|
||||||
|
<div>
|
||||||
|
<input name="Character" [(ngModel)]="charactername" placeholder="Character Name" nbInput>
|
||||||
|
<nb-select [(selected)]="server" placeholder="Spec">
|
||||||
|
<nb-option *ngFor="let sv of servers" [value]="sv">{{sv}}</nb-option>
|
||||||
|
</nb-select>
|
||||||
|
<button nbButton
|
||||||
|
(click)="submit()"
|
||||||
|
status="primary"
|
||||||
|
size="medium"
|
||||||
|
[disabled]="charactername == ''"
|
||||||
|
[class.btn-pulse]="submitted">
|
||||||
|
Go
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<ng-container *ngFor="let item of gear">
|
||||||
|
<wowhead [item]="item"></wowhead><br />
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
</nb-card-body>
|
||||||
|
</nb-card>
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { Item } from '../../../../../../backend/Types/Types';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'armory',
|
||||||
|
templateUrl: './armory.component.html',
|
||||||
|
})
|
||||||
|
export class FrontcraftArmoryComponent implements OnInit{
|
||||||
|
|
||||||
|
servers = servers
|
||||||
|
charactername = ""
|
||||||
|
server = "Gandling"
|
||||||
|
region = "EU"
|
||||||
|
gear:string[] = []
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
){}
|
||||||
|
|
||||||
|
async submit(){
|
||||||
|
const dataLink = "https://classic.warcraftlogs.com:443/v1/parses/character/"+this.charactername.toLowerCase().replace(/^\w/, c => c.toUpperCase())+"/"+this.server+"/"+this.region+"?api_key=c698515ab4f592cdb848d80b3abe616c&metric=dps"
|
||||||
|
|
||||||
|
fetch(dataLink).then(raw => raw.json().then((json:any[]) => {
|
||||||
|
if(json.length < 1) return
|
||||||
|
let min = -1
|
||||||
|
let data = null
|
||||||
|
|
||||||
|
json.forEach(item => {
|
||||||
|
if(item.startTime > min){
|
||||||
|
min = item.startTime
|
||||||
|
data = item
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
this.gear = data.gear.map(item => {return <Item>{
|
||||||
|
itemname: item.name,
|
||||||
|
iconname: item.icon.replace('.jpg', ''),
|
||||||
|
quality: item.quality.replace(/^\w/, c => c.toUpperCase()),
|
||||||
|
url: "https://classic.wowhead.com/item="+item.id
|
||||||
|
}})
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
async ngOnInit(){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const servers = [
|
||||||
|
"Ashbringer"
|
||||||
|
,"Bloodfang"
|
||||||
|
,"Dreadmist"
|
||||||
|
,"Firemaw"
|
||||||
|
,"Flamelash"
|
||||||
|
,"Gandling"
|
||||||
|
,"Gehennas"
|
||||||
|
,"Golemagg"
|
||||||
|
,"Hydraxian Waterlords"
|
||||||
|
,"Judgement"
|
||||||
|
,"Mirage Rach"
|
||||||
|
,"Mograine"
|
||||||
|
,"Nethergarde"
|
||||||
|
,"Noggenfogg"
|
||||||
|
,"Pyrewood Village"
|
||||||
|
,"Razorgore"
|
||||||
|
,"Shazzrah"
|
||||||
|
,"Skullflame"
|
||||||
|
,"Stonespine"
|
||||||
|
,"Ten Storms"
|
||||||
|
,"Zandalar Tribe"
|
||||||
|
,"Amnennar"
|
||||||
|
,"Auberdine"
|
||||||
|
,"Finkle"
|
||||||
|
,"Sulfuron"
|
||||||
|
,"Everlook"
|
||||||
|
,"Lucifron"
|
||||||
|
,"Razorfen"
|
||||||
|
,"Patchwerk"
|
||||||
|
,"Venoxis"
|
||||||
|
,"Dragon’s Call"
|
||||||
|
,"Lakeshire"
|
||||||
|
,"Transcendence"
|
||||||
|
]
|
||||||
@@ -58,7 +58,7 @@ export class FrontcraftCharacterComponent implements OnInit{
|
|||||||
name: data.encounterName,
|
name: data.encounterName,
|
||||||
date: data.startTime
|
date: data.startTime
|
||||||
}
|
}
|
||||||
this.gear1 = data.gear.map(item => {return <Item>{
|
this.gear2 = data.gear.map(item => {return <Item>{
|
||||||
itemname: item.name,
|
itemname: item.name,
|
||||||
iconname: item.icon.replace('.jpg', ''),
|
iconname: item.icon.replace('.jpg', ''),
|
||||||
quality: item.quality.replace(/^\w/, c => c.toUpperCase()),
|
quality: item.quality.replace(/^\w/, c => c.toUpperCase()),
|
||||||
@@ -77,9 +77,7 @@ export class FrontcraftCharacterComponent implements OnInit{
|
|||||||
date: data.startTime
|
date: data.startTime
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.gear1 = data.gear.map(item => {return <Item>{
|
||||||
|
|
||||||
this.gear2 = data.gear.map(item => {return <Item>{
|
|
||||||
itemname: item.name,
|
itemname: item.name,
|
||||||
iconname: item.icon.replace('.jpg', ''),
|
iconname: item.icon.replace('.jpg', ''),
|
||||||
quality: item.quality.replace(/^\w/, c => c.toUpperCase()),
|
quality: item.quality.replace(/^\w/, c => c.toUpperCase()),
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ export class PagesLayoutComponent implements AfterContentInit{
|
|||||||
icon: 'book-open-outline',
|
icon: 'book-open-outline',
|
||||||
title: 'Loot Rules',
|
title: 'Loot Rules',
|
||||||
link: '/frontcraft/rules',
|
link: '/frontcraft/rules',
|
||||||
|
},{
|
||||||
|
icon: "shield",
|
||||||
|
title: 'Armory',
|
||||||
|
link: '/frontcraft/armory'
|
||||||
}]
|
}]
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { FrontcraftArchiveComponent } from './raid/archive.component';
|
|||||||
import { FrontcraftShopComponent } from './shop/shop.component';
|
import { FrontcraftShopComponent } from './shop/shop.component';
|
||||||
import { FrontcraftRulesComponent } from './rules/rules.component';
|
import { FrontcraftRulesComponent } from './rules/rules.component';
|
||||||
import { FrontcraftCharactersComponent } from './characters/characters.component';
|
import { FrontcraftCharactersComponent } from './characters/characters.component';
|
||||||
|
import { FrontcraftArmoryComponent } from './armory/armory.component';
|
||||||
|
|
||||||
export const routes: Routes = [
|
export const routes: Routes = [
|
||||||
{
|
{
|
||||||
@@ -43,6 +44,10 @@ export const routes: Routes = [
|
|||||||
path: 'rules',
|
path: 'rules',
|
||||||
component: FrontcraftRulesComponent
|
component: FrontcraftRulesComponent
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'armory',
|
||||||
|
component: FrontcraftArmoryComponent
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '**',
|
path: '**',
|
||||||
redirectTo: 'raids'
|
redirectTo: 'raids'
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import { FrontcraftCharactersComponent } from './characters/characters.component
|
|||||||
import { FrontcraftBuyTokenComponent } from './shop/buytoken.component';
|
import { FrontcraftBuyTokenComponent } from './shop/buytoken.component';
|
||||||
import { FrontcraftItemComponent } from './shop/item.component';
|
import { FrontcraftItemComponent } from './shop/item.component';
|
||||||
import { FrontcraftWowheadComponent } from './shop/wowhead.component';
|
import { FrontcraftWowheadComponent } from './shop/wowhead.component';
|
||||||
|
import { FrontcraftArmoryComponent } from './armory/armory.component';
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
@@ -84,7 +85,8 @@ import { FrontcraftWowheadComponent } from './shop/wowhead.component';
|
|||||||
FrontcraftCreateRaidsComponent,
|
FrontcraftCreateRaidsComponent,
|
||||||
FrontcraftBuyTokenComponent,
|
FrontcraftBuyTokenComponent,
|
||||||
FrontcraftWowheadComponent,
|
FrontcraftWowheadComponent,
|
||||||
FrontcraftItemComponent
|
FrontcraftItemComponent,
|
||||||
|
FrontcraftArmoryComponent
|
||||||
],
|
],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
FrontcraftItemSelectComponent,
|
FrontcraftItemSelectComponent,
|
||||||
|
|||||||
Reference in New Issue
Block a user