@alepot55/chessboardjs 2.3.4 → 2.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/rollup.config.js +2 -1
- package/dist/chessboard.cjs.js +446 -471
- package/dist/chessboard.css +28 -6
- package/dist/chessboard.esm.js +446 -471
- package/dist/chessboard.iife.js +447 -471
- package/dist/chessboard.umd.js +446 -471
- package/package.json +6 -8
- package/src/components/Piece.js +11 -11
- package/src/components/Square.js +1 -1
- package/src/core/Chessboard.js +183 -266
- package/src/core/ChessboardConfig.js +0 -16
- package/src/core/ChessboardFactory.js +0 -5
- package/src/errors/messages.js +0 -1
- package/src/services/BoardService.js +20 -1
- package/src/services/EventService.js +131 -45
- package/src/services/MoveService.js +81 -94
- package/src/services/PieceService.js +18 -11
- package/src/services/ValidationService.js +1 -14
- package/src/styles/index.css +8 -0
- package/src/utils/validation.js +1 -5
- package/tests/unit/chessboard-config-animations.test.js +0 -9
- package/tests/unit/chessboard-robust.test.js +0 -44
- package/tools/build-html-examples.cjs +80 -0
- package/tools/build-html-examples.js +78 -0
- package/chessboard.bundle.js +0 -4072
package/dist/chessboard.css
CHANGED
|
@@ -107,26 +107,22 @@
|
|
|
107
107
|
box-shadow: inset 0 0 10px var(--highlightSquare);
|
|
108
108
|
}/* Piece-specific styles */
|
|
109
109
|
.piece {
|
|
110
|
-
position:
|
|
110
|
+
position: absolute;
|
|
111
111
|
cursor: pointer;
|
|
112
112
|
/* Solo transizioni specifiche, non "all" */
|
|
113
113
|
transition: opacity var(--fade-time, 150ms) var(--fade-animation, ease);
|
|
114
114
|
z-index: 10;
|
|
115
115
|
/* Hint al browser per ottimizzazioni */
|
|
116
116
|
will-change: auto;
|
|
117
|
-
width: 100%;
|
|
118
|
-
height: 100%;
|
|
119
117
|
}
|
|
120
118
|
|
|
121
119
|
.piece.dragging {
|
|
122
|
-
position: absolute;
|
|
123
120
|
z-index: 100;
|
|
124
121
|
/* Disabilita completamente le transizioni durante il drag */
|
|
125
122
|
transition: none !important;
|
|
126
123
|
/* Hint per ottimizzazione durante drag */
|
|
127
124
|
will-change: left, top;
|
|
128
|
-
/*
|
|
129
|
-
transform: scale(1.1);
|
|
125
|
+
/* Rimuovo l'ingrandimento che causava problemi visivi */
|
|
130
126
|
}
|
|
131
127
|
|
|
132
128
|
.piece.fading {
|
|
@@ -139,6 +135,32 @@
|
|
|
139
135
|
transition: transform var(--move-time, 200ms) var(--move-animation, ease);
|
|
140
136
|
}
|
|
141
137
|
|
|
138
|
+
/* Piece replacement during promotion - no transitions to avoid flickering */
|
|
139
|
+
.piece.replacing {
|
|
140
|
+
transition: none !important;
|
|
141
|
+
opacity: 1;
|
|
142
|
+
transform: none;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* Piece transformation during promotion - smooth scaling animation */
|
|
146
|
+
.piece.transforming {
|
|
147
|
+
transition: none !important;
|
|
148
|
+
transform-origin: center center;
|
|
149
|
+
will-change: transform, opacity;
|
|
150
|
+
z-index: 50;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* Subtle bounce effect after transformation */
|
|
154
|
+
.piece.transform-complete {
|
|
155
|
+
animation: transformBounce 0.4s ease-out;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@keyframes transformBounce {
|
|
159
|
+
0% { transform: scale(1); }
|
|
160
|
+
50% { transform: scale(1.1); }
|
|
161
|
+
100% { transform: scale(1); }
|
|
162
|
+
}
|
|
163
|
+
|
|
142
164
|
/* Piece sizing */
|
|
143
165
|
.piece img {
|
|
144
166
|
width: 100%;
|