Compare commits
No commits in common. "50f8669f133530b5e7691e31c4a528d66215a30e" and "7be762f87ebb71d7eb3f4ee4ca9cc170f88304be" have entirely different histories.
50f8669f13
...
7be762f87e
31
README.md
31
README.md
@ -1,33 +1,2 @@
|
|||||||
# Dojo_Scoreboard
|
# Dojo_Scoreboard
|
||||||
|
|
||||||
Dojo_Scoreboard est un système simple pour afficher un tableau de score en haut de l'écran sur OBS, idéal pour les compétitions de jeux vidéo de combat.
|
|
||||||
|
|
||||||
## 📋 Prérequis
|
|
||||||
|
|
||||||
- **OBS Studio**
|
|
||||||
- **Python 3.x**
|
|
||||||
|
|
||||||
## 🚀 Installation et Utilisation
|
|
||||||
|
|
||||||
1. Clonez le dépôt :
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/votre-utilisateur/Dojo_Scoreboard.git
|
|
||||||
cd Dojo_Scoreboard
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Lancez le mini serveur web avec le script :
|
|
||||||
```bash
|
|
||||||
start.bat
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Modifiez les scores directement dans le fichier `score.txt`.
|
|
||||||
|
|
||||||
4. Ajoutez une source de navigateur dans OBS avec l'URL suivante :
|
|
||||||
```
|
|
||||||
http://localhost:8000
|
|
||||||
```
|
|
||||||
Ajustez la position pour l'afficher en haut de l'écran.
|
|
||||||
|
|
||||||
## 📄 Licence
|
|
||||||
|
|
||||||
Ce projet est sous licence GPLv2.
|
|
||||||
|
|||||||
130
score.html
130
score.html
@ -1,130 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="fr">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Scoreboard</title>
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
color: white;
|
|
||||||
background: transparent;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.scoreboard {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-around;
|
|
||||||
align-items: center;
|
|
||||||
padding: 10px;
|
|
||||||
background-color: rgba(35, 35, 35, 1);
|
|
||||||
|
|
||||||
border-top-left-radius: 0px;
|
|
||||||
border-top-right-radius: 0px;
|
|
||||||
border-bottom-left-radius: 30px;
|
|
||||||
border-bottom-right-radius: 30px;
|
|
||||||
|
|
||||||
width: 50%;
|
|
||||||
margin: auto;
|
|
||||||
|
|
||||||
box-shadow: 5px 5px 10px 2px rgba(0,0,0,0.7);
|
|
||||||
}
|
|
||||||
.player {
|
|
||||||
font-size: 1.5em;
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
.score {
|
|
||||||
font-size: 2em;
|
|
||||||
background-color: rgb(66, 66, 255);
|
|
||||||
|
|
||||||
padding-top: 5px;
|
|
||||||
padding-bottom: 5px;
|
|
||||||
padding-left: 20px;
|
|
||||||
padding-right: 20px;
|
|
||||||
|
|
||||||
border-radius: 20px;
|
|
||||||
|
|
||||||
/*width: 30px;
|
|
||||||
height: 30px;*/
|
|
||||||
|
|
||||||
transition: transform 0.5s ease, color 0.5s ease;
|
|
||||||
}
|
|
||||||
@keyframes pop {
|
|
||||||
0% { transform: scale(1); }
|
|
||||||
50% { transform: scale(1.2); }
|
|
||||||
100% { transform: scale(1); }
|
|
||||||
}
|
|
||||||
|
|
||||||
.separator {
|
|
||||||
background-color: rgb(66, 66, 255);
|
|
||||||
width: 5px;
|
|
||||||
height: 2em;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Animation pour faire "pop" le score */
|
|
||||||
.score.change {
|
|
||||||
transform: scale(1.8);
|
|
||||||
color: #FFD700; /* Change temporairement la couleur */
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="scoreboard">
|
|
||||||
<div class="score" id="score1">0</div>
|
|
||||||
<div class="player" id="player1">Joueur 1</div>
|
|
||||||
|
|
||||||
<div class="separator"></div>
|
|
||||||
|
|
||||||
<div class="player" id="player2">Joueur 2</div>
|
|
||||||
<div class="score" id="score2">0</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
let previousScore1 = null;
|
|
||||||
let previousScore2 = null;
|
|
||||||
|
|
||||||
setInterval(() => {
|
|
||||||
fetch('score.txt?rand=' + Math.random())
|
|
||||||
.then(response => response.text())
|
|
||||||
.then(data => {
|
|
||||||
const [player1, score1, score2, player2] = data.split(',');
|
|
||||||
updateScoreboard(player1, score1, score2, player2);
|
|
||||||
});
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
function updateScoreboard(player1, score1, score2, player2) {
|
|
||||||
// Met à jour les noms des joueurs
|
|
||||||
document.getElementById('player1').textContent = player1;
|
|
||||||
document.getElementById('player2').textContent = player2;
|
|
||||||
|
|
||||||
// Met à jour les scores et applique une animation si le score a changé
|
|
||||||
const score1Element = document.getElementById('score1');
|
|
||||||
const score2Element = document.getElementById('score2');
|
|
||||||
|
|
||||||
if (score1 !== previousScore1) {
|
|
||||||
animateScoreChange(score1Element, score1);
|
|
||||||
previousScore1 = score1;
|
|
||||||
}
|
|
||||||
if (score2 !== previousScore2) {
|
|
||||||
animateScoreChange(score2Element, score2);
|
|
||||||
previousScore2 = score2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function animateScoreChange(element, newScore) {
|
|
||||||
element.textContent = newScore;
|
|
||||||
element.classList.add('change');
|
|
||||||
|
|
||||||
// Enlever l'animation après un délai pour qu'elle puisse se reproduire
|
|
||||||
setTimeout(() => {
|
|
||||||
element.classList.remove('change');
|
|
||||||
}, 500); // Durée en millisecondes correspondant à l'animation CSS
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -1 +0,0 @@
|
|||||||
python -m http.server 8000
|
|
||||||
Loading…
x
Reference in New Issue
Block a user