Skip to content

Commit 7eac36c

Browse files
committed
[16] Fix the animation issue when domain with action cost
1. Show the cost label in the page from visual stage data 2. Add css for action cost label changed 3. Slow down the action when cost increasing Resolves #16 modified: Dockerfile // Change the node version modified: package.json modified: src/pages/PageFour/dataUtils.js // Add variables to represent the max cost and all cost modified: src/pages/PageFour/index.js modified: src/pages/PageFour/index.less modified: src/pages/PageFour/screenComponents.jsx
1 parent 32d0ae2 commit 7eac36c

File tree

7 files changed

+400
-261
lines changed

7 files changed

+400
-261
lines changed

.gitmessage

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[1234] Fix issue of bad commit messages
2+
3+
#
4+
# Please provide your commit's subject above this line.
5+
#
6+
# Guidelines
7+
#
8+
# 1. Separate subject from body with a blank line
9+
# 2. Limit the subject line to 50 characters
10+
# 3. Add [ISSUE NUMBER] at the beginning of the subject line, e.g. [1234].
11+
# 3. Capitalize the first letter subject line
12+
# 4. Do not end the subject line with a period
13+
# 5. Use the imperative mood in the subject line
14+
# 6. Wrap the body at 72 characters
15+
# 7. Use the body to explain what and why vs. how
16+
#
17+
# Description of your commit should go below. Make sure to leave
18+
# one empty line after your description.
19+
#
20+
21+
22+
#
23+
# Finally, please add a reference to other issues or pull
24+
# request on GitHub here below.
25+
#
26+
# Example
27+
# -------
28+
#
29+
# Resolves #1
30+
# Resolves #2
31+
# Closes #3
32+
#
33+
# Accepted keywords are:
34+
#
35+
# * Resolves
36+
# * Closes
37+
# * See also
38+
#
39+
40+
Resolves #1234

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:14.18-alpine AS build
1+
FROM node:18.12-alpine AS build
22

33
WORKDIR /app
44
COPY package.json package-lock.json ./

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@
8080
"workbox-webpack-plugin": "5.1.4"
8181
},
8282
"scripts": {
83-
"start": "node scripts/start.js",
84-
"build": "node scripts/build.js",
83+
"start": "NODE_OPTIONS=--openssl-legacy-provider node scripts/start.js ",
84+
"build": "NODE_OPTIONS=--openssl-legacy-provider node scripts/build.js",
8585
"test": "jest"
8686
},
8787
"eslintConfig": {

src/pages/PageFour/dataUtils.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function getSubGoal() {
4141
}
4242
}
4343
map.set(currentStep, vidualSteps)
44-
}
44+
}
4545
})
4646
return map;
4747
}
@@ -78,5 +78,22 @@ export const subGoal = getSubGoal();
7878
export const stepSubgoalMap = getStepSubgoalMap();
7979
export const vfg = contentObject;
8080
export const textContent = content
81+
82+
const visualStages = contentObject["visualStages"]?contentObject["visualStages"]: []
83+
84+
export const stepCosts = Array.from(
85+
new Set(
86+
visualStages.map((item,index, arr)=>{
87+
if (index === 0) {
88+
return 0;
89+
} else {
90+
return (item.cost - arr[index - 1].cost)? (item.cost - arr[index - 1].cost):0 ;
91+
}
92+
})
93+
)
94+
)
95+
96+
export const maxStepCost = [...stepCosts].sort((a, b) => a - b)[stepCosts.length - 1];
97+
8198
//export const initialPos = getInitialBlocksPos();
8299
//export default null;

0 commit comments

Comments
 (0)