300 lines
No EOL
8.4 KiB
HTML
300 lines
No EOL
8.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Tuto Riichi</title>
|
|
<link rel="stylesheet" href="/frontend/css/style.css">
|
|
<link rel="stylesheet" href="/frontend/css/speech-bubble.css">
|
|
<style>
|
|
#menu {
|
|
position: relative;
|
|
z-index: 10;
|
|
}
|
|
|
|
#mascotte {
|
|
position: absolute;
|
|
top: 670px;
|
|
right: 100px;
|
|
z-index: 999;
|
|
transform: scaleX(-1);
|
|
cursor: pointer;
|
|
}
|
|
|
|
#mascotte img {
|
|
width: 250px;
|
|
height: auto;
|
|
display: block;
|
|
}
|
|
|
|
.speech-bubble {
|
|
position: absolute;
|
|
top: 300px;
|
|
right: 170px;
|
|
z-index: 1;
|
|
display: none;
|
|
}
|
|
|
|
.speech-bubble.visible {
|
|
display: flex;
|
|
}
|
|
|
|
#tiles-display {
|
|
padding: 20px;
|
|
max-width: 900px;
|
|
margin: 20px auto;
|
|
display: grid;
|
|
grid-template-columns: 100px 1fr;
|
|
gap: 30px;
|
|
align-items: start;
|
|
}
|
|
|
|
.tiles-family {
|
|
margin-bottom: 0;
|
|
grid-column: 1 / -1;
|
|
display: grid;
|
|
grid-template-columns: 100px 1fr;
|
|
gap: 30px;
|
|
align-items: start;
|
|
}
|
|
|
|
.tiles-family h3 {
|
|
color: #ffffff;
|
|
margin: 0;
|
|
font-size: 1.2rem;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.tiles-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(9, minmax(0, 1fr));
|
|
gap: 3px;
|
|
}
|
|
|
|
.tile-item {
|
|
padding: 0;
|
|
text-align: center;
|
|
border-radius: 4px;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
|
|
.tiles-numbers {
|
|
grid-column: 2;
|
|
display: grid;
|
|
grid-template-columns: repeat(9, minmax(0, 1fr));
|
|
gap: 3px;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.tiles-numbers div {
|
|
text-align: center;
|
|
font-weight: bold;
|
|
color: #ffffff;
|
|
padding: 5px 0;
|
|
min-height: 50px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.wind-names {
|
|
grid-column: 2;
|
|
display: grid;
|
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
gap: 3px;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.wind-names div {
|
|
text-align: center;
|
|
font-weight: bold;
|
|
color: #ffffff;
|
|
padding: 5px 0;
|
|
min-height: 50px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.dragon-names {
|
|
grid-column: 2;
|
|
display: grid;
|
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
gap: 3px;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.dragon-names div {
|
|
text-align: center;
|
|
font-weight: bold;
|
|
color: #ffffff;
|
|
padding: 5px 0;
|
|
min-height: 50px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="menu"></div>
|
|
<div id="tile-container"></div>
|
|
<div id="tiles-display">
|
|
<div class="tiles-numbers">
|
|
<div>1</div>
|
|
<div>2</div>
|
|
<div>3</div>
|
|
<div>4</div>
|
|
<div>5</div>
|
|
<div>6</div>
|
|
<div>7</div>
|
|
<div>8</div>
|
|
<div>9</div>
|
|
</div>
|
|
</div>
|
|
<div class="speech-bubble">
|
|
<div class="speech-text" id="speech-text"></div>
|
|
</div>
|
|
<div id="mascotte"></div>
|
|
|
|
<script src="/frontend/js/fr/texts.js"></script>
|
|
<script>
|
|
// Charger le menu
|
|
fetch('/components/menu.html')
|
|
.then(r => r.text())
|
|
.then(html => document.getElementById('menu').innerHTML = html);
|
|
|
|
// Afficher la mascotte
|
|
const mascolteEl = document.getElementById('mascotte');
|
|
mascolteEl.innerHTML = '<img src="/img/tilineau/idle.png" alt="Tilineau">';
|
|
|
|
// Afficher le texte de bienvenue
|
|
document.getElementById('speech-text').innerHTML = texts.riichi.chap1;
|
|
|
|
// Toggle bulle de dialogue au clic sur la mascotte
|
|
const speechBubble = document.querySelector('.speech-bubble');
|
|
mascolteEl.addEventListener('click', () => {
|
|
speechBubble.classList.toggle('visible');
|
|
if (speechBubble.classList.contains('visible')) {
|
|
mascolteEl.innerHTML = '<img class="explaining" src="/img/tilineau/explaining.png" alt="Tilineau">';
|
|
} else {
|
|
mascolteEl.innerHTML = '<img src="/img/tilineau/idle.png" alt="Tilineau">';
|
|
}
|
|
});
|
|
|
|
let allTiles = [];
|
|
|
|
// Récupérer les tuiles
|
|
fetch('/api/tiles')
|
|
.then(r => r.json())
|
|
.then(data => {
|
|
allTiles = data.tiles;
|
|
|
|
const tilesDisplay = document.getElementById('tiles-display');
|
|
|
|
// Man
|
|
let section = document.createElement('div');
|
|
section.className = 'tiles-family';
|
|
const manTitle = document.createElement('h3');
|
|
manTitle.textContent = 'Caractères';
|
|
const manGrid = document.createElement('div');
|
|
manGrid.className = 'tiles-grid';
|
|
section.appendChild(manTitle);
|
|
section.appendChild(manGrid);
|
|
for (let i = 0; i < 9; i++) {
|
|
const tileDiv = document.createElement('div');
|
|
tileDiv.className = 'tile-item';
|
|
tileDiv.innerHTML = allTiles[i].svg;
|
|
manGrid.appendChild(tileDiv);
|
|
}
|
|
tilesDisplay.appendChild(section);
|
|
|
|
// Pin
|
|
section = document.createElement('div');
|
|
section.className = 'tiles-family';
|
|
const pinTitle = document.createElement('h3');
|
|
pinTitle.textContent = 'Ronds';
|
|
const pinGrid = document.createElement('div');
|
|
pinGrid.className = 'tiles-grid';
|
|
section.appendChild(pinTitle);
|
|
section.appendChild(pinGrid);
|
|
for (let i = 9; i < 18; i++) {
|
|
const tileDiv = document.createElement('div');
|
|
tileDiv.className = 'tile-item';
|
|
tileDiv.innerHTML = allTiles[i].svg;
|
|
pinGrid.appendChild(tileDiv);
|
|
}
|
|
tilesDisplay.appendChild(section);
|
|
|
|
// Sou
|
|
section = document.createElement('div');
|
|
section.className = 'tiles-family';
|
|
const souTitle = document.createElement('h3');
|
|
souTitle.textContent = 'Bambous';
|
|
const souGrid = document.createElement('div');
|
|
souGrid.className = 'tiles-grid';
|
|
section.appendChild(souTitle);
|
|
section.appendChild(souGrid);
|
|
for (let i = 18; i < 27; i++) {
|
|
const tileDiv = document.createElement('div');
|
|
tileDiv.className = 'tile-item';
|
|
tileDiv.innerHTML = allTiles[i].svg;
|
|
souGrid.appendChild(tileDiv);
|
|
}
|
|
tilesDisplay.appendChild(section);
|
|
|
|
// Ligne des noms de vents
|
|
const windNamesDiv = document.createElement('div');
|
|
windNamesDiv.className = 'wind-names';
|
|
windNamesDiv.innerHTML = '<div>Est</div><div>Sud</div><div>Ouest</div><div>Nord</div>';
|
|
tilesDisplay.appendChild(windNamesDiv);
|
|
|
|
// Vents
|
|
section = document.createElement('div');
|
|
section.className = 'tiles-family';
|
|
const windTitle = document.createElement('h3');
|
|
windTitle.textContent = 'Vents';
|
|
const windGrid = document.createElement('div');
|
|
windGrid.className = 'tiles-grid';
|
|
windGrid.style.gridTemplateColumns = 'repeat(4, minmax(0, 1fr))';
|
|
section.appendChild(windTitle);
|
|
section.appendChild(windGrid);
|
|
const windNames = ['Est', 'Sud', 'Ouest', 'Nord'];
|
|
for (let i = 27; i < 31; i++) {
|
|
const tileDiv = document.createElement('div');
|
|
tileDiv.className = 'tile-item';
|
|
tileDiv.innerHTML = allTiles[i].svg;
|
|
windGrid.appendChild(tileDiv);
|
|
}
|
|
tilesDisplay.appendChild(section);
|
|
|
|
// Ligne des noms de dragons
|
|
const dragonNamesDiv = document.createElement('div');
|
|
dragonNamesDiv.className = 'dragon-names';
|
|
dragonNamesDiv.innerHTML = '<div>Blanc</div><div>Vert</div><div>Rouge</div>';
|
|
tilesDisplay.appendChild(dragonNamesDiv);
|
|
|
|
// Dragons
|
|
section = document.createElement('div');
|
|
section.className = 'tiles-family';
|
|
const dragonTitle = document.createElement('h3');
|
|
dragonTitle.textContent = 'Dragons';
|
|
const dragonGrid = document.createElement('div');
|
|
dragonGrid.className = 'tiles-grid';
|
|
dragonGrid.style.gridTemplateColumns = 'repeat(3, minmax(0, 1fr))';
|
|
section.appendChild(dragonTitle);
|
|
section.appendChild(dragonGrid);
|
|
for (let i = 31; i < 34; i++) {
|
|
const tileDiv = document.createElement('div');
|
|
tileDiv.className = 'tile-item';
|
|
tileDiv.innerHTML = allTiles[i].svg;
|
|
dragonGrid.appendChild(tileDiv);
|
|
}
|
|
tilesDisplay.appendChild(section);
|
|
});
|
|
|
|
|
|
</script>
|
|
</body>
|
|
</html> |