logs is now finished

This commit is contained in:
Sindre Kjelsrud 2023-12-10 01:15:15 +01:00
parent 5e41633fa9
commit 0d07f273ac
4 changed files with 756 additions and 6 deletions

View file

@ -3,12 +3,10 @@ title: 'Logs'
description: ''
layout: "../../layouts/Layout.astro"
---
All my logs where I keep track of movies/TV-shows Ive watched and books Ive read.
All my logs where I keep track of movies / series Ive watched and books / manga Ive read.
I dont use any third-party services for my logs, I store everything in a JSON-format for this website.
[***📚 Book log***](/logs/books)
[📚 ***Books***](/logs/books)
[***📺 Movie log***](/logs/movies)
[***📺 Serie log***](/logs/series)
[📺 ***Watched***](/logs/watched)

View file

@ -0,0 +1,46 @@
---
import SectionContainer from '../../components/SectionContainer.astro';
import watched from '../../data/watched.json'
const tvByYear = watched.reduce((acc:any, tv) => {
const year = new Date(tv.date.string).getFullYear();
if (!acc[year]) {
acc[year] = [];
}
acc[year].push(tv);
return acc;
}, {});
const sortedYears = Object.keys(tvByYear).sort((a:any, b:any) => b - a);
function getEmojiStars(rating:any) {
let stars = '';
for (let i = 0; i < rating; i++) {
stars += '⭐';
}
return stars;
}
---
<SectionContainer>
<main class="flex flex-col gap-4 mt-4">
<h1 class="text-3xl font-extrabold">📺 La télévision</h1>
<h2 class="text-xl font-semibold">2023 - Currently Watching:</h2>
<p>👀 One Piece ~ Final Saga</p>
<p>👀 Star Wars: The Clone Wars S02</p>
{sortedYears.map(year => (
<section>
<div class="text-xl font-semibold mb-2">{year} - Finished</div>
<ul>
{
watched.map((tv) => (
<div class="flex justify-between mb-2 break-words gap-2 borderbottom">
<p class="text-s">{tv.title}</p>
<p>{getEmojiStars(tv.my_rating)}</p>
</div>
))
}
</ul>
</section>
))}
</main>
</SectionContainer>

View file

@ -6,7 +6,7 @@ layout: "../layouts/Layout.astro"
[📜 CV (under construction)](/)
[📚 Logs (under construction)](/logs)
[📚 Logs](/logs)
[🌱 Digital garden (under construction)](/)