File tree Expand file tree Collapse file tree 2 files changed +23
-8
lines changed
Expand file tree Collapse file tree 2 files changed +23
-8
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,25 @@ export type RuleExplanation = {
99
1010export const rulesExplanation = {
1111 lifespan : {
12+ name : {
13+ ja : "寿命システム" ,
14+ en : "Lifespan system" ,
15+ } ,
16+ description : {
17+ ja : "それぞれのいのちに寿命を設定できます" ,
18+ en : "Set lifespan for each cell" ,
19+ } ,
1220 code : lifespan ,
13- ja : "それぞれのいのちに寿命を設定できます" ,
14- en : "Set lifespan for each cell" ,
1521 } ,
1622 probabilistics : {
23+ name : {
24+ ja : "確率システム" ,
25+ en : "Probabilistic system" ,
26+ } ,
27+ description : {
28+ ja : "生死に確率を導入できます" ,
29+ en : "Introduce probability to life and death" ,
30+ } ,
1731 code : probabilistics ,
18- ja : "生死に確率を導入できます" ,
19- en : "Introduce probability to life and death" ,
2032 } ,
2133} ;
Original file line number Diff line number Diff line change 1515 import { javascript } from " @codemirror/lang-javascript" ;
1616 import { oneDark } from " @codemirror/theme-one-dark" ;
1717 import { EditorView } from " @codemirror/view" ;
18+ import { is } from " valibot" ;
1819
1920 let editingCode = $state (lifeGameJS );
2021 let appliedCode = $state (lifeGameJS );
232233>
233234 <div class =" bg-[rgb(220,220,220)] shadow-lg p-4 h-30 w-full overflow-x-auto" >
234235 <div class =" flex gap-4" >
235- {#each Object .entries (rulesExplanation ) as [ruleName, description ] (ruleName )}
236+ {#each Object .entries (rulesExplanation ) as [ruleName, ruleData ] (ruleName )}
236237 <button
237238 class =" card bg-base-100 shadow-md hover:shadow-lg transition-shadow cursor-pointer text-left flex-shrink-0 w-64"
238239 onclick ={() => {
239- selectRule (description as RuleExplanation );
240+ selectRule (ruleData . name as RuleExplanation );
240241 ruleDrawerOpen = false ;
241242 }}
242243 >
243244 <div class =" card-body p-4" >
244- <h3 class ="card-title text-lg text-primary" >{ruleName }</h3 >
245+ <h3 class =" card-title text-lg text-primary" >
246+ {isJapanese ? ruleData .name .ja : ruleData .name .en }
247+ </h3 >
245248 <p class =" text-sm text-base-content" >
246- {isJapanese ? description .ja : description .en }
249+ {isJapanese ? ruleData . description .ja : ruleData . description .en }
247250 </p >
248251 </div >
249252 </button >
You can’t perform that action at this time.
0 commit comments