mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 08:45:38 +02:00
✨ feat: Game card
This commit is contained in:
@@ -42,9 +42,9 @@ app.notFound((c) => c.json({ message: 'Not Found', ok: false }, 404))
|
||||
|
||||
app.get('/:id', middleware, async (c) => {
|
||||
const [gameId, imageType] = c.req.param("id").split('.');
|
||||
const width = parseInt(c.req.query("width") || "600");
|
||||
const width = parseInt(c.req.query("width") || "460");
|
||||
//We don't even use this, but let us keep it for future use
|
||||
const height = parseInt(c.req.query("height") || "900");
|
||||
const height = parseInt(c.req.query("height") || "215");
|
||||
if (!gameId || !imageType) {
|
||||
return c.text("Invalid image parameters", 400)
|
||||
}
|
||||
|
||||
@@ -1,10 +1,63 @@
|
||||
import { component$ } from "@builder.io/qwik";
|
||||
import { HomeNavBar } from "@nestri/ui";
|
||||
import { GameCard, HomeNavBar, Card } from "@nestri/ui";
|
||||
|
||||
function getGreeting(): string {
|
||||
const hour = new Date().getHours();
|
||||
if (hour < 12) return "Good Morning";
|
||||
if (hour < 18) return "Good Afternoon";
|
||||
return "Good Evening";
|
||||
}
|
||||
|
||||
export default component$(() => {
|
||||
return (
|
||||
<>
|
||||
<HomeNavBar />
|
||||
<section class="flex flex-col gap-4 justify-center pt-20 items-center w-full text-left pb-4">
|
||||
<div class="flex flex-col gap-4 mx-auto max-w-xl w-full">
|
||||
<h1 class="text-5xl font-bold font-title">{getGreeting()}, Wanjohi</h1>
|
||||
<p class="dark:text-gray-50/70 text-gray-950/70 text-xl">What will you play today?</p>
|
||||
</div>
|
||||
</section>
|
||||
<section class="flex flex-col gap-4 justify-center pt-10 items-center w-full text-left pb-4">
|
||||
<div class="flex gap-4 mx-auto max-w-xl w-full">
|
||||
{/* <GameCard
|
||||
game={{
|
||||
release_date: 1478710740000,
|
||||
compatibility: 'playable',
|
||||
name: 'World of Tanks Blitz',
|
||||
appid: '444200',
|
||||
teams: 10
|
||||
}}
|
||||
/><GameCard
|
||||
game={{
|
||||
release_date: 1478710740000,
|
||||
compatibility: 'playable',
|
||||
name: 'World of Tanks Blitz',
|
||||
appid: '444200',
|
||||
teams: 10
|
||||
}}
|
||||
/> */}
|
||||
</div>
|
||||
<div class="gap-4 mx-auto max-w-xl w-full grid grid-cols-1 md:grid-cols-2">
|
||||
<Card
|
||||
game={{
|
||||
// release_date: 1478710740000,
|
||||
// compatibility: 'playable',
|
||||
name: 'The Lord of the Rings: Return to Moria™',
|
||||
id: 2933130,
|
||||
// teams: 10
|
||||
}}
|
||||
/><Card
|
||||
game={{
|
||||
// release_date: 1478710740000,
|
||||
// compatibility: 'playable',
|
||||
name: 'Control Ultimate Edition',
|
||||
id: 870780,
|
||||
// teams: 10
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
</>
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user