From 4532786cd1b67ea0cfcc100e982a4ac690959f5d Mon Sep 17 00:00:00 2001 From: Shu Uesugi Date: Thu, 24 Oct 2019 23:36:35 -0700 Subject: [PATCH] Update 15 --- scripts/lib/initialExpressionContainers.ts | 3 +- src/components/ConditionalBorder.tsx | 18 +- src/components/VariableExpressionBox.tsx | 15 +- src/components/VariableShadeContext.tsx | 1 + src/contents/15.en.tsx | 36 +- src/contents/15.jp.tsx | 84 +++- src/lib/runners/olqy.json | 461 +++++++++++---------- src/lib/theme/zIndices.ts | 10 +- 8 files changed, 361 insertions(+), 267 deletions(-) diff --git a/scripts/lib/initialExpressionContainers.ts b/scripts/lib/initialExpressionContainers.ts index 44a2522d2..2256b6da8 100644 --- a/scripts/lib/initialExpressionContainers.ts +++ b/scripts/lib/initialExpressionContainers.ts @@ -2260,7 +2260,8 @@ export const bgid = initializeExpressionContainer([ } } } - } + }, + { name: 'blankNumber', highlighted: true } ]) export const jypn = initializeExpressionContainer([ diff --git a/src/components/ConditionalBorder.tsx b/src/components/ConditionalBorder.tsx index b017ac90a..21e2b8b46 100644 --- a/src/components/ConditionalBorder.tsx +++ b/src/components/ConditionalBorder.tsx @@ -75,9 +75,11 @@ const ConditionalBorder = ({ falseCase: falseCaseColor, condition: conditionColor }[type] - const { shadeNonNumbers, shadeNonHighlightedFunc } = useContext( - VariableShadeContext - ) + const { + shadeNonNumbers, + shadeNonHighlightedFunc, + shadeNonFactorial + } = useContext(VariableShadeContext) return ( <> {shaded && } @@ -90,7 +92,11 @@ const ConditionalBorder = ({ left: 0.3em; display: inline-flex; font-size: ${fontSize(variableSizeOverrides || variableSize)}; - opacity: ${shadeNonNumbers || shadeNonHighlightedFunc ? 0.7 : 1}; + opacity: ${shadeNonNumbers || + shadeNonHighlightedFunc || + shadeNonFactorial + ? 0.7 + : 1}; `} > {type === 'trueCase' && ( @@ -119,7 +125,9 @@ const ConditionalBorder = ({ border-top: 2px solid ${colors('indigo300')}; `} > - {(shadeNonNumbers || shadeNonHighlightedFunc) && } + {(shadeNonNumbers || shadeNonHighlightedFunc || shadeNonFactorial) && ( + + )} ) diff --git a/src/components/VariableExpressionBox.tsx b/src/components/VariableExpressionBox.tsx index 18ad857c3..4e34e27f0 100644 --- a/src/components/VariableExpressionBox.tsx +++ b/src/components/VariableExpressionBox.tsx @@ -404,9 +404,11 @@ const VariableExpressionBox = ({ expression }: VariableExpressionBoxProps) => { const { hidePriorities, variableSize } = useContext(ExpressionRunnerContext) const { conditionalState } = useContext(ConditionalContext) const { binaryState } = useContext(BinaryContext) - const { shadeNonNumbers, shadeNonHighlightedFunc } = useContext( - VariableShadeContext - ) + const { + shadeNonNumbers, + shadeNonHighlightedFunc, + shadeNonFactorial + } = useContext(VariableShadeContext) return ( <> @@ -416,7 +418,12 @@ const VariableExpressionBox = ({ expression }: VariableExpressionBoxProps) => { expression.name !== 'B')) || (shadeNonHighlightedFunc && (expression.shorthandFunc === undefined || - expression.highlightType !== 'initialHighlighted'))) && ( + expression.highlightType !== 'initialHighlighted')) || + (shadeNonFactorial && + expression.shorthandNumber !== 3 && + expression.shorthandNumber !== 4 && + expression.shorthandNumber !== 5 && + expression.name !== 'blankNumber')) && ( ( } />

- 先ほどの弁当箱の上の部分に {' '} - を追加してみたぞ。 + これを計算するには、 + + 先ほどの弁当箱の上の{' '} + の部分を{' '} + にして実行すればいい + + んだ。

) } ]} /> - - 上の部分に を追加 - + + + の部分を… + + + + に変えて実行すればいい + + ( ]} /> - 上の部分に を追加 + 上の部分を
して すると… @@ -1314,17 +1326,19 @@ export default () => ( } />

- 先ほどの弁当箱の上の部分に {' '} - を追加してみたぞ。 + 先ほどの弁当箱の上の部分を {' '} + にしてみたぞ。

) } ]} /> - - 上の部分に を追加 - + + + 上の部分を に + + ( ) }, + { + type: 'thinking', + children: ( + <> +

分かった。では、

+
    + + + に{' '} + を、 + + + + + に{' '} + を当てはめてみよう。 + + +
+ + ) + } + ]} + /> + + と{' '} + に… + + + + {' '} + を当てはめてみる + +

- 分かった。じゃあ、こちらの{' '} + では、こちらの{' '} に変換できる弁当箱 @@ -219,20 +255,13 @@ export default () => ( }} /> -

- と{' '} - {' '} - の部分に入れてみよう。 -

+

それぞれ使ってみよう!

) } ]} /> - - と{' '} - の部分に… - + {' '} @@ -1133,17 +1162,28 @@ export default () => ( } />

- 先ほどの弁当箱の上の部分に {' '} - を追加してみたぞ。 + これを計算するには、 + + 先ほどの弁当箱の上の{' '} + の部分を{' '} + にして実行すればいい + + んだ。

) } ]} /> - - 上の部分に を追加 - + + + の部分を… + + + + に変えて実行すればいい + + ( ]} /> - 上の部分に を追加 + 上の部分を
して すると… @@ -1291,17 +1331,19 @@ export default () => ( } />

- 先ほどの弁当箱の上の部分に {' '} - を追加してみたぞ。 + 先ほどの弁当箱の上の部分を {' '} + にしてみたぞ。

) } ]} /> - - 上の部分に を追加 - + + + 上の部分を に + +