Skip to content

Commit 0f12445

Browse files
authored
blog tweaks (#40)
1 parent 1e63e4e commit 0f12445

File tree

6 files changed

+85
-9
lines changed

6 files changed

+85
-9
lines changed

app/assets/lima.webp

368 KB
Loading

app/rspack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = {
2424
module: {
2525
rules: [
2626
{
27-
test: /\.(png|jpg|jpeg)$/,
27+
test: /\.(png|jpg|jpeg|webp)$/,
2828
type: "asset/resource",
2929
},
3030
{

app/src/components/Charts.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,29 +73,36 @@ export const StackedAreaChart = <T extends ChartDataPoint>({
7373
<ResponsiveContainer>
7474
<LineChart
7575
data={chartData}
76-
margin={{ top: 40, right: 120, bottom: 60, left: 80 }}
76+
margin={{
77+
top: 20,
78+
right: 30,
79+
bottom: 20,
80+
left: 30,
81+
}}
7782
>
7883
<CartesianGrid strokeDasharray="3 3" stroke={colors.gray[700]} />
7984
<XAxis
8085
dataKey={dateKey as string}
8186
tickFormatter={(date: Date) => dateFormatter(date)}
8287
stroke={colors.gray[400]}
8388
tick={{ fill: colors.gray[300] }}
89+
interval="preserveStartEnd"
8490
/>
8591
<YAxis
8692
tickFormatter={yAxisFormatter}
8793
stroke={colors.gray[400]}
8894
tick={{ fill: colors.gray[300] }}
95+
width={35}
8996
/>
9097
<Tooltip
9198
content={({ active, payload, label }) => {
9299
if (active && payload && payload.length) {
93100
return (
94-
<div className="rounded-lg border border-gray-700 bg-gray-800 p-4 shadow-lg">
95-
<div className="mb-2 font-medium text-base text-gray-200">
101+
<div className="max-w-[250px] rounded-lg border border-gray-700 bg-gray-800 p-2 shadow-lg sm:max-w-none sm:p-4">
102+
<div className="mb-1 font-medium text-gray-200 text-sm sm:mb-2 sm:text-base">
96103
{dateFormatter(label as Date)}
97104
</div>
98-
<div className="space-y-2">
105+
<div className="space-y-1 sm:space-y-2">
99106
{payload
100107
.filter((entry) => entry.value !== 0)
101108
.sort(
@@ -121,20 +128,20 @@ export const StackedAreaChart = <T extends ChartDataPoint>({
121128
className="flex items-center justify-between"
122129
>
123130
<span
124-
className="pr-4 font-medium text-sm"
131+
className="pr-2 font-medium text-xs sm:pr-4 sm:text-sm"
125132
style={{ color: entry.color }}
126133
>
127134
{seriesItem.label}
128135
</span>
129-
<div className="flex items-center gap-2 text-sm">
136+
<div className="flex items-center gap-1 text-xs sm:gap-2 sm:text-sm">
130137
<span className="font-semibold text-gray-200">
131138
{typeof entry.value === "number"
132139
? yAxisFormatter(entry.value)
133140
: entry.value}
134141
</span>
135142
{tournamentCount !== undefined &&
136143
tournamentCount > 0 && (
137-
<span className="text-gray-400">
144+
<span className="hidden text-gray-400 sm:inline">
138145
({tournamentCount} tournament
139146
{tournamentCount !== 1 ? "s" : ""})
140147
</span>

app/src/global.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ declare module "*.svg" {
1515
const value: any;
1616
export = value;
1717
}
18+
19+
declare module "*.webp" {
20+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
21+
const value: any;
22+
export = value;
23+
}

app/src/output.css

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

app/src/routes/Blog/posts/season-reflections.tsx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useQuery } from "@tanstack/react-query";
22
import type { ReactNode } from "react";
3+
import LimaBeans from "../../../../assets/lima.webp";
34
import type { RankingConfig } from "../../../client";
45
import { LeaderboardService } from "../../../client/services/LeaderboardService";
56
import { Link } from "../../../components/Link";
@@ -230,6 +231,19 @@ export const SeasonReflectionsPost: BlogPost = {
230231
many beans. Resulting in the same issue observed in 2024 where
231232
Worlds hands out too many beans.
232233
</p>
234+
<Sep className="mt-4" />
235+
<p>
236+
If you look at the{" "}
237+
<Link to="https://preview.beanstalk.pages.dev/blog/2024-season-reflections">
238+
preview environment chart
239+
</Link>
240+
, the shape of the chart (shown above) looks roughtly the same,
241+
but the peaks are significantly lower. Notice the Y-axis scale
242+
max is about 1/2 the amount of beans as the 2024 season. This
243+
should give a better spread of beans across the season and
244+
reduce the spikes in points. Expect each bean to matter even
245+
more than last year.
246+
</p>
233247
</>
234248
)}
235249
</Section>
@@ -269,7 +283,14 @@ export const SeasonReflectionsPost: BlogPost = {
269283
<Section title="Lima Beans">
270284
Last and certainly not least -- I am happy to announce that the new
271285
season is live! Introducing the name for the 2025 season...
272-
<div className="flex justify-center">Lima</div>
286+
<div className="my-4 flex justify-center">
287+
<Link to="/?season=3&formatCode=standard" className="text-2xl">
288+
Lima Beans
289+
</Link>
290+
</div>
291+
<div className="my-4 flex w-full justify-center">
292+
<img src={LimaBeans} alt="Lima Beans" className="h-64 w-64" />
293+
</div>
273294
</Section>
274295
</BlogContent>
275296
);

0 commit comments

Comments
 (0)