Skip to content

Commit

Permalink
v5.0.0-alpha.266: Dark Mode Slide Bugfix, AQC SVGs
Browse files Browse the repository at this point in the history
  • Loading branch information
cameroncheung00 committed Oct 3, 2023
1 parent 11d0551 commit d7b5eaa
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@
"preview:https": "serve dist",
"reinstall": "rm -rf node_modules; yarn; vue-tsc --noEmit"
},
"version": "5.0.0-alpha.265"
"version": "5.0.0-alpha.266"
}
53 changes: 53 additions & 0 deletions src/models/images/svg/allqueenschess/board.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions src/scripts/gamesmanUni/moveAnimation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ const animateImageAutoGUI = (volume: number, currPosition: string, nextPosition:
var diffIdxs = [];
var i;
var entitiesAppear = false;
var appearingChar, movingChar;

var svg = document.getElementById('image-autogui'); //Get svg element
var g = document.createElementNS("http://www.w3.org/2000/svg", 'g');
Expand All @@ -133,7 +134,7 @@ const animateImageAutoGUI = (volume: number, currPosition: string, nextPosition:
gsap.fromTo("#entity" + i, {autoAlpha: 1}, {duration: 0.5, autoAlpha: 0.001});
}
if (nextBoard[i] != '-') { // Entity that will be at center i shall fade in
var appearingChar = nextBoard[i];
appearingChar = nextBoard[i];
if (appearingChar in entities) {
entitiesAppear = true;
var newElement = document.createElementNS("http://www.w3.org/2000/svg", 'image');
Expand Down Expand Up @@ -197,7 +198,7 @@ const animateImageAutoGUI = (volume: number, currPosition: string, nextPosition:
}
}
for (i of fadeInIdxs) {
var appearingChar = nextBoard[i];
appearingChar = nextBoard[i];
if (appearingChar in entities) {
entitiesAppear = true;
var newElement = document.createElementNS("http://www.w3.org/2000/svg", 'image');
Expand All @@ -207,7 +208,7 @@ const animateImageAutoGUI = (volume: number, currPosition: string, nextPosition:
newElement.setAttribute("width", (entities[appearingChar].scale * widthFactor).toString());
newElement.setAttribute("height", (entities[appearingChar].scale * widthFactor).toString());
newElement.setAttribute("href", getImageSource(entities[appearingChar].image));
newElement.setAttribute("opacity", "0.001");
newElement.setAttribute("opacity", "0");
g.appendChild(newElement);
}
}
Expand All @@ -218,9 +219,9 @@ const animateImageAutoGUI = (volume: number, currPosition: string, nextPosition:
const toCoords = centers[idxTo];
const fromCoords = centers[idxFrom];

var movingChar = currBoard[idxFrom];
movingChar = currBoard[idxFrom];
if (movingChar in entities) {
gsap.fromTo("#entity" + idxFrom, {autoAlpha: 1}, {duration: 0.001, autoAlpha: 0.001});
gsap.fromTo("#entity" + idxFrom, {autoAlpha: 1}, {duration: 0.001, autoAlpha: 0});
var newElement = document.createElementNS("http://www.w3.org/2000/svg", 'image');
newElement.setAttribute("id", "movingEntity" + idxFrom);
newElement.setAttribute("x", (fromCoords[0] - 0.5 * entities[movingChar].scale * widthFactor).toString());
Expand Down

0 comments on commit d7b5eaa

Please sign in to comment.