Skip to content

Commit

Permalink
Merge pull request #120 from FleetAdmiralJakob/optimise-lighthouse
Browse files Browse the repository at this point in the history
fix: improved lighthouse score
  • Loading branch information
webdevcody authored Oct 24, 2024
2 parents 9373980 + ca02783 commit f8348d5
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 10 deletions.
1 change: 1 addition & 0 deletions app/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export default function Header() {
rel="noopener noreferrer"
target="_blank"
passHref
aria-label="Link to GitHub repo of the project"
>
<GitHubLogoIcon className="h-4 w-4" />
</Link>
Expand Down
40 changes: 32 additions & 8 deletions app/playground/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,34 +338,58 @@ export default function PlaygroundPage() {
{!userPlaying && !visualizing && (
<>
<div className="absolute left-1/2 top-0 flex -translate-x-1/2 -translate-y-full gap-4">
<button onClick={handleIncreaseUp}>
<button
onClick={handleIncreaseUp}
aria-label="One more row on top"
>
<ChevronUp />
</button>
<button onClick={handleDecreaseUp}>
<button
onClick={handleDecreaseUp}
aria-label="One less row on top"
>
<ChevronDown />
</button>
</div>
<div className="absolute left-0 top-1/2 flex -translate-x-full -translate-y-1/2 flex-col gap-4">
<button onClick={handleIncreaseLeft}>
<button
onClick={handleIncreaseLeft}
aria-label="One more column on left side"
>
<ChevronLeft />
</button>
<button onClick={handleDecreaseLeft}>
<button
onClick={handleDecreaseLeft}
aria-label="One less column on left side"
>
<ChevronRight />
</button>
</div>
<div className="absolute right-0 top-1/2 flex -translate-y-1/2 translate-x-full flex-col gap-4">
<button onClick={handleIncreaseRight}>
<button
onClick={handleIncreaseRight}
aria-label="One more column on right side"
>
<ChevronRight />
</button>
<button onClick={handleDecreaseRight}>
<button
onClick={handleDecreaseRight}
aria-label="One less column on right side"
>
<ChevronLeft />
</button>
</div>
<div className="absolute bottom-0 left-1/2 flex -translate-x-1/2 translate-y-full gap-4">
<button onClick={handleIncreaseDown}>
<button
onClick={handleIncreaseDown}
aria-label="One more row on bottom"
>
<ChevronDown />
</button>
<button onClick={handleDecreaseDown}>
<button
onClick={handleDecreaseDown}
aria-label="One less row on bottom"
>
<ChevronUp />
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function Map({ map, size = 64 }: { map: string[][]; size?: number }) {
return (
<div className="relative">
<img
src="/map.png"
src="/map.webp"
alt="Background Map"
className="absolute inset-0 h-full w-full object-cover opacity-50"
/>
Expand Down
Binary file removed public/map.png
Binary file not shown.
Binary file added public/map.webp
Binary file not shown.
2 changes: 1 addition & 1 deletion renderer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function loadAssets() {
assets.loading = true;

const [bg, box, player, rock, zombie, zombieHit] = await Promise.all([
loadImage("/map.png"),
loadImage("/map.webp"),
loadImage("/entities/block.svg"),
loadImage("/entities/player_alive_1.svg"),
loadImage("/entities/rocks.svg"),
Expand Down

0 comments on commit f8348d5

Please sign in to comment.