🐞 fix: Update market/shop styles

This commit is contained in:
Keith Solomon
2026-02-11 22:36:10 -06:00
parent 86c58e8930
commit e74e8a3ff8
2 changed files with 22 additions and 34 deletions

View File

@@ -136,9 +136,6 @@ try {
<?php require __DIR__ . '/main-menu.php'; ?>
<h1 class="text-3xl font-bold mb-6 underline decoration-gray-300 w-full"><a href="market.php">Spacetraders - Markets</a></h1>
<p class="mb-4">
<a href="shop.php" class="px-3 py-2 bg-emerald-700 rounded hover:bg-emerald-600 inline-block">Open Shop</a>
</p>
<?php if (isset( $tokenError ) ) : ?>
<div class="mb-6 border border-red-500 p-4 rounded text-red-300">
@@ -156,8 +153,7 @@ try {
<?php endif; ?>
<p class="mb-6">
Credits: <span class="font-semibold"><?php echo number_format( (int) ( $agent['credits'] ?? 0 ) ); ?></span>
| Ships: <span class="font-semibold"><?php echo number_format( count( $ships ) ); ?></span>
Ships: <span class="font-semibold"><?php echo number_format( count( $ships ) ); ?></span>
| Stationed Waypoints: <span class="font-semibold"><?php echo number_format( count( $marketRecords ) ); ?></span>
</p>
@@ -173,39 +169,35 @@ try {
$exports = (array) ( $record['data']['exports'] ?? array() );
$exchange = (array) ( $record['data']['exchange'] ?? array() );
?>
<div class="mb-6 border border-gray-600 p-4 rounded">
<h2 class="text-2xl font-bold mb-2">
<?php echo htmlspecialchars( (string) ( $record['waypointSymbol'] ?? '' ) ); ?>
</h2>
<p class="text-sm text-gray-300 mb-3">
System: <?php echo htmlspecialchars( (string) ( $record['systemSymbol'] ?? '' ) ); ?>
| Ships Here: <?php echo htmlspecialchars( implode( ', ', (array) ( $record['shipSymbols'] ?? array() ) ) ); ?>
| Ships Here: <?php echo htmlspecialchars( formatString( implode( ', ', (array) ( $record['shipSymbols'] ?? array() ) ) ) ); ?>
</p>
<?php if ((string) ( $record['error'] ?? '' ) !== '' ) : ?>
<p class="text-red-300"><?php echo htmlspecialchars( (string) $record['error'] ); ?></p>
<?php else : ?>
<p class="mb-3">
<a
href="shop.php?waypoint=<?php echo urlencode( (string) ( $record['waypointSymbol'] ?? '' ) ); ?>"
class="text-blue-300 hover:underline"
>
Shop At This Waypoint
</a>
<a class="text-blue-300 hover:underline" href="shop.php?waypoint=<?php echo urlencode( (string) ( $record['waypointSymbol'] ?? '' ) ); ?>">Shop At This Waypoint</a>
</p>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div>
<h3 class="font-bold mb-2">Imports</h3>
<?php if (empty( $imports ) ) : ?>
<p class="text-gray-400 text-sm">None</p>
<?php else : ?>
<ul class="list-disc list-inside text-sm">
<?php foreach ( $imports as $item ) : ?>
<li>
<?php echo htmlspecialchars( (string) ( $item['symbol'] ?? '' ) ); ?>
<?php if ((string) ( $item['name'] ?? '' ) !== '' ) : ?>
(<?php echo htmlspecialchars( (string) $item['name'] ); ?>)
<?php endif; ?>
<?php echo htmlspecialchars( (string) ( formatString( $item['symbol'] ?? '' ) ) ); ?>
</li>
<?php endforeach; ?>
</ul>
@@ -214,16 +206,14 @@ try {
<div>
<h3 class="font-bold mb-2">Exports</h3>
<?php if (empty( $exports ) ) : ?>
<p class="text-gray-400 text-sm">None</p>
<?php else : ?>
<ul class="list-disc list-inside text-sm">
<?php foreach ( $exports as $item ) : ?>
<li>
<?php echo htmlspecialchars( (string) ( $item['symbol'] ?? '' ) ); ?>
<?php if ((string) ( $item['name'] ?? '' ) !== '' ) : ?>
(<?php echo htmlspecialchars( (string) $item['name'] ); ?>)
<?php endif; ?>
<?php echo htmlspecialchars( (string) ( formatString( $item['symbol'] ?? '' ) ) ); ?>
</li>
<?php endforeach; ?>
</ul>
@@ -238,10 +228,7 @@ try {
<ul class="list-disc list-inside text-sm">
<?php foreach ( $exchange as $item ) : ?>
<li>
<?php echo htmlspecialchars( (string) ( $item['symbol'] ?? '' ) ); ?>
<?php if ((string) ( $item['name'] ?? '' ) !== '' ) : ?>
(<?php echo htmlspecialchars( (string) $item['name'] ); ?>)
<?php endif; ?>
<?php echo htmlspecialchars( (string) ( formatString( $item['symbol'] ?? '' ) ) ); ?>
</li>
<?php endforeach; ?>
</ul>