From 837a0102ca987edce8791c42707fd4341e96ed35 Mon Sep 17 00:00:00 2001 From: Tanner Heffner Date: Wed, 27 Mar 2024 21:12:27 -0700 Subject: [PATCH 1/2] add duolingo stats, update homepage --- src/lib/components/Currently.svelte | 23 +++++++++++++++++++++++ src/lib/siteConfig.js | 26 +++++++++++++------------- src/routes/(main)/+page.server.js | 7 ++++++- src/routes/(main)/+page.svelte | 21 +++++++++++++-------- 4 files changed, 55 insertions(+), 22 deletions(-) diff --git a/src/lib/components/Currently.svelte b/src/lib/components/Currently.svelte index 59a711f..2330a1d 100644 --- a/src/lib/components/Currently.svelte +++ b/src/lib/components/Currently.svelte @@ -2,6 +2,17 @@ export let recentlyListened export let recentlyWatched export let recentlyPlayed + export let duolingo + + const formattedDate = new Date(duolingo.streakData.currentStreak.startDate).toLocaleDateString('en-us', { year:"numeric", month:"short", day:"numeric"}) + + function getFlagEmoji(countryCode) { + const codePoints = countryCode + .toUpperCase() + .split('') + .map(char => 127397 + char.charCodeAt()); + return String.fromCodePoint(...codePoints); + }