From 0af81676ea1c02aea1475345127f4b0494ef50ba Mon Sep 17 00:00:00 2001 From: Jannik Gohr Date: Sat, 19 Oct 2024 19:56:50 +0200 Subject: [PATCH 1/6] Duolingo-Stats now fill parent svg perfectly --- components/SvgWidget.tsx | 85 ++++++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 38 deletions(-) diff --git a/components/SvgWidget.tsx b/components/SvgWidget.tsx index 7d959a6..0c80dbe 100644 --- a/components/SvgWidget.tsx +++ b/components/SvgWidget.tsx @@ -134,56 +134,65 @@ export default function SvgWidget({ response, theme, sort }): JSX.Element { const iconStyle = duoIcons[randomIndex].style; // Display top 3 languages with most crowns response.courses = response.courses.slice(0, Math.min(3, response.courses.length)); - const cardStyle = theme ? { "background": `${themes[theme].background}!important`, color: `${themes[theme].colorPrimary}` } : null; + const fillParent = { + "height": "100%", + "width": "100%", + "box-sizing": "border-box" + } + const cardStyle = theme ? { + "background": `${themes[theme].background}!important`, + color: `${themes[theme].colorPrimary}`, + ...fillParent + } : fillParent; + const courseStyle = theme ? { color: `${themes[theme].colorSecondary}` } : null; return ( -
-
-
-
+
+
+
- + {response.streak} Day streak - - - {response.totalXp} XP + + + {response.totalXp} XP -
-
- {response.courses.map((course: Course) => { - const FlagComponent = flagComponents[course.learningLanguage] || flagComponents.world; - return ( -
- {sort ? ( - <> -
- -
- {numberFormatter(course.xp)} - - ) : ( - <> -
- -
- {numberFormatter(course.crowns)} - - )} +
+
+ {response.courses.map((course: Course) => { + const FlagComponent = flagComponents[course.learningLanguage] || flagComponents.world; + return ( +
+ {sort ? ( + <> +
+ +
+ {numberFormatter(course.xp)} + + ) : ( + <> +
+ +
+ {numberFormatter(course.crowns)} + + )} - -
- ); - })} -
+ +
+ ); + })}
- {iconStyle === 'flip' ? - : - }
+ {iconStyle === 'flip' ? + : + }
From 6983ca2dc8cca2a0a13a6252a127a5660753e657 Mon Sep 17 00:00:00 2001 From: Jannik Gohr Date: Sun, 20 Oct 2024 02:10:55 +0200 Subject: [PATCH 2/6] Fix Duolingo_waving.svg --- components/SvgWidget.tsx | 2 +- public/svg/Duo_waving.svg | 32 +------------------------------- 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/components/SvgWidget.tsx b/components/SvgWidget.tsx index d348aa7..fccb23d 100644 --- a/components/SvgWidget.tsx +++ b/components/SvgWidget.tsx @@ -117,7 +117,7 @@ export default function SvgWidget({ response, theme, sort }): JSX.Element { }; const duoIcons = [ - { icon: Duo_Waving, viewBox: "-30 0 330 330" }, + { icon: Duo_Waving, viewBox: "-10 -10 189 200" }, { icon: Duo_PencilBoarding, viewBox: "40 50 225 200" }, { icon: Duo_Jolly, viewBox: "0 0 185 180", style: 'flip' }, { icon: Duo_Excited, viewBox: "0 -15 160 240", style: 'flip' }, diff --git a/public/svg/Duo_waving.svg b/public/svg/Duo_waving.svg index bbac715..bc52380 100644 --- a/public/svg/Duo_waving.svg +++ b/public/svg/Duo_waving.svg @@ -1,31 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file From f28adf4d608d0472adb414aa0c6709e708473a3c Mon Sep 17 00:00:00 2001 From: Jannik Gohr Date: Sun, 20 Oct 2024 15:54:54 +0200 Subject: [PATCH 3/6] Remove ledge in Duolingo_waving.svg --- components/SvgWidget.tsx | 2 +- public/svg/Duo_waving.svg | 152 +++++++++++++++++++++++++++++++++++++- 2 files changed, 152 insertions(+), 2 deletions(-) diff --git a/components/SvgWidget.tsx b/components/SvgWidget.tsx index fccb23d..189be49 100644 --- a/components/SvgWidget.tsx +++ b/components/SvgWidget.tsx @@ -117,7 +117,7 @@ export default function SvgWidget({ response, theme, sort }): JSX.Element { }; const duoIcons = [ - { icon: Duo_Waving, viewBox: "-10 -10 189 200" }, + { icon: Duo_Waving, viewBox: "-10 -20 189 200" }, { icon: Duo_PencilBoarding, viewBox: "40 50 225 200" }, { icon: Duo_Jolly, viewBox: "0 0 185 180", style: 'flip' }, { icon: Duo_Excited, viewBox: "0 -15 160 240", style: 'flip' }, diff --git a/public/svg/Duo_waving.svg b/public/svg/Duo_waving.svg index bc52380..362a5c1 100644 --- a/public/svg/Duo_waving.svg +++ b/public/svg/Duo_waving.svg @@ -1 +1,151 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 1c52d319205aefeae2675fe4025a0df5aa21fd91 Mon Sep 17 00:00:00 2001 From: Jannik Gohr Date: Sun, 20 Oct 2024 21:56:06 +0200 Subject: [PATCH 4/6] Remove ledges from all Duo icons --- public/svg/Duo_Amour.svg | 217 +++++++++++++++++++++++++++++- public/svg/Duo_Daunting.svg | 176 ++++++++++++++++++++++++- public/svg/Duo_Excited.svg | 254 +++++++++++++++++++++++++++++++++++- public/svg/Duo_Jolly.svg | 194 ++++++++++++++++++++++++++- public/svg/Duo_waving.svg | 7 +- 5 files changed, 841 insertions(+), 7 deletions(-) diff --git a/public/svg/Duo_Amour.svg b/public/svg/Duo_Amour.svg index d66e45a..eb9d6da 100644 --- a/public/svg/Duo_Amour.svg +++ b/public/svg/Duo_Amour.svg @@ -1 +1,216 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/Duo_Daunting.svg b/public/svg/Duo_Daunting.svg index 738498b..4fb2f5c 100644 --- a/public/svg/Duo_Daunting.svg +++ b/public/svg/Duo_Daunting.svg @@ -1 +1,175 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/Duo_Excited.svg b/public/svg/Duo_Excited.svg index d4c393b..882c898 100644 --- a/public/svg/Duo_Excited.svg +++ b/public/svg/Duo_Excited.svg @@ -1 +1,253 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/Duo_Jolly.svg b/public/svg/Duo_Jolly.svg index a716357..b1f8fce 100644 --- a/public/svg/Duo_Jolly.svg +++ b/public/svg/Duo_Jolly.svg @@ -1 +1,193 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/Duo_waving.svg b/public/svg/Duo_waving.svg index 362a5c1..b76313c 100644 --- a/public/svg/Duo_waving.svg +++ b/public/svg/Duo_waving.svg @@ -1,11 +1,12 @@ + width="100%" + height="100%" + xmlns="http://www.w3.org/2000/svg"> From 24b862f3592d1a99b616b281a468ca8a735ac678 Mon Sep 17 00:00:00 2001 From: Jannik Gohr Date: Sun, 20 Oct 2024 22:34:56 +0200 Subject: [PATCH 5/6] - Remove ledges from all Duo icons - Use viewport from SVG in SvgWidget.tsx - Change height to have them all on floor - Cannonball Duo is exception and slightly higher --- components/SvgWidget.tsx | 14 +- public/svg/Duo_Amour.svg | 217 ++++++++++++++++++++++++- public/svg/Duo_Daunting.svg | 176 ++++++++++++++++++++- public/svg/Duo_Excited.svg | 254 +++++++++++++++++++++++++++++- public/svg/Duo_Jolly.svg | 194 ++++++++++++++++++++++- public/svg/Duo_PencilBoarding.svg | 233 ++++++++++++++++++++++++--- public/svg/Duo_waving.svg | 181 +++++++++++++++++---- 7 files changed, 1203 insertions(+), 66 deletions(-) diff --git a/components/SvgWidget.tsx b/components/SvgWidget.tsx index a1d387e..52a066d 100644 --- a/components/SvgWidget.tsx +++ b/components/SvgWidget.tsx @@ -115,13 +115,13 @@ export default function SvgWidget({ response, theme, sort }): JSX.Element { }; const duoIcons = [ - { icon: Duo_Waving, viewBox: "-30 0 330 330" }, - { icon: Duo_PencilBoarding, viewBox: "40 50 225 200" }, - { icon: Duo_Jolly, viewBox: "0 0 185 180", style: 'flip' }, - { icon: Duo_Excited, viewBox: "0 -15 160 240", style: 'flip' }, - { icon: Duo_Daunting, viewBox: "0 0 190 150" }, - { icon: Duo_Cannonball, viewBox: "0 0 160 150" }, - { icon: Duo_Amour, viewBox: "0 0 185 30", style: 'flip' }, + { icon: Duo_Waving, viewBox: "0 -3 148 174" }, + { icon: Duo_PencilBoarding, viewBox: "0 -48 225 183" }, + { icon: Duo_Jolly, viewBox: "0 -27 189 200", style: 'flip' }, + { icon: Duo_Excited, viewBox: "0 -10 162 220", style: 'flip' }, + { icon: Duo_Daunting, viewBox: "0 -58 191 204" }, + { icon: Duo_Cannonball, viewBox: "0 0 158 171" }, + { icon: Duo_Amour, viewBox: "0 -69 194 123", style: 'flip' }, ]; // Randomly generate a Duo icon const randomIndex = Math.floor(Math.random() * 7); diff --git a/public/svg/Duo_Amour.svg b/public/svg/Duo_Amour.svg index d66e45a..eb9d6da 100644 --- a/public/svg/Duo_Amour.svg +++ b/public/svg/Duo_Amour.svg @@ -1 +1,216 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/Duo_Daunting.svg b/public/svg/Duo_Daunting.svg index 738498b..4fb2f5c 100644 --- a/public/svg/Duo_Daunting.svg +++ b/public/svg/Duo_Daunting.svg @@ -1 +1,175 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/Duo_Excited.svg b/public/svg/Duo_Excited.svg index d4c393b..882c898 100644 --- a/public/svg/Duo_Excited.svg +++ b/public/svg/Duo_Excited.svg @@ -1 +1,253 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/Duo_Jolly.svg b/public/svg/Duo_Jolly.svg index a716357..b1f8fce 100644 --- a/public/svg/Duo_Jolly.svg +++ b/public/svg/Duo_Jolly.svg @@ -1 +1,193 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/Duo_PencilBoarding.svg b/public/svg/Duo_PencilBoarding.svg index 2691913..4641a11 100644 --- a/public/svg/Duo_PencilBoarding.svg +++ b/public/svg/Duo_PencilBoarding.svg @@ -1,26 +1,209 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/Duo_waving.svg b/public/svg/Duo_waving.svg index bbac715..b76313c 100644 --- a/public/svg/Duo_waving.svg +++ b/public/svg/Duo_waving.svg @@ -1,31 +1,152 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 98d078d2f3dd7d78435e29a13d352f3fd32a40bc Mon Sep 17 00:00:00 2001 From: Jannik Gohr Date: Sun, 20 Oct 2024 23:03:37 +0200 Subject: [PATCH 6/6] Fix flag positions after merge --- components/SvgWidget.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/SvgWidget.tsx b/components/SvgWidget.tsx index f210658..356702b 100644 --- a/components/SvgWidget.tsx +++ b/components/SvgWidget.tsx @@ -178,7 +178,7 @@ export default function SvgWidget({ response, theme, sort }): JSX.Element { {numberFormatter(course.crowns)} )} - +
); })}