Skip to content

Commit dcd995b

Browse files
hh
1 parent 0a33742 commit dcd995b

6 files changed

Lines changed: 133 additions & 183 deletions

File tree

package-lock.json

Lines changed: 122 additions & 118 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pages/api/Yugioh/card/[cardId]/update-price.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ export default async function handler( req, res ) {
1313

1414
try {
1515
await recordPriceHistoryEntry( {
16-
cardId,
17-
setName,
18-
number,
19-
rarity,
20-
edition,
16+
cardId: cardId,
17+
setName: setName,
18+
number: number,
19+
rarity: rarity,
20+
edition: edition,
2121
price: numericPrice,
2222
} );
2323

pages/api/Yugioh/cards.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import clientPromise from "@/utils/mongo.js";
22
import { requireUser } from "@/proxy/authenticate";
33
import { ensureSafeUserId, coerceNumberField, coerceStringField } from "@/utils/securityValidators.js";
44

5-
const MAX_CARDS_PER_REQUEST = 200;
5+
const MAX_CARDS_PER_REQUEST = 5000;
66
const MAX_QUANTITY_PER_CARD = 1000;
77

88
const buildCardKey = ( card ) => [

pages/index.js

Lines changed: 4 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ export default function LandingPage() {
4848
: "linear-gradient(90deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.78))";
4949

5050
return (
51-
<div className="relative min-h-screen overflow-hidden bg-slate-950">
51+
<div className="relative min-h-screen backdrop overflow-hidden bg-slate-950 flex md:flex-row">
5252
<div
5353
id="parallax"
5454
ref={ parallaxRef }
55-
className={ `parallax-layer absolute inset-0 pointer-events-none ${ hoveredPanel ? "opacity-95" : "opacity-80" }` }
55+
className={ `parallax absolute inset-0 pointer-events-none ${ hoveredPanel ? "opacity-95" : "opacity-80" }` }
5656
style={ { zIndex: -2 } }
5757
aria-hidden="true"
5858
/>
@@ -72,7 +72,7 @@ export default function LandingPage() {
7272
<div className="absolute inset-0 overflow-hidden">
7373
<div
7474
className="panel-bg"
75-
style={ { backgroundImage: 'url("/images/backgrounds/yugioh/background.svg")' } }
75+
style={ { backgroundImage: `url("backgrounds/yugioh/background.svg")` } }
7676
aria-hidden="true"
7777
/>
7878
</div>
@@ -94,7 +94,7 @@ export default function LandingPage() {
9494
<div className="absolute inset-0 overflow-hidden">
9595
<div
9696
className="panel-bg"
97-
style={ { backgroundImage: 'url("/images/backgrounds/sports/sportsbg.svg")' } }
97+
style={ { backgroundImage: `url("backgrounds/sports/sportsbg.svg")` } }
9898
aria-hidden="true"
9999
/>
100100
</div>
@@ -107,52 +107,6 @@ export default function LandingPage() {
107107
</div>
108108
</div>
109109
</div>
110-
<style jsx>{ `
111-
.panel-root {
112-
overflow: hidden;
113-
isolation: isolate;
114-
}
115-
116-
.panel-bg {
117-
position: absolute;
118-
inset: 0;
119-
background-repeat: no-repeat;
120-
background-size: cover;
121-
background-position: 50% 50%;
122-
transition:
123-
transform 900ms cubic-bezier(0.22, 1, 0.36, 1),
124-
filter 480ms ease,
125-
opacity 320ms ease;
126-
will-change: transform;
127-
z-index: 0;
128-
}
129-
130-
.panel-root:hover .panel-bg,
131-
.panel-root:focus-visible .panel-bg {
132-
transform: scale(1.06) translateZ(0);
133-
filter: saturate(1.1) brightness(1.05);
134-
}
135-
136-
.parallax-layer {
137-
background-image:
138-
url("https://raw.githubusercontent.com/oscicen/oscicen.github.io/master/img/depth-3.png"),
139-
url("https://raw.githubusercontent.com/oscicen/oscicen.github.io/master/img/depth-2.png"),
140-
url("https://raw.githubusercontent.com/oscicen/oscicen.github.io/master/img/depth-1.png");
141-
background-repeat: no-repeat;
142-
background-position: 50% 50%, 50% 50%, 50% 50%;
143-
background-size: cover, cover, cover;
144-
transition: background-position 120ms ease-out, opacity 320ms ease, filter 320ms ease;
145-
filter: saturate(0.95) brightness(1.05);
146-
}
147-
148-
@media (max-width: 768px) {
149-
.parallax-layer {
150-
background-size: 140% auto, 140% auto, 140% auto;
151-
opacity: 0.7;
152-
}
153-
}
154-
` }
155-
</style>
156110
</div>
157111
);
158112
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"moduleResolution": "bundler",
2222
"resolveJsonModule": true,
2323
"isolatedModules": true,
24-
"jsx": "react-jsx"
24+
"jsx": "preserve"
2525
},
2626
"include": [
2727
"next-env.d.ts",

utils/api.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const API_ENDPOINT = `https://${ process.env.GET_CARD_SETS_API }/v2/Catalog/SetN
22

33
// Cache for set name to ID mapping and card data
44
let setNameIdCache = null;
5-
const cardDataCache = {};
65

76
// Fetches set data dynamically and builds setNameIdMap
87
async function fetchSetData() {
@@ -43,11 +42,6 @@ export async function getCardData( setName ) {
4342
const setNameIdMap = await getSetNameIdMap();
4443
const setNameId = setNameIdMap[ setName ];
4544

46-
if ( cardDataCache[ setName ] ) {
47-
console.log( "Using cached data for set:", setName );
48-
return cardDataCache[ setName ];
49-
}
50-
5145
if ( !setNameId ) {
5246
throw new Error( "Set name not found in mapping" );
5347
}
@@ -63,8 +57,6 @@ export async function getCardData( setName ) {
6357

6458
const data = await response.json();
6559
console.log( "Received card data:", data );
66-
67-
cardDataCache[ setName ] = data; // Cache the fetched data
6860
return data;
6961
} catch ( error ) {
7062
console.error( "Error fetching card data:", error );

0 commit comments

Comments
 (0)