From a33bcb8bfc72fbbe6d6d6830117f1d69611963a5 Mon Sep 17 00:00:00 2001
From: Arthur DANJOU
Date: Mon, 22 Dec 2025 19:39:53 +0100
Subject: [PATCH] feat: refactor components to remove i18n and update static
text
---
app/components/home/Activity.vue | 137 +++++++------------------
app/components/home/CatchPhrase.vue | 19 +---
app/components/home/Quote.vue | 22 +----
app/components/home/Stats.vue | 89 +++++------------
app/pages/chat.vue | 148 ----------------------------
app/pages/index.vue | 8 +-
6 files changed, 63 insertions(+), 360 deletions(-)
delete mode 100644 app/pages/chat.vue
diff --git a/app/components/home/Activity.vue b/app/components/home/Activity.vue
index e925b34..f315e8c 100644
--- a/app/components/home/Activity.vue
+++ b/app/components/home/Activity.vue
@@ -1,9 +1,6 @@
@@ -15,21 +12,7 @@ const { t } = useI18n({
class="transform -rotate-12 duration-300 animate-wave"
name="i-ph-hand-pointing-duotone"
/>
- {{ t('quote') }}
+ Hover the bold texts to find out more about me.
-
-
-{
- "en": {
- "quote": "Hover the bold texts to find out more about me."
- },
- "fr": {
- "quote": "Survolez les textes en gras pour en savoir plus sur moi."
- },
- "es": {
- "quote": "Pase el cursor sobre los textos en negrita para obtener más información sobre mí."
- }
-}
-
diff --git a/app/components/home/Quote.vue b/app/components/home/Quote.vue
index a6a2e2b..7837b52 100644
--- a/app/components/home/Quote.vue
+++ b/app/components/home/Quote.vue
@@ -1,9 +1,3 @@
-
-
@@ -19,21 +13,7 @@ const { t } = useI18n({
- {{ t('quote') }}
+ Hello everyone! Thanks for visiting my portfolio. Please leave whatever you like to say, such as suggestions, appreciations, questions or anything!
-
-
-{
- "en": {
- "quote": "Hello everyone! Thanks for visiting my portfolio. Please leave whatever you like to say, such as suggestions, appreciations, questions or anything!"
- },
- "fr": {
- "quote": "Bonjour tout le monde ! Merci de visiter mon portfolio. N'hésitez pas à laisser ce que vous avez à dire, comme des suggestions, des appréciations, des questions ou autre chose !"
- },
- "es": {
- "quote": "Hola a todos ! Muchas gracias por visitar mi portfolio. No dudes en dejar cualquier comentario, como sugerencias, apreciaciones. preguntas, o cualquier cosa !"
- }
-}
-
diff --git a/app/components/home/Stats.vue b/app/components/home/Stats.vue
index 899d06a..95060d3 100644
--- a/app/components/home/Stats.vue
+++ b/app/components/home/Stats.vue
@@ -2,83 +2,40 @@
import type { Stats } from '~~/types'
import { usePrecision } from '@vueuse/math'
-const { locale, locales, t } = useI18n({
- useScope: 'local'
-})
-const currentLocale = computed(() => locales.value.find(l => l.code === locale.value))
-
const { data: stats } = await useAsyncData('stats', () => $fetch('/api/stats'))
-const time = useTimeAgo(new Date(stats.value!.coding.data.range.start)).value.split(' ')[0]
-const date = useDateFormat(new Date(stats.value!.coding.data.range.start), 'DD MMMM YYYY', { locales: currentLocale.value?.code ?? 'en' })
-const hours = usePrecision(stats.value!.coding.data.grand_total.total_seconds_including_other_language / 3600, 0)
+const time = useTimeAgo(new Date(stats.value?.coding.range.start ?? 0)).value.split(' ')[0]
+const date = useDateFormat(new Date(stats.value?.coding.range.start ?? 0), 'DD MMMM YYYY')
+const hours = usePrecision((stats.value?.coding.grand_total.total_seconds_including_other_language ?? 0) / 3600, 0)
+
+const editors = computed(() => stats.value?.editors.slice(0, 3).map(editor => `${editor.name} (${editor.percent}%)`).join(', '))
+const os = computed(() => stats.value?.os.slice(0, 2).map(os => `${os.name} (${os.percent}%)`).join(', '))
+const languages = computed(() => stats.value?.languages.slice(0, 3).map(language => `${language.name} (${language.percent}%)`).join(', '))
-
-
- {{ time }}
-
-
+
+ I collect some data for {{ time }} years, started the
-
-
+ />.
+ I've coded for a total of
-
-
- {{ stats.editors.data.slice(0, 2).map(editor => `${editor.name} (${editor.percent}%)`).join(t('separator')) }}
-
-
- {{ stats.os.data[0].name }} ({{ stats.os.data[0].percent }}%)
-
-
- {{
- stats.languages.data.slice(0, 2).map(language => `${language.name} (${language.percent}%)`).join(t('separator'))
- }}
-
-
+ hours.
+
+
+ My best editors are {{ editors || 'N/A' }}. My best OS is {{ os || 'N/A' }}. My top languages are
+ {{ languages || 'N/A' }}.
+
+
-
-
-{
- "en": {
- "stats": "I collect some data for {time} years, started the {date}. I've coded for a total of {hours} hours. My best editors are {editors}. My best OS is {os}. My top languages are {languages}.",
- "separator": " and ",
- "tooltip": {
- "date": "That was so long ago 🫣",
- "hours": "That's a lot 😮"
- }
- },
- "fr": {
- "stats": "Je collecte des données depuis {time} ans, commencé le {date}. J'ai codé un total de {hours} heures. Mes meilleurs éditeurs sont {editors}. Mon meilleur OS est {os}. Mes langages préférés sont {languages}.",
- "separator": " et ",
- "tooltip": {
- "date": "C'était il y a si longtemps 🫣",
- "hours": "C'est beaucoup 😮"
- }
- },
- "es": {
- "stats": "Recopilo datos desde hace {time} años, empecé el {date}. He programado durante un total de {hours} horas. Mis mejores editores son {editors}. Mi mejor OS es {os}. Y mis lenguajes favoritos son {languages}.",
- "separator": " y ",
- "tooltip": {
- "date": "hace tato tiempo…🫣",
- "hours": "es mucho 😮"
- }
- }
-}
-
diff --git a/app/pages/chat.vue b/app/pages/chat.vue
deleted file mode 100644
index 6c20128..0000000
--- a/app/pages/chat.vue
+++ /dev/null
@@ -1,148 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{
- "en": {
- "placeholder": "Type your message...",
- "thinking": "Thinking..."
- },
- "fr": {
- "placeholder": "Tapez votre message...",
- "thinking": "Réflexion..."
- },
- "es": {
- "placeholder": "Escribe tu mensaje...",
- "thinking": "Pensando..."
- }
-}
-
diff --git a/app/pages/index.vue b/app/pages/index.vue
index c22067c..c899412 100644
--- a/app/pages/index.vue
+++ b/app/pages/index.vue
@@ -1,15 +1,11 @@