Skip to content

Commit

Permalink
feat: sports entries
Browse files Browse the repository at this point in the history
  • Loading branch information
flornkm committed Dec 9, 2023
1 parent 09acf54 commit 1e37902
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 33 deletions.
13 changes: 13 additions & 0 deletions content/feed/workout-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Workout
description: My workout routine.
type: sports
date: 08 / 12 / 2023
move: 276
exercise: 60
stand: 180
---

# Workout

Trying to work out every second day. Currently using no apps for it other than the Fitness app on my Apple Watch.
5 changes: 4 additions & 1 deletion pages/feed/@slug/+Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ export default function Page(props: Record<string, string>) {
return (
<>
<div>
<Markdown class="lg:mt-16 max-w-lg mx-auto" content={props.content} />
<Markdown
class="lg:mt-16 max-w-lg mx-auto post"
content={props.content}
/>
</div>
<div class="flex items-center justify-end mb-16 mx-auto max-w-lg">
<Picker
Expand Down
97 changes: 88 additions & 9 deletions pages/feed/index/+Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import "#design-system/feed.css"
import { Post, PostContent } from "../types"
import * as m from "#lang/paraglide/messages"
import Share from "~icons/eva/share-outline"
import Writing from "~icons/eva/edit-2-fill"
import Writing from "~icons/eva/edit-fill"
import Sports from "~icons/eva/award-fill"
import Picker from "#components/Picker"
import { useState } from "preact/hooks"
import Markdown from "#markdown/Markdown"
Expand All @@ -15,6 +16,19 @@ export default function Page({
content: PostContent
}) {
const [copyLabel, setCopyLabel] = useState("Copy link")
posts.sort((a, b) => {
const aDate = new Date(
Number(a.date.split("/")[2]),
Number(a.date.split("/")[1]) - 1,
Number(a.date.split("/")[0])
)
const bDate = new Date(
Number(b.date.split("/")[2]),
Number(b.date.split("/")[1]) - 1,
Number(b.date.split("/")[0])
)
return bDate.getTime() - aDate.getTime()
})
return (
<div class="w-full">
<section class="w-full lg:pt-16">
Expand All @@ -39,22 +53,22 @@ export default function Page({
}
>
<div class="flex items-center justify-between">
<div class="flex items-center gap-1 mb-2">
<div class="flex items-center gap-1 mb-2 text-zinc-400 dark:text-zinc-500 text-sm flex-wrap">
{post.type === "writing" ? (
<div class="text-sm flex items-center gap-1.5 text-zinc-400 dark:text-zinc-500">
<Writing class="inline-block rounded-md p-0.5 bg-zinc-400 text-white dark:bg-zinc-600" />
<div class="text-sm flex items-center gap-1.5">
<Writing class="inline-block" />
Writing
</div>
) : post.type === "sports" ? (
<div class="text-sm pl-1.5 px-2 py-0.5 inline-block rounded-lg font-medium text-amber-500 border border-amber-400">
<Writing class="inline-block mr-2 rounded-full" />
Writing
<div class="text-sm flex items-center gap-1.5">
<Sports class="inline-block" />
Sports Entry
</div>
) : (
<></>
)}
<p class="text-zinc-400 dark:text-zinc-500"></p>
<p class="text-sm text-zinc-400 dark:text-zinc-500">
<p></p>
<p>
{date.toLocaleDateString("en-US", { weekday: "long" })}{" "}
{date.toLocaleDateString("en-US", {
month: "long",
Expand Down Expand Up @@ -87,6 +101,71 @@ export default function Page({
<Share />
</Picker>
</div>
{post.type === "sports" && (
<div class="w-full bg-zinc-100 px-4 py-8 dark:bg-zinc-900 my-4">
<div class="relative w-full grid xs:grid-cols-3 place-items-end gap-4 text-zinc-500 dark:text-zinc-400">
<div class="mx-auto">
<div
style={{
height: "100px",
}}
class="w-8 h-full relative rounded-lg bg-zinc-200 mb-4 dark:bg-zinc-800"
>
<div
style={{
height: post.move / 3 + "px",
}}
class="w-full rounded-md absolute bottom-0 left-0 right-0 bg-rose-500"
/>
<p class="absolute rotate-90 bottom-1 z-10 text-sm -right-6 font-medium text-rose-500">
{post.move}
</p>
</div>
<p class="text-xs text-center mt-2 font-mono">Move</p>
</div>
<div class="mx-auto">
<div
style={{
height: "100px",
}}
class="w-8 h-full relative rounded-lg bg-zinc-200 mx-auto mb-4 dark:bg-zinc-800"
>
<div
style={{
height: post.exercise * 0.6 + "px",
}}
class="w-full rounded-md absolute bottom-0 left-0 right-0 bg-green-500"
/>
<p class="absolute rotate-90 bottom-1 z-10 text-sm -right-6 font-medium text-green-500">
{post.exercise}
</p>
</div>
<p class="text-xs text-center mt-2 font-mono">
Exercise
</p>
</div>
<div class="mx-auto">
<div
style={{
height: "100px",
}}
class="w-8 h-full relative rounded-lg bg-zinc-200 mx-auto mb-4 dark:bg-zinc-800"
>
<div
style={{
height: post.stand / 2 + "px",
}}
class="w-full rounded-md absolute bottom-0 left-0 right-0 bg-sky-500"
/>
<p class="absolute rotate-90 bottom-1 z-10 text-sm -right-6 font-medium text-sky-500">
{post.stand}
</p>
</div>
<p class="text-xs text-center mt-2 font-mono">Stand</p>
</div>
</div>
</div>
)}
<Markdown class="post" content={content[post.slug]} />
</div>
)
Expand Down
Binary file added public/generated/workout-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 27 additions & 23 deletions public/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,94 +3,98 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://preview.floriankiem.com/</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/work</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/work/boost</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/work/bridge</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/work/curations</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/about</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/feed</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/feed/essentials</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/feed/first-post</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/feed/workout-1</loc>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/archive</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/archive/projects</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/archive/projects/ambient-chat</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/archive/projects/homebility</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/archive/short-projects</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/archive/short-projects/granny-ai</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/archive/short-projects/heartbeat</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/archive/short-projects/nutri</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/archive/short-projects/stackoverflow-redesign</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/archive/short-projects/visualization</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/archive/short-projects/web-audit</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/colophon</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/imprint</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
<url>
<loc>https://preview.floriankiem.com/privacy-policy</loc>
<lastmod>2023-12-08T22:04:34.202Z</lastmod>
<lastmod>2023-12-09T00:55:53.582Z</lastmod>
</url>
</urlset>

1 comment on commit 1e37902

@vercel
Copy link

@vercel vercel bot commented on 1e37902 Dec 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.