add hovering
This commit is contained in:
parent
eaae09676b
commit
6f7708d368
1 changed files with 16 additions and 0 deletions
|
|
@ -114,6 +114,12 @@
|
|||
gap: 5px;
|
||||
padding: 20px 0 0 20px;
|
||||
}
|
||||
|
||||
#hand-0 div:hover {
|
||||
transform: translateY(-15px);
|
||||
transition: transform 0.2s;
|
||||
z-index: 2;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -197,6 +203,16 @@
|
|||
// Fonction d'affichage d'une main
|
||||
function displayHand(hand, displayId) {
|
||||
const display = document.getElementById(displayId);
|
||||
// Pour hand-0, on compare l'état actuel
|
||||
if (displayId === 'hand-0') {
|
||||
// Génère une signature simple de la main
|
||||
const handSignature = hand.map(tile => tile.id).join(',') + (window.lastDrawTile || '');
|
||||
if (display.dataset.signature === handSignature) {
|
||||
// Rien n'a changé, on ne réécrit pas
|
||||
return;
|
||||
}
|
||||
display.dataset.signature = handSignature;
|
||||
}
|
||||
display.innerHTML = '';
|
||||
hand.forEach(tile => {
|
||||
const tileDiv = document.createElement('div');
|
||||
|
|
|
|||
Loading…
Reference in a new issue