created energy and set component (a la rarity) and added to CardModal.astro
This commit is contained in:
@@ -38,7 +38,8 @@ const formatPrice = (price:any) => {
|
||||
const order = ["Near Mint", "Lightly Played", "Moderately Played", "Heavily Played", "Damaged"];
|
||||
---
|
||||
{pokemon.map((card) => (
|
||||
<div class="col">
|
||||
<div data-bs-toggle="modal" data-bs-target="#cardModal">
|
||||
<div class="col tcg-card">
|
||||
<img src={`/cards/${card.productId}.jpg`} alt={card.productName} loading="lazy" decoding="async" class="img-fluid rounded-3 mb-2 card-image w-100" onerror="this.onerror=null;this.src='/cards/noImage.webp'"/>
|
||||
<div class="row row-cols-5 gx-1 price-row mb-2">
|
||||
{card.prices
|
||||
@@ -58,7 +59,8 @@ const order = ["Near Mint", "Lightly Played", "Moderately Played", "Heavily Play
|
||||
<div class="d-flex flex-row lh-1">
|
||||
<div class="copy-small d-none d-lg-flex flex-grow-1">{card.set?.setCode}</div>
|
||||
<div class="copy-small">{card.number}</div>
|
||||
<RarityIcon rarity={card.rarityName} />
|
||||
<span class="ps-2 small-icon"><RarityIcon rarity={card.rarityName} /></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="h5 d-none">Inventory management placeholder</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-9 mt-0">
|
||||
<div class="row g-xxl-4 g-xl-3 g-2 row-cols-2 row-cols-lg-3 row-cols-xl-4">
|
||||
<div class="row g-xxl-3 g-2 row-cols-2 row-cols-lg-3 row-cols-xl-4">
|
||||
<slot name="Card">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,191 @@
|
||||
---
|
||||
import Card from '../components/Card.astro';
|
||||
import ebay from "/vendors/ebay.svg?raw";
|
||||
import EnergyIcon from './EnergyIcon.astro';
|
||||
import RarityIcon from './RarityIcon.astro';
|
||||
import SetIcon from './SetIcon.astro';
|
||||
---
|
||||
|
||||
---
|
||||
<!-- Modal -->
|
||||
<div class="modal fade card-modal" id="cardModal" tabindex="-1" aria-labelledby="cardModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-fullscreen-md-down modal-xl">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header border-0">
|
||||
<div class="container-fluid">
|
||||
<span class="h4 card-title w-100 pe-2">Pikachu</span><span class="text-secondary smaller ps-2 border-start">070/111</span>
|
||||
</div>
|
||||
<button type="button" class="btn-close" aria-label="Close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body pt-0">
|
||||
<div class="container-fluid">
|
||||
<div class="card mb-2 border-0">
|
||||
<div class="row g-4">
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<h6 class="text-secondary">Neo Genesis</h6>
|
||||
<div class="position-relative d-inline-block"><img src="/cards/88072.jpg" class="card-image img-fluid rounded" alt="..."><span class="position-absolute bottom-0 start-0 d-inline"><SetIcon set="Neo Genesis" /></span><span class="position-absolute top-0 end-0 d-inline"><EnergyIcon energy="Electric" /></span><span class="rarity-icon-large position-absolute bottom-0 end-0 d-inline"><RarityIcon rarity="Common" /></span></div>
|
||||
<div class="d-flex flex-row justify-content-between mt-2">
|
||||
<div class="h6 text-secondary">Naoyo Kimura</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-7">
|
||||
<nav>
|
||||
<div class="nav nav-tabs nav-sm-fill border-0" id="nav-tab" role="tablist">
|
||||
<button class="nav-link nm active" id="nav-nm" data-bs-toggle="tab" data-bs-target="#nav-nm" type="button" role="tab" aria-controls="nav-nm" aria-selected="true"><span class="d-none d-md-inline">Near Mint</span><span class="d-md-none">NM</span></button>
|
||||
<button class="nav-link lp" id="nav-lp" data-bs-toggle="tab" data-bs-target="#nav-lp" type="button" role="tab" aria-controls="nav-lp" aria-selected="false"><span class="d-none d-md-inline">Lightly Played</span><span class="d-md-none">LP</span></button>
|
||||
<button class="nav-link mp" id="nav-mp" data-bs-toggle="tab" data-bs-target="#nav-mp" type="button" role="tab" aria-controls="nav-mp" aria-selected="false"><span class="d-none d-md-inline">Moderately Played</span><span class="d-md-none">MP</span></button>
|
||||
<button class="nav-link hp" id="nav-hp" data-bs-toggle="tab" data-bs-target="#nav-hp" type="button" role="tab" aria-controls="nav-hp" aria-selected="false"><span class="d-none d-md-inline">Heavily Played</span><span class="d-md-none">HP</span></button>
|
||||
<button class="nav-link dmg" id="nav-dmg" data-bs-toggle="tab" data-bs-target="#nav-dmg" type="button" role="tab" aria-controls="nav-dmg" aria-selected="false"><span class="d-none d-md-inline">Damaged</span><span class="d-md-none">DMG</span></button>
|
||||
<button class="nav-link vendor" id="nav-vendor" data-bs-toggle="tab" data-bs-target="#nav-vendor" type="button" role="tab" aria-controls="nav-vendor" aria-selected="false"><span class="d-none d-md-inline">Inventory</span><span class="d-md-none">+/-</span></button>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="tab-content" id="nav-tabContent">
|
||||
<div class="tab-pane fade show active" id="nav-nm" role="tabpanel" aria-labelledby="nav-nm" tabindex="0">
|
||||
<div class="row g-2 mt-2">
|
||||
<div class="d-inline-flex justify-content-sm-evenly flex-row flex-md-column flex-wrap flex-md-nowrap mt-2 col-sm-4 col-md-3">
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Market Price</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Lowest Price</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Highest Price</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Volatility</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2 flex-fill">
|
||||
<h6>Latest Sales</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-column mt-2 col-xs-8 col-md-9">
|
||||
<div class="dark-callout rounded p-2 pb-0 h-100">
|
||||
<h6>Placeholder for graph</h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="nav-lp" role="tabpanel" aria-labelledby="nav-lp" tabindex="0">
|
||||
<div class="row g-2 mt-2">
|
||||
<div class="d-flex flex-column mt-2 col-3">
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Market Price</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Lowest Price</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Highest Price</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Volatility</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2 flex-fill">
|
||||
<h6>Latest Sales</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="nav-mp" role="tabpanel" aria-labelledby="nav-mp" tabindex="0">
|
||||
<div class="row g-2 mt-2">
|
||||
<div class="d-flex flex-column mt-2 col-3">
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Market Price</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Lowest Price</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Highest Price</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Volatility</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2 flex-fill">
|
||||
<h6>Latest Sales</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="nav-hp" role="tabpanel" aria-labelledby="nav-hp" tabindex="0">
|
||||
<div class="row g-2 mt-2">
|
||||
<div class="d-flex flex-column mt-2 col-3">
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Market Price</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Lowest Price</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Highest Price</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Volatility</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2 flex-fill">
|
||||
<h6>Latest Sales</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="nav-dmg" role="tabpanel" aria-labelledby="nav-dmg" tabindex="0">
|
||||
<div class="row g-2 mt-2">
|
||||
<div class="d-flex flex-column mt-2 col-3">
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Market Price</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Lowest Price</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Highest Price</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2">
|
||||
<h6>Volatility</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="dark-callout rounded p-2 mb-2 flex-fill">
|
||||
<h6>Latest Sales</h6>
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-2 mt-0 mt-md-5">
|
||||
<button type="button" class="btn btn-secondary mb-2 w-100"><img src="/vendors/tcgplayer.webp"> TCGPlayer</button>
|
||||
<button type="button" class="btn btn-secondary mb-2 w-100"><span set:html={ebay} /></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end my-0"><small class="text-body-secondary">Prices last updated</small></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
33
src/components/EnergyIcon.astro
Normal file
33
src/components/EnergyIcon.astro
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
import grass from "/src/svg/energy/grass.svg?raw";
|
||||
import fairy from "/src/svg/energy/fairy.svg?raw";
|
||||
import dark from "/src/svg/energy/dark.svg?raw";
|
||||
import dragon from "/src/svg/energy/dragon.svg?raw";
|
||||
import fire from "/src/svg/energy/fire.svg?raw";
|
||||
import water from "/src/svg/energy/water.svg?raw";
|
||||
import electric from "/src/svg/energy/electric.svg?raw";
|
||||
import steel from "/src/svg/energy/steel.svg?raw";
|
||||
import colorless from "/src/svg/energy/colorless.svg?raw";
|
||||
import fighting from "/src/svg/energy/fighting.svg?raw";
|
||||
import psychic from "/src/svg/energy/psychic.svg?raw";
|
||||
|
||||
const { energy } = Astro.props;
|
||||
|
||||
const energyMap = {
|
||||
"Grass": grass,
|
||||
"Fairy": fairy,
|
||||
"Dark": dark,
|
||||
"Dragon": dragon,
|
||||
"Fire": fire,
|
||||
"Water": water,
|
||||
"Steel": steel,
|
||||
"Colorless": colorless,
|
||||
"Fighting": fighting,
|
||||
"Psychic": psychic,
|
||||
"Electric": electric,
|
||||
};
|
||||
|
||||
const svg = energyMap[energy as keyof typeof energyMap] ?? "";
|
||||
---
|
||||
|
||||
<div class="energy-icon shadow-filter" set:html={svg}></div>
|
||||
@@ -44,4 +44,4 @@ const rarityMap = {
|
||||
const svg = rarityMap[rarity as keyof typeof rarityMap] ?? "";
|
||||
---
|
||||
|
||||
<div class="rarity-icon ps-2" set:html={svg}></div>
|
||||
<div class="rarity-icon shadow-filter" set:html={svg}></div>
|
||||
|
||||
67
src/components/SetIcon.astro
Normal file
67
src/components/SetIcon.astro
Normal file
@@ -0,0 +1,67 @@
|
||||
---
|
||||
import ancient_origins from "/src/svg/set/ancient_origins.svg?raw";
|
||||
import aquapolis from "/src/svg/set/aquapolis.svg?raw";
|
||||
import arceus from "/src/svg/set/arceus.svg?raw";
|
||||
import astral_radiance from "/src/svg/set/astral_radiance.svg?raw";
|
||||
import base_set_2 from "/src/svg/set/base_set_2.svg?raw";
|
||||
import battle_styles from "/src/svg/set/battle_styles.svg?raw";
|
||||
import best_of_game from "/src/svg/set/best_of_game.svg?raw";
|
||||
import black_and_white from "/src/svg/set/black_and_white.svg?raw";
|
||||
import boundaries_crossed from "/src/svg/set/boundaries_crossed.svg?raw";
|
||||
import box_topper from "/src/svg/set/box_topper.svg?raw";
|
||||
import breakpoint from "/src/svg/set/breakpoint.svg?raw";
|
||||
import breakthrough from "/src/svg/set/breakthrough.svg?raw";
|
||||
import brilliant_stars from "/src/svg/set/brilliant_stars.svg?raw";
|
||||
import burning_shadows from "/src/svg/set/burning_shadows.svg?raw";
|
||||
import call_of_legends from "/src/svg/set/call_of_legends.svg?raw";
|
||||
import celebrations from "/src/svg/set/celebrations.svg?raw";
|
||||
import champions_path from "/src/svg/set/champions_path.svg?raw";
|
||||
import celestial_storm from "/src/svg/set/celestial_storm.svg?raw";
|
||||
import crimson_invasion from "/src/svg/set/crimson_invasion.svg?raw";
|
||||
import darkness_ablaze from "/src/svg/set/darkness_ablaze.svg?raw";
|
||||
import chilling_reign from "/src/svg/set/chilling_reign.svg?raw";
|
||||
import cosmic_eclipse from "/src/svg/set/cosmic_eclipse.svg?raw";
|
||||
import dark_explorers from "/src/svg/set/dark_explorers.svg?raw";
|
||||
import detective_pikachu from "/src/svg/set/detective_pikachu.svg?raw";
|
||||
import diamond_and_pearl from "/src/svg/set/diamond_and_pearl.svg?raw";
|
||||
import double_crisis from "/src/svg/set/double_crisis.svg?raw";
|
||||
import dragon_majesty from "/src/svg/set/dragon_majesty.svg?raw";
|
||||
import neo_genesis from "/src/svg/set/neo_genesis.svg?raw";
|
||||
|
||||
const { set } = Astro.props;
|
||||
|
||||
const setMap = {
|
||||
"Ancient Origins": ancient_origins,
|
||||
"Aquapolis": aquapolis,
|
||||
"Arceus": arceus,
|
||||
"Astral Radiance": astral_radiance,
|
||||
"Base Set 2": base_set_2,
|
||||
"Battle Styles": battle_styles,
|
||||
"Best of Game": best_of_game,
|
||||
"Black and White": black_and_white,
|
||||
"Boundaries Crossed": boundaries_crossed,
|
||||
"Box Topper": box_topper,
|
||||
"Breakpoint": breakpoint,
|
||||
"Breakthrough": breakthrough,
|
||||
"Brilliant Stars": brilliant_stars,
|
||||
"Burning Shadows": burning_shadows,
|
||||
"Call of Legends": call_of_legends,
|
||||
"Celebrations": celebrations,
|
||||
"Champions Path": champions_path,
|
||||
"Celestial Storm": celestial_storm,
|
||||
"Crimson Invasion": crimson_invasion,
|
||||
"Darkness Ablaze": darkness_ablaze,
|
||||
"Chilling Reign": chilling_reign,
|
||||
"Cosmic Eclipse": cosmic_eclipse,
|
||||
"Dark Explorers": dark_explorers,
|
||||
"Detective Pikachu": detective_pikachu,
|
||||
"Diamond and Pearl": diamond_and_pearl,
|
||||
"Double Crisis": double_crisis,
|
||||
"Dragon Majesty": dragon_majesty,
|
||||
"Neo Genesis": neo_genesis,
|
||||
};
|
||||
|
||||
const svg = setMap[set as keyof typeof setMap] ?? "";
|
||||
---
|
||||
|
||||
<div class="set-icon shadow-filter" set:html={svg}></div>
|
||||
Reference in New Issue
Block a user