Skip to content

Commit 6b212ba

Browse files
update
1 parent 07bbde0 commit 6b212ba

File tree

9 files changed

+83
-24
lines changed

9 files changed

+83
-24
lines changed

config/globals.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
export const ORGNAME = "Bit-Scripts";
22
export const GUILDID = "1039788044691181608";
33
export const DISCORDINVITECODE = "uAtm6aMnHR";
4+
export const BASE_IMG_PATH = "/images/";
5+
export const DEFAULT_IMG_COVER = "default_card_cover.jpg";

data/cardsData.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* @typedef {Object} Translation
3+
* @property {string} lang - Code ISO de la langue (par exemple, "en", "fr").
4+
* @property {string} description - Description du projet dans la langue spécifiée.
5+
*/
6+
7+
/**
8+
* @typedef {Object} CardsData
9+
* @property {string} project - "project" devient la clé unique de l'objet qui contient toutes les infos et traductions relatives à la carte et qui seront poussées à i18n lors de l'initialisation.
10+
* @property {string} imageCover - Nom du fichier image avec extension.
11+
* @property {string} title - Nom du projet affiché sur la carte.
12+
* @property {string} author - Auteur du projet affiché sur la carte.
13+
* @property {string} github - Nom exact du repo pour pouvoir afficher les infos du projet.
14+
* @property {string} demo - URL de démo du projet.
15+
* @property {Translation[]} translations - Description du projet dans toutes les langues souhaitées. Dans le cas où vous ne fournissez qu'une langue, ce doit être l'anglais.
16+
*/
17+
18+
/**
19+
* Liste de tous les projets pour générer les cartes et initialiser i18n.
20+
* @type {CardsData[]}
21+
*/
22+
23+
export const cardsData = [
24+
{
25+
project: "marv",
26+
imageCover: "marv.jpg",
27+
title: "Marv",
28+
author: "Paul",
29+
github: "Low-Fuel",
30+
demo: "https://marv-bot.fr",
31+
translations: [
32+
{
33+
lang: "en",
34+
description:
35+
"A Discord bot in NodeJS that uses ChatGPT and a speech synthesis and recognition system, allowing interaction with the bot through voice commands.",
36+
},
37+
{
38+
lang: "fr",
39+
translations:
40+
"Un bot Discord en NodeJS qui utilise chatGPT et un système de synthèse et de reconnaissance vocale permettant d’intéragir avec le bot grâce à la voix.",
41+
},
42+
],
43+
},
44+
];

data/projects.js

Lines changed: 0 additions & 7 deletions
This file was deleted.
60.6 KB
Loading

src/App.jsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
import { GUILDID } from "../config/globals";
2-
import { getDiscordGuildInfo } from "../utils/helpers";
1+
import { useEffect } from "react";
2+
import { ORGNAME } from "../config/globals";
3+
import { fetchReposData } from "../utils/helpers";
34
import CardsWrapper from "./components/CardsWrapper";
45
import Header from "./components/Header";
56
import Info from "./components/Info";
67
import LangageSwitcher from "./components/LangSwitcher";
78

8-
getDiscordGuildInfo(GUILDID);
9-
109
function App() {
11-
// useEffect(() => {
12-
// fetchReposData(ORGNAME);
13-
// }, []);
10+
useEffect(() => {
11+
fetchReposData(ORGNAME);
12+
}, []);
1413

1514
return (
1615
<div className="min-h-screen bg-neutral-800">

src/components/Card.jsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
import { useTranslation } from "react-i18next";
22
import { FaGithub } from "react-icons/fa";
33
import { MdOutlineRemoveRedEye } from "react-icons/md";
4+
import { BASE_IMG_PATH, DEFAULT_IMG_COVER } from "../../config/globals";
45

5-
function Card() {
6+
function Card({ imgName = DEFAULT_IMG_COVER, title = "No name" }) {
67
const { t } = useTranslation();
8+
79
const buttonStyle =
810
"bg-accentDarker flex min-w-[120px] cursor-pointer items-center justify-center rounded-full py-2 text-white transition-opacity hover:opacity-80";
911

1012
return (
11-
<div className="h-[520px] w-[320px] overflow-hidden rounded-2xl bg-neutral-900 shadow-lg">
13+
<div className="h-[520px] w-[330px] overflow-hidden rounded-2xl bg-neutral-900 shadow-lg">
1214
<div
13-
className={`h-[200px] border-b border-accent bg-[url('/images/marv.jpg')] bg-cover`}
15+
className={`h-[200px] border-b border-accent bg-cover`}
16+
style={{ backgroundImage: `url(${BASE_IMG_PATH}${imgName})` }}
1417
></div>
1518
<div className="flex h-[calc(100%-200px)] flex-col px-4 py-4">
1619
<div className="text-center text-2xl font-bold text-neutral-200">
17-
Marv
20+
{title}
1821
</div>
1922

2023
<div className="h-full max-h-[180px] overflow-hidden overflow-y-auto text-ellipsis py-4 text-sm text-neutral-200">
21-
{t("marv")}
24+
{t(`marv.description`)}
2225
</div>
2326

2427
<div className="py-4 text-center italic text-neutral-300">

src/components/CardsWrapper.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ function CardsWrapper() {
44
return (
55
<div className="flex items-center justify-center">
66
<div className="flex max-w-[1280px] flex-wrap justify-center gap-8 p-8">
7-
<Card /> <Card /> <Card imgUrl="/images/marv.jpg" /> <Card />
8-
<Card /> <Card /> <Card /> <Card />
7+
<Card imgName="matrix.jpg" />
8+
<Card imgName="marv.jpg" />
9+
<Card />
10+
<Card />
11+
<Card />
12+
<Card />
13+
<Card />
14+
<Card />
915
</div>
1016
</div>
1117
);

src/components/Header.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ const add = () => {
88
"es",
99
"translation",
1010
{
11+
marv: {
12+
title: "Marv",
13+
description:
14+
"Un bot de Discord en NodeJS que usa ChatGPT y un sistema de síntesis y reconocimiento de voz, lo que permite interactuar con el bot a través de comandos de voz.",
15+
},
1116
info: "Nuestros proyectos",
1217
baseline: "Desarrollo de software y scripts",
1318
discord: "Únete a nuestro Discord",
14-
marv: "Un bot de Discord en NodeJS que usa ChatGPT y un sistema de síntesis y reconocimiento de voz, lo que permite interactuar con el bot a través de comandos de voz.",
19+
1520
devby: "Desarrollado por",
1621
},
1722
false,

src/i18n.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,26 @@ i18n
99
resources: {
1010
en: {
1111
translation: {
12+
marv: {
13+
description:
14+
"A Discord bot in NodeJS that uses ChatGPT and a speech synthesis and recognition system, allowing interaction with the bot through voice commands.",
15+
},
1216
info: "Our projects",
1317
baseline: "Software & Script Development",
1418
discord: "Join our Discord",
15-
marv: "A Discord bot in NodeJS that uses ChatGPT and a speech synthesis and recognition system, allowing interaction with the bot through voice commands.",
1619
devby: "Developed by",
1720
},
1821
},
1922
fr: {
2023
translation: {
24+
marv: {
25+
description:
26+
"Un bot Discord en NodeJS qui utilise chatGPT et un système de synthèse et de reconnaissance vocale permettant d’intéragir avec le bot grâce à la voix.",
27+
},
28+
2129
info: "Nos projets",
2230
baseline: "Développement de softs & scripts",
2331
discord: "Rejoignez notre Discord",
24-
marv: "Un bot Discord en NodeJS qui utilise chatGPT et un système de synthèse et de reconnaissance vocale permettant d’intéragir avec le bot grâce à la voix.",
2532
devby: "Developpé par",
2633
},
2734
},

0 commit comments

Comments
 (0)