Skip to content

Commit

Permalink
addweb
Browse files Browse the repository at this point in the history
  • Loading branch information
Eaielectronic committed Nov 24, 2024
1 parent 70b639f commit 2b7b64a
Show file tree
Hide file tree
Showing 18 changed files with 811 additions and 323 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file added Cours/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion Cours/websockets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,4 @@ <h3 id="test">Tester la connexion</h3>
</script>

</body>
</html>
</html>
2 changes: 1 addition & 1 deletion Galery/Appel-The-Adventure/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ <h2>Mises à jour</h2>
<a href="https://github.com/Eaielectronic">GitHub</a>
<a href="https://scratch.mit.edu/users/SERPENT1867/">Scratch</a>
<a href="https://turbowarp.org">TurboWarp</a>
<a href="https://eaielectronic.github.io/Electronix/">Desktop</a>
<a href="../../index.html">Desktop</a>
<a href="https://dedespo.com">Crédit</a>
</section>

Expand Down
152 changes: 78 additions & 74 deletions Galery/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,44 +21,68 @@
color: #333;
background: url('back.png') no-repeat center center fixed;
background-size: cover;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
margin: 0;
}

/* Container principal */
.container {
max-width: 800px;
background-color: #fff;
padding: 25px;
margin: 20px;
border-radius: 12px;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* En-tête */
.header {
/* Navbar */
.navbar {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-color: #333;
color: white;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 30px;
padding: 10px 20px;
z-index: 1000;
transition: top 0.3s ease; /* Transition fluide pour l'apparition/disparition */
}

.header img {
width: 60px;
height: 60px;
border-radius: 10px;
.navbar img {
width: 180px;
height: auto;
transition: transform 0.3s ease;
}

.header h1 {
font-size: 1.8em;
color: #222;
margin-left: 20px;
.navbar img:hover {
transform: scale(1.2);
}

.navbar ul {
list-style-type: none;
display: flex;
gap: 15px;
flex: 1;
justify-content: space-evenly;
}

.navbar a {
color: rgb(14, 174, 36);
text-decoration: none;
font-weight: bold;
font-size: 20px;
transition: transform 0.3s ease;
}

/* Section de chaque jeu */
.navbar a:hover {
color: rgb(98, 255, 0);
transform: scale(1.2);
}

/* Container principal */
.container {
max-width: 800px;
background-color: #fff;
padding: 25px;
margin: 100px auto; /* Centre le rectangle blanc */
border-radius: 12px;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Section de jeu */
.game-section {
display: flex;
align-items: center;
Expand Down Expand Up @@ -98,7 +122,7 @@
line-height: 1.6;
}

/* Boutons de téléchargement */
/* Boutons */
.download-btn, .download-btnnon {
padding: 12px 20px;
color: #fff;
Expand Down Expand Up @@ -145,74 +169,54 @@
</style>
</head>
<body>
<!-- Navbar -->
<div class="navbar" id="navbar">
<a href="../index.html"><img src="../Titre.png" alt="Logo"></a>
<ul>
<li><a href="#about">About</a></li>
<li><a href="#links">Membre</a></li>
<li><a href="Galery/index.html">Play</a></li>
<li><a href="">Test</a></li>
</ul>
</div>

<!-- Container principal -->
<div class="container">
<!-- En-tête -->
<div class="header">
<img src="logo_site.png" alt="Logo du site">
<img src="logo_site.png" alt="Logo du site" style="height: 30px;">
<h1>Jeux Vidéo Collection</h1>
</div>

<!-- Section du jeu 1 -->
<div class="game-section">
<img src="logo.svg" alt="Icône du jeu" class="icon">
<div class="game-details">
<h2>Appel The Adventure - v-beta</h2>
<p>Un jeu de plateforme sympathique avec de très belles textures</p>
<a href="Appel-The-Adventure" class="download-btn" id="sendButton">Voir</a>
<p>Nombre de téléchargements : <span id="downloadCount">0</span></p>
<p>Un jeu de plateforme sympathique avec de très belles textures.</p>
<a href="Appel-The-Adventure/index.html" class="download-btn">Voir</a>
</div>
<img src="image1.png" alt="Image du jeu" class="game-image">
</div>

<!-- Publicité -->
<div class="ad-section">
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-2631008307109231"
data-ad-slot="4554212931"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>
</div>

<!-- Section du jeu 2 -->
<div class="game-section">
<img src="logo1.svg" alt="Icône du jeu" class="icon">
<div class="game-details">
<h2>Level EATEN! - v0.12</h2>
<p>Indisponible</p>
<a class="download-btnnon">Indisponible</a>
<p>Nombre de téléchargements : <span id="downloadCount1">0</span></p>
</div>
<img src="image2.png" alt="Image du jeu" class="game-image">
</div>

<!-- Liens additionnels -->
<div class="links">
<a href="https://github.com/Eaielectronic">GitHub</a>
<a href="https://scratch.mit.edu/users/SERPENT1867/">Scratch</a>
<a href="https://turbowarp.org">TurboWarp</a>
<a href="https://eaielectronic.github.io/Electronix/">Desktop</a>
<a href="https://dedespo.com">Crédit</a>
<a href="../index.html">Crédit</a>
</div>
</div>

<!-- Script WebSocket pour le comptage des téléchargements -->
<script>
const socket = new WebSocket('ws://localhost:8010');
socket.onmessage = function(event) {
try {
const data = JSON.parse(event.data);
document.getElementById('downloadCount').textContent = data.key1 || 0;
document.getElementById('downloadCount1').textContent = data.key2 || 0;
} catch (error) {
console.error("Erreur lors du parsing JSON : ", error);
let lastScrollTop = 0;
const navbar = document.getElementById("navbar");

window.addEventListener("scroll", () => {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop;
if (scrollTop > lastScrollTop) {
navbar.style.top = "-80px"; // Cache la navbar
} else {
navbar.style.top = "0"; // Affiche la navbar
}
};

socket.onopen = function() {
socket.send('get_count');
};
lastScrollTop = scrollTop <= 0 ? 0 : scrollTop; // Pour éviter les valeurs négatives
});
</script>
</body>
</html>
</html>
Binary file added code.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
119 changes: 119 additions & 0 deletions commu/chat/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chat</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background: #f4f4f4;
}
header {
background: #333;
color: #fff;
padding: 1rem;
text-align: center;
}
.chat-container {
display: flex;
flex-direction: column;
height: 90vh;
max-width: 600px;
margin: 0 auto;
background: #fff;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.messages {
flex: 1;
padding: 1rem;
overflow-y: auto;
border-bottom: 1px solid #ccc;
}
.messages div {
margin-bottom: 0.5rem;
}
.messages .user {
font-weight: bold;
color: #333;
}
.input-container {
display: flex;
padding: 1rem;
border-top: 1px solid #ccc;
}
.input-container input {
flex: 1;
padding: 0.8rem;
border: 1px solid #ccc;
border-radius: 5px;
margin-right: 0.5rem;
}
.input-container button {
padding: 0.8rem;
background: #333;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
}
.input-container button:hover {
background: #555;
}
</style>
</head>
<body>
<header>
<h1>Chat de Programmation</h1>
</header>
<div class="chat-container">
<div class="messages" id="messages"></div>
<div class="input-container">
<input type="text" id="message-input" placeholder="Tapez votre message">
<button id="send-button">Envoyer</button>
</div>
</div>

<script>
async function fetchMessages() {
const response = await fetch("http://localhost:5000/api/messages");
const messages = await response.json();
const messagesContainer = document.getElementById("messages");
messagesContainer.innerHTML = ""; // Effacer les anciens messages
messages.forEach(msg => {
const messageDiv = document.createElement("div");
messageDiv.innerHTML = `<span class="user">${msg.user}:</span> ${msg.text}`;
messagesContainer.appendChild(messageDiv);
});
}

async function sendMessage() {
const messageInput = document.getElementById("message-input");
const message = messageInput.value;
if (!message) return;

await fetch("http://localhost:5000/api/messages", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ user: "Utilisateur", text: message })
});

messageInput.value = "";
fetchMessages(); // Recharger les messages
}

document.getElementById("send-button").addEventListener("click", sendMessage);
document.getElementById("message-input").addEventListener("keypress", (e) => {
if (e.key === "Enter") sendMessage();
});

// Charger les messages au démarrage
fetchMessages();
setInterval(fetchMessages, 5000); // Recharger les messages toutes les 5 secondes
</script>
</body>
</html>
Loading

0 comments on commit 2b7b64a

Please sign in to comment.