fix sesison + opacity + new wakz account
This commit is contained in:
parent
4e9872adb5
commit
f53ed15ba8
|
|
@ -66,8 +66,8 @@ export default function Lobby ( { player }: { player: string } )
|
||||||
.map( ( player, i ) =>
|
.map( ( player, i ) =>
|
||||||
{
|
{
|
||||||
const playerClass =
|
const playerClass =
|
||||||
"player flex flex-row justify-between items-center my-2 min-w-56 w-full max-w-[400px] bg-opacity-50 rounded-xl shadow-md " +
|
"player flex flex-row justify-between items-center my-2 min-w-56 w-full max-w-[400px] rounded-xl shadow-md " +
|
||||||
( teamId === 100 ? "bg-sky-800" : "bg-red-800" );
|
( teamId === 100 ? "bg-sky-800-50" : "bg-red-800-50" );
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div key={ i } className={ playerClass }>
|
<div key={ i } className={ playerClass }>
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,14 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
@theme {
|
@theme {
|
||||||
--color-red-600: #e7000b;
|
--color-red-600: rgba(231, 0, 11, 1);
|
||||||
--color-red-800: #9f0712;
|
--color-red-800: rgba(159, 7, 18, 1);
|
||||||
--color-sky-600: #0084d1;
|
--color-red-800-50: rgba(159, 7, 18, 0.5);
|
||||||
--color-sky-800: #00598a;
|
--color-sky-600: rgba(0, 132, 209, 1);
|
||||||
--color-gray-200: #e5e7eb;
|
--color-sky-800: rgba(0, 89, 138, 1);
|
||||||
--color-gray-300: #d1d5dc;
|
--color-sky-800-50: rgba(0, 89, 138, 0.5);
|
||||||
|
--color-gray-200: rgba(229, 231, 235, 1);
|
||||||
|
--color-gray-300: rgba(209, 213, 220, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes slideInOut {
|
@keyframes slideInOut {
|
||||||
|
|
@ -46,11 +48,11 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
.ring-4-red-600 {
|
.ring-4-red-600 {
|
||||||
box-shadow: 0 0 0 4px #e7000b;
|
box-shadow: 0 0 0 4px rgba(231, 0, 11, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.ring-4-sky-600 {
|
.ring-4-sky-600 {
|
||||||
box-shadow: 0 0 0 4px #0084d1;
|
box-shadow: 0 0 0 4px rgba(0, 132, 209, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.scaler-200 {
|
.scaler-200 {
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ export async function fetchRankedStats ( summonerId: string )
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchMatches ( puuid: string )
|
export async function fetchSixMatches ( puuid: string )
|
||||||
{
|
{
|
||||||
const idsRes = await fetch(
|
const idsRes = await fetch(
|
||||||
`https://${ REGION_GROUP }.api.riotgames.com/lol/match/v5/matches/by-puuid/${ puuid }/ids?queue=420&count=6`,
|
`https://${ REGION_GROUP }.api.riotgames.com/lol/match/v5/matches/by-puuid/${ puuid }/ids?queue=420&count=6`,
|
||||||
|
|
@ -135,13 +135,46 @@ export async function fetchMatches ( puuid: string )
|
||||||
|
|
||||||
return matches;
|
return matches;
|
||||||
}
|
}
|
||||||
|
export async function fetchMatches ( puuid: string )
|
||||||
|
{
|
||||||
|
const idsRes = await fetch(
|
||||||
|
`https://${ REGION_GROUP }.api.riotgames.com/lol/match/v5/matches/by-puuid/${ puuid }/ids?queue=420`,
|
||||||
|
{ headers }
|
||||||
|
);
|
||||||
|
if ( !idsRes.ok ) throw new Error( "Match list fetch failed" );
|
||||||
|
|
||||||
|
const matchIds = await idsRes.json();
|
||||||
|
|
||||||
|
const matches = await Promise.all(
|
||||||
|
matchIds.map( async ( matchId: string ) =>
|
||||||
|
{
|
||||||
|
const res = await fetch(
|
||||||
|
`https://${ REGION_GROUP }.api.riotgames.com/lol/match/v5/matches/${ matchId }`,
|
||||||
|
{ headers }
|
||||||
|
);
|
||||||
|
const match = await res.json();
|
||||||
|
const participant = match.info.participants.find( ( p: any ) => p.puuid === puuid );
|
||||||
|
return {
|
||||||
|
matchId,
|
||||||
|
kills: participant.kills,
|
||||||
|
deaths: participant.deaths,
|
||||||
|
assists: participant.assists,
|
||||||
|
championImg: getChampionSquare( participant.championId ),
|
||||||
|
win: participant.win,
|
||||||
|
isOld: isOlderThanHoursAgo( match.info.gameCreation, 12 ),
|
||||||
|
};
|
||||||
|
} )
|
||||||
|
);
|
||||||
|
|
||||||
|
return matches;
|
||||||
|
}
|
||||||
|
|
||||||
export async function getRankedData ( name: string, tag: string )
|
export async function getRankedData ( name: string, tag: string )
|
||||||
{
|
{
|
||||||
const account = await fetchAccount( name, tag );
|
const account = await fetchAccount( name, tag );
|
||||||
const summoner = await fetchSummoner( account.puuid );
|
const summoner = await fetchSummoner( account.puuid );
|
||||||
const [ matches, rankedStats ] = await Promise.all( [
|
const [ matches, rankedStats ] = await Promise.all( [
|
||||||
fetchMatches( account.puuid ),
|
fetchSixMatches( account.puuid ),
|
||||||
fetchRankedStats( summoner.id ),
|
fetchRankedStats( summoner.id ),
|
||||||
] );
|
] );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@ export default function Page ()
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div>
|
<div>
|
||||||
<a href="/ranked/sly%20wakz/euw">ranked</a>
|
<a href="/ranked/jules%20césar/gaule">ranked</a>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a href="/session/sly%20wakz/euw">session</a>
|
<a href="/session/jules%20césar/gaule">session</a>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a href="/lobby/wakz">lobby</a>
|
<a href="/lobby/wakz">lobby</a>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue