Skip to content

Commit

Permalink
Responsive fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenbleasel committed Jun 11, 2024
1 parent c9f69ee commit 57ac58a
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 58 deletions.
54 changes: 26 additions & 28 deletions app/(pages)/(home)/cards/github.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,36 +48,34 @@ const GitHubCard: FC = () => {
const [total, setTotal] = useState(0);

return (
<div className="col-span-2">
<Card title="GitHub Activity" className="p-4">
<div className="flex flex-col gap-4">
<p className="text-neutral-500 dark:text-neutral-400 text-sm">
{total} contributions this year
</p>
<div className="flex flex-col gap-[3px]">
<GitHubCalendar
username="haydenbleasel"
hideMonthLabels
hideColorLegend
hideTotalCount
showWeekdayLabels={false}
colorScheme="light"
transformData={(data) => {
if (!total) {
const commits = data.reduce(
(newTotal, { count }) => newTotal + count,
0
);
setTotal(commits);
}
<Card title="GitHub Activity" className="p-4">
<div className="flex flex-col gap-4">
<p className="text-neutral-500 dark:text-neutral-400 text-sm">
{total} contributions this year
</p>
<div className="flex flex-col gap-[3px]">
<GitHubCalendar
username="haydenbleasel"
hideMonthLabels
hideColorLegend
hideTotalCount
showWeekdayLabels={false}
colorScheme="light"
transformData={(data) => {
if (!total) {
const commits = data.reduce(
(newTotal, { count }) => newTotal + count,
0
);
setTotal(commits);
}

return getContributions(data, 0);
}}
/>
</div>
return getContributions(data, 0);
}}
/>
</div>
</Card>
</div>
</div>
</Card>
);
};

Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/(home)/cards/spotify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const SpotifyCard = async (): Promise<ReactElement> => {
return (
<Card
title="Now Listening"
className="p-4 flex flex-col justify-between gap-4"
className="p-4 flex flex-row md:flex-col md:justify-between gap-4"
>
<Image
src={song.image}
Expand Down
49 changes: 24 additions & 25 deletions app/(pages)/(home)/cards/steam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,32 @@ const SteamCard = async (): Promise<ReactElement> => {
}

return (
<div className="col-span-2">
<Card title="Recently Played" className="p-4 flex justify-between gap-4">
<div className="text-sm flex flex-col justify-between gap-4">
<p>
<Link href={`https://store.steampowered.com/app/${game.id}`}>
{game.name}
</Link>
<Card
title="Recently Played"
className="p-4 flex flex-col sm:flex-row justify-between gap-4"
>
<div className="text-sm flex flex-col justify-between gap-4">
<p>
<Link href={`https://store.steampowered.com/app/${game.id}`}>
{game.name}
</Link>
</p>
<div>
<p className="truncate">🕦 {Math.round(game.playtime / 60)} hours</p>
<p className="truncate">
🏆 {game.completeAchievements} / {game.totalAchievements}
</p>
<div>
<p className="truncate">
🕦 {Math.round(game.playtime / 60)} hours
</p>
<p className="truncate">
🏆 {game.completeAchievements} / {game.totalAchievements}
</p>
</div>
</div>
<Image
src={game.image}
alt=""
width={300}
height={300}
unoptimized
className="rounded m-0 shrink-0"
/>
</Card>
</div>
</div>
<Image
src={game.image}
alt=""
width={300}
height={300}
unoptimized
className="rounded m-0 shrink-0"
/>
</Card>
);
};

Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/(home)/components/hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Avatar } from './avatar';
import type { FC } from 'react';

export const Hero: FC = () => (
<h1 className="tracking-tight leading-tight">
<h1 className="tracking-tight leading-tight text-3xl sm:text-4xl">
Hello <Wave /> I’m Hayden Bleasel <Avatar />
. I’m an Australian 🦘 Product Designer 🖼️ and Software Engineer <GitHub />{' '}
currently based in <Location />.
Expand Down
10 changes: 7 additions & 3 deletions app/(pages)/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ const Home: FC = () => (
<>
<Hero />
<Newsletter />
<div className="grid grid-cols-3 gap-3 prose-p:m-0 prose-img:m-0">
<GitHubCard />
<div className="grid md:grid-cols-3 gap-3 prose-p:m-0 prose-img:m-0">
<div className="md:col-span-2">
<GitHubCard />
</div>
<AnnouncementCard />
<SpotifyCard />
<SteamCard />
<div className="md:col-span-2">
<SteamCard />
</div>
</div>
</>
);
Expand Down

0 comments on commit 57ac58a

Please sign in to comment.