Skip to content

Commit

Permalink
Merge pull request #38 from micbelgique/sprint5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaslrt05 authored Apr 19, 2024
2 parents 82ca643 + 8a88ca1 commit 25e9d49
Show file tree
Hide file tree
Showing 16 changed files with 79 additions and 75 deletions.
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("MIC-Maquette")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+fa4472f04a5b02aa777c13c40cada26461633974")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3b60902868e54d3733d35585b4cd2b5258c44599")]
[assembly: System.Reflection.AssemblyProductAttribute("MIC-Maquette")]
[assembly: System.Reflection.AssemblyTitleAttribute("MIC-Maquette")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
87029511cf4881d3f607628a605fa7ebc35d244f622a2da778c61a895cf52b86
1164b779cd76f384a5900fa39f5d2d7cec78365be139d286b6e6a63e33e5f677
Git LFS file not shown
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documents":{"C:\\Users\\Thoma\\Desktop\\Mesh-Innovate-Connect\\*":"https://raw.githubusercontent.com/micbelgique/Mesh-Innovate-Connect/fa4472f04a5b02aa777c13c40cada26461633974/*"}}
{"documents":{"C:\\Users\\Thoma\\Desktop\\Mesh-Innovate-Connect\\*":"https://raw.githubusercontent.com/micbelgique/Mesh-Innovate-Connect/3b60902868e54d3733d35585b4cd2b5258c44599/*"}}
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
2 changes: 1 addition & 1 deletion src/conference-ia/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>Mesh Innovate Create - Conference</title>
</head>
<body>
<div id="root"></div>
Expand Down
48 changes: 24 additions & 24 deletions src/conference-ia/src/Components/Carousel.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import React, { useState, useEffect } from 'react';

function Carousel({ imagesUrls }: { imagesUrls: string[] }) {
const [currentImageIndex, setCurrentImageIndex] = useState<number>(0);
const [currentImageIndex, setCurrentImageIndex] = useState<number>(0);

useEffect(() => {
const intervalId = setInterval(() => {
setCurrentImageIndex(prevIndex =>
prevIndex === imagesUrls.length - 1 ? 0 : prevIndex + 1
);
}, 30000);
useEffect(() => {
const intervalId = setInterval(() => {
setCurrentImageIndex(prevIndex =>
prevIndex === imagesUrls.length - 1 ? 0 : prevIndex + 1
);
}, 30000);

return () => clearInterval(intervalId);
}, [imagesUrls.length]);
return () => clearInterval(intervalId);
}, [imagesUrls.length]);

return (
<div>
<div className="images" >
{imagesUrls.map((imageUrl, index) => (
<img
key={index}
src={imageUrl}
alt={`Image ${index}`}
style={{ display: index === currentImageIndex ? 'block' : 'none'}}
/>
))}
</div>
</div>
);
return (
<div className="fixed inset-0 flex items-center justify-center overflow-hidden">
<div className="absolute inset-0 z-10">
{imagesUrls.map((imageUrl, index) => (
<img
key={index}
src={imageUrl}
alt={`Image ${index}`}
className={`absolute inset-0 w-full h-full object-cover ${index === currentImageIndex ? 'block' : 'hidden'}`}
/>
))}
</div>
</div>
);
}

export default Carousel;
export default Carousel;
37 changes: 23 additions & 14 deletions src/conference-ia/src/Components/CreateConference.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,17 @@ const CreateConference: React.FC = () => {
setMessage('Vous devez écrire un contexte.');
return;
}

if (/^\d+$/.test(title)) {
setMessage('Le titre ne doit pas contenir que des chiffres.');
return;
}

setIsLoading(true);
setMessage('Création en cours...');

try {
const response = await fetch('https://api-generateconference.azurewebsites.net//Conference/CreateConference', {
const response = await fetch('https://api-generateconference.azurewebsites.net/Conference/CreateConference', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ Prompt : title })
body: JSON.stringify({ Prompt: title })
});

if (response.ok) {
Expand All @@ -44,22 +39,36 @@ const CreateConference: React.FC = () => {
};

return (
<div>
<h1>Création d'une conférence</h1>
<form onSubmit={handleSubmit}>
<div className="flex flex-col items-center justify-center min-h-screen bg-gray-100 space-y-10">
<h1 className="text-4xl font-bold text-blue-600">
Création d'une conférence
</h1>
<div className="flex flex-col items-center space-y-4">
<input
type="text"
value={title}
onChange={(e) => setTitle(e.target.value)}
disabled={isLoading}
required
className="px-4 py-2 border border-gray-300 rounded-md"
/>
<button type="submit" disabled={isLoading}>
Créer la conférence
<button
type="submit"
disabled={isLoading}
className="px-6 py-3 bg-blue-500 text-white rounded-lg shadow-md hover:bg-blue-600 transition-colors duration-200"
>
Envoyer
</button>
</form>
</div>
<p>{message}</p>
<Link to="/">Retourner au menu principal</Link>
{!isLoading && (
<Link
to="/"
className="px-6 py-3 bg-green-500 text-white rounded-lg shadow-md hover:bg-green-600 transition-colors duration-200"
>
Retourner à l'accueil
</Link>
)}
</div>
);
};
Expand Down
7 changes: 4 additions & 3 deletions src/conference-ia/src/Components/DescriptionSpot.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useState, useEffect } from 'react';
import 'tailwindcss/tailwind.css';

interface DescriptionSpotProps {
description: string;
Expand All @@ -19,14 +20,14 @@ const DescriptionSpot: React.FC<DescriptionSpotProps> = ({ description }) => {
} else {
clearInterval(intervalId);
}
}, 2000);
}, 1000);

return () => clearInterval(intervalId); // Clean up on unmount
}, [description]);

return (
<div className='descriptionArea'>
<p>{displayedText}</p>
<div className='w-full absolute bottom-0 bg-black bg-opacity-60 text-white font-bold animate-pulse p-20'>
<p className='text-4xl'>{displayedText}</p>
</div>
);
};
Expand Down
38 changes: 16 additions & 22 deletions src/conference-ia/src/Components/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,24 @@ import { Link } from 'react-router-dom';

const Home: React.FC = () => {
return (
<div className="flex flex-col items-center justify-center min-h-screen bg-gray-100">
<h1 className="text-3xl font-bold underline text-titre mb-10">
<div className="flex flex-col items-center justify-center min-h-screen bg-gray-100 space-y-10">
<h1 className="text-4xl font-bold text-blue-600">
Page d'accueil
</h1>
<nav>
<ul className="space-y-10 ">
<li>
<Link
to="/CreateConference"
className="px-6 py-3 bg-blue-500 text-white rounded-lg shadow-md hover:bg-blue-600"
>
Création d'une conférence
</Link>
</li>
<li>
<Link
to="/Conference"
className="px-6 py-3 bg-green-500 text-white rounded-lg shadow-md hover:bg-green-600"
>
Accès à la conférence
</Link>
</li>
</ul>
</nav>
<div className="flex space-x-4">
<Link
to="/CreateConference"
className="px-6 py-3 bg-blue-500 text-white rounded-lg shadow-md hover:bg-blue-600 transition-colors duration-200"
>
Création d'une conférence
</Link>
<Link
to="/Conference"
className="px-6 py-3 bg-green-500 text-white rounded-lg shadow-md hover:bg-green-600 transition-colors duration-200"
>
Accès à la conférence
</Link>
</div>
</div>
);
};
Expand Down

0 comments on commit 25e9d49

Please sign in to comment.