add light theme

This commit is contained in:
Vick Scarlet
2021-11-28 11:40:21 +08:00
parent 4f55c00f86
commit e1e2ab4701
6 changed files with 418 additions and 50 deletions

View File

@@ -2,7 +2,7 @@
"x":0, "x":0,
"type":"View", "type":"View",
"selectedBox":1, "selectedBox":1,
"selecteID":2, "selecteID":13,
"props":{"y":50,"width":570,"sceneColor":"#000000","mouseThrough":true,"mouseEnabled":false,"height":150,"alpha":0.75}, "props":{"y":50,"width":570,"sceneColor":"#000000","mouseThrough":true,"mouseEnabled":false,"height":150,"alpha":0.75},
"nodeParent":-1, "nodeParent":-1,
"label":"View", "label":"View",
@@ -15,7 +15,7 @@
{ {
"x":15, "x":15,
"type":"Box", "type":"Box",
"props":{"x":0,"var":"boxBg","name":"boxBg"}, "props":{"var":"boxBg","top":0,"right":0,"name":"boxBg","left":0,"bottom":0},
"nodeParent":1, "nodeParent":1,
"label":"Box(boxBg)", "label":"Box(boxBg)",
"isOpen":true, "isOpen":true,
@@ -24,19 +24,6 @@
"hasChild":true, "hasChild":true,
"compId":5, "compId":5,
"child":[ "child":[
{
"x":30,
"type":"Rect",
"props":{"width":560,"lineWidth":1,"height":150,"fillColor":"#292a28"},
"nodeParent":5,
"label":"Rect",
"isDirectory":false,
"isAniNode":true,
"hasChild":false,
"compId":6,
"child":[
]
},
{ {
"x":30, "x":30,
"type":"Rect", "type":"Rect",
@@ -49,6 +36,19 @@
"compId":14, "compId":14,
"child":[ "child":[
] ]
},
{
"x":30,
"type":"Box",
"props":{"var":"bg1","top":0,"runtime":"ColorfulBox","right":10,"left":0,"bottom":0},
"nodeParent":5,
"label":"Box(bg1)",
"isDirectory":false,
"isAniNode":true,
"hasChild":false,
"compId":15,
"child":[
]
}] }]
}, },
{ {

View File

@@ -1,8 +1,8 @@
{ {
"x":0, "x":0,
"type":"View", "type":"View",
"selectedBox":1, "selectedBox":181,
"selecteID":8, "selecteID":184,
"referenceLines":null, "referenceLines":null,
"props":{"width":1125,"sceneColor":"#000000","runtime":"ViewBase","height":2436}, "props":{"width":1125,"sceneColor":"#000000","runtime":"ViewBase","height":2436},
"nodeParent":-1, "nodeParent":-1,
@@ -117,9 +117,9 @@
{ {
"x":60, "x":60,
"type":"Label", "type":"Label",
"props":{"x":183,"text":"UI_Property_Charm","fontSize":70,"font":"SimHei","color":"#ffffff","centerY":0,"anchorY":0.5,"anchorX":0.5}, "props":{"x":183,"text":"UI_Property_Charm","name":"font_default","fontSize":70,"font":"SimHei","color":"#ffffff","centerY":0,"anchorY":0.5,"anchorX":0.5},
"nodeParent":10, "nodeParent":10,
"label":"Label", "label":"Label(font_default)",
"isDirectory":false, "isDirectory":false,
"isAniNode":true, "isAniNode":true,
"hasChild":false, "hasChild":false,
@@ -444,9 +444,9 @@
{ {
"x":60, "x":60,
"type":"Label", "type":"Label",
"props":{"x":183,"text":"UI_Property_Intelligence","fontSize":70,"font":"SimHei","color":"#ffffff","centerY":0,"anchorY":0.5,"anchorX":0.5}, "props":{"x":183,"text":"UI_Property_Intelligence","name":"font_default","fontSize":70,"font":"SimHei","color":"#ffffff","centerY":0,"anchorY":0.5,"anchorX":0.5},
"nodeParent":121, "nodeParent":121,
"label":"Label", "label":"Label(font_default)",
"isDirectory":false, "isDirectory":false,
"isAniNode":true, "isAniNode":true,
"hasChild":false, "hasChild":false,
@@ -771,9 +771,9 @@
{ {
"x":60, "x":60,
"type":"Label", "type":"Label",
"props":{"x":183,"text":"UI_Property_Strength","fontSize":70,"font":"SimHei","color":"#ffffff","centerY":0,"anchorY":0.5,"anchorX":0.5}, "props":{"x":183,"text":"UI_Property_Strength","name":"font_default","fontSize":70,"font":"SimHei","color":"#ffffff","centerY":0,"anchorY":0.5,"anchorX":0.5},
"nodeParent":151, "nodeParent":151,
"label":"Label", "label":"Label(font_default)",
"isDirectory":false, "isDirectory":false,
"isAniNode":true, "isAniNode":true,
"hasChild":false, "hasChild":false,
@@ -1098,9 +1098,9 @@
{ {
"x":60, "x":60,
"type":"Label", "type":"Label",
"props":{"x":183,"text":"UI_Property_Money","fontSize":70,"font":"SimHei","color":"#ffffff","centerY":0,"anchorY":0.5,"anchorX":0.5}, "props":{"x":183,"text":"UI_Property_Money","name":"font_default","fontSize":70,"font":"SimHei","color":"#ffffff","centerY":0,"anchorY":0.5,"anchorX":0.5},
"nodeParent":181, "nodeParent":181,
"label":"Label", "label":"Label(font_default)",
"isDirectory":false, "isDirectory":false,
"isAniNode":true, "isAniNode":true,
"hasChild":false, "hasChild":false,

View File

@@ -1,8 +1,8 @@
{ {
"x":0, "x":0,
"type":"View", "type":"View",
"selectedBox":1, "selectedBox":18,
"selecteID":102, "selecteID":17,
"props":{"width":1125,"sceneColor":"#000000","runtime":"ViewBase","height":2436}, "props":{"width":1125,"sceneColor":"#000000","runtime":"ViewBase","height":2436},
"nodeParent":-1, "nodeParent":-1,
"label":"View", "label":"View",
@@ -308,7 +308,7 @@
{ {
"x":45, "x":45,
"type":"VBox", "type":"VBox",
"props":{"y":15,"var":"vboxTrajectory","space":15,"right":-6,"name":"vboxTrajectory","left":-6}, "props":{"y":15,"var":"vboxTrajectory","space":20,"right":-6,"name":"vboxTrajectory","left":-6},
"nodeParent":18, "nodeParent":18,
"label":"VBox(vboxTrajectory)", "label":"VBox(vboxTrajectory)",
"isOpen":true, "isOpen":true,
@@ -332,17 +332,16 @@
{ {
"x":75, "x":75,
"type":"HBox", "type":"HBox",
"props":{"y":10,"x":200,"name":"hboxAge","anchorX":1,"align":"middle"}, "props":{"y":25,"x":200,"name":"hboxAge","anchorX":1,"align":"middle"},
"nodeParent":88, "nodeParent":88,
"label":"HBox(hboxAge)", "label":"HBox(hboxAge)",
"isOpen":true, "isOpen":false,
"isDirectory":true, "isDirectory":true,
"isAniNode":true, "isAniNode":true,
"hasChild":true, "hasChild":true,
"compId":91, "compId":91,
"child":[ "child":[
{ {
"x":90,
"type":"Label", "type":"Label",
"props":{"x":0,"text":"3000","name":"labAge","fontSize":50,"font":"SimHei","color":"#cfea5c","anchorX":0}, "props":{"x":0,"text":"3000","name":"labAge","fontSize":50,"font":"SimHei","color":"#cfea5c","anchorX":0},
"nodeParent":91, "nodeParent":91,
@@ -355,7 +354,6 @@
] ]
}, },
{ {
"x":90,
"type":"Label", "type":"Label",
"props":{"x":1,"text":"岁","fontSize":50,"font":"SimHei","color":"#cfea5c","anchorX":0}, "props":{"x":1,"text":"岁","fontSize":50,"font":"SimHei","color":"#cfea5c","anchorX":0},
"nodeParent":91, "nodeParent":91,
@@ -368,7 +366,6 @@
] ]
}, },
{ {
"x":90,
"type":"Label", "type":"Label",
"props":{"x":2,"text":"","fontSize":50,"font":"SimHei","color":"#cfea5c","anchorX":0}, "props":{"x":2,"text":"","fontSize":50,"font":"SimHei","color":"#cfea5c","anchorX":0},
"nodeParent":91, "nodeParent":91,
@@ -384,7 +381,7 @@
{ {
"x":75, "x":75,
"type":"Label", "type":"Label",
"props":{"y":10,"wordWrap":true,"text":"你的父母开始辅导你数学和英语,智力+1","right":0,"name":"labContent","left":220,"leading":10,"fontSize":50,"font":"SimHei","color":"#ffffff"}, "props":{"y":25,"wordWrap":true,"text":"你的父母开始辅导你数学和英语,智力+1","right":0,"name":"labContent","left":220,"leading":25,"fontSize":50,"font":"SimHei","color":"#ffffff"},
"nodeParent":88, "nodeParent":88,
"label":"Label(labContent)", "label":"Label(labContent)",
"isDirectory":false, "isDirectory":false,

View File

@@ -69,10 +69,16 @@ function mapSet(target, source) {
function deepMapSet(target, source) { function deepMapSet(target, source) {
for(const key in source) { for(const key in source) {
if(typeof source[key] === 'object') let value = source[key];
deepMapSet(target[key], source[key]); switch(typeof value) {
else case 'function': value = value();
target[key] = source[key]; case 'object':
if(!Array.isArray(value)) {
deepMapSet(target[key], value);
break;
}
default: target[key] = value;
}
} }
return target; return target;
} }

File diff suppressed because one or more lines are too long

View File

@@ -46,7 +46,7 @@ const cyber = {
} }
} }
const def = { const dark = {
pages: { pages: {
[pages.LOADING]: "loading", [pages.LOADING]: "loading",
[pages.MAIN]: "default/main", [pages.MAIN]: "default/main",
@@ -67,13 +67,12 @@ const def = {
trajectoryItem: { trajectoryItem: {
box: { box: {
defaultColor: '#4a5361', defaultColor: '#4a5361',
defaultStroke: '#eeeeee', defaultStroke: '#4a5361',
defaultLabel: '#eeeeee', defaultLabel: '#eeeeee',
hoverColor: '#4a5361', hoverColor: '#4a5361',
hoverStroke: '#eeeeee', hoverStroke: '#4a5361',
hoverLabel: '#eeeeee', hoverLabel: '#eeeeee',
lineWidth: 2, filters: ()=>[new Laya.GlowFilter("#eeeeee", 8, 0, 0)],
radius: 0,
}, },
ageColor: '#ffffee', ageColor: '#ffffee',
contentColor: '#eeeeee', contentColor: '#eeeeee',
@@ -293,8 +292,8 @@ const def = {
[pages.MAIN]: { [pages.MAIN]: {
vars: { vars: {
btnRemake: 'btn_main', btnRemake: 'btn_main',
labTitle: { color: '#eeeeee' }, labTitle: 'title',
labSubTitle: { color: '#eeeeee' }, labSubTitle: 'title',
}, },
names: { names: {
btnSmall: 'btn_small', btnSmall: 'btn_small',
@@ -386,11 +385,375 @@ const def = {
} }
}, },
popups: { popups: {
[popups.ACHIEVEMENT]: {
vars: {
bg1: {
defaultColor: '#292a28',
defaultStroke: '#84ff55',
hoverColor: '#292a28',
hoverStroke: '#84ff55',
}
}
}
}
}
}
const light = {
pages: {
[pages.LOADING]: "loading",
[pages.MAIN]: "default/main",
[pages.TALENT]: "default/talent",
[pages.PROPERTY]: "default/property",
[pages.TRAJECTORY]: "default/trajectory",
[pages.SUMMARY]: "default/summary",
[pages.ACHIEVEMENT]: "default/achievement",
[pages.THANKS]: "default/thanks",
},
popups: {
[popups.ACHIEVEMENT]: "default/popup/achievementPopup",
},
configs: {
bgColor: '#ffffff',
common: {
defaultFontColor: '#000000',
trajectoryItem: {
box: {
defaultColor: '#ffffff',
defaultStroke: '#ffffff',
defaultLabel: '#000000',
hoverColor: '#ffffff',
hoverStroke: '#ffffff',
hoverLabel: '#000000',
lineWidth: 0,
radius: 0,
filters: ()=>[new Laya.GlowFilter("#b1b1b1", 8, 0, 0)],
},
ageColor: '#000000',
contentColor: '#000000',
},
grade: [
'#000000',
'#55fffe',
'#b17cff',
'#ffce45',
],
filter: [
'#000000ff',
'#55fffeff',
'#b17cffff',
'#ffce45ff',
],
card: [
{
normal: {
defaultColor: '#ededed',
defaultStroke: '#f8f8f8',
defaultLabel: '#666666',
hoverColor: '#666666',
hoverStroke: '#f8f8f8',
hoverLabel: '#ffffff',
lineWidth: 4,
radius: 4,
},
selected: {
defaultColor: '#666666',
defaultStroke: '#a5ff88',
defaultLabel: '#ffffff',
hoverColor: '#666666',
hoverStroke: '#a5ff88',
hoverLabel: '#ffffff',
lineWidth: 4,
radius: 4,
}
},
{
normal: {
defaultColor: '#87cefa',
defaultStroke: '#f8f8f8',
defaultLabel: '#666666',
hoverColor: '#6495ed',
hoverStroke: '#f8f8f8',
hoverLabel: '#ffffff',
lineWidth: 4,
radius: 4,
},
selected: {
defaultColor: '#6495ed',
defaultStroke: '#a5ff88',
defaultLabel: '#ffffff',
hoverColor: '#6495ed',
hoverStroke: '#a5ff88',
hoverLabel: '#ffffff',
lineWidth: 4,
radius: 4,
}
},
{
normal: {
defaultColor: '#e7beff',
defaultStroke: '#f8f8f8',
defaultLabel: '#666666',
hoverColor: '#e2a7ff',
hoverStroke: '#f8f8f8',
hoverLabel: '#ffffff',
lineWidth: 4,
radius: 4,
},
selected: {
defaultColor: '#e2a7ff',
defaultStroke: '#a5ff88',
defaultLabel: '#ffffff',
hoverColor: '#e2a7ff',
hoverStroke: '#a5ff88',
hoverLabel: '#ffffff',
lineWidth: 4,
radius: 4,
}
},
{
normal: {
defaultColor: '#f7a989',
defaultStroke: '#f8f8f8',
defaultLabel: '#666666',
hoverColor: '#ffa07a',
hoverStroke: '#f8f8f8',
hoverLabel: '#ffffff',
lineWidth: 4,
radius: 4,
},
selected: {
defaultColor: '#ffa07a',
defaultStroke: '#f8f8f8',
defaultLabel: '#ffffff',
hoverColor: '#ffa07a',
hoverStroke: '#f8f8f8',
hoverLabel: '#ffffff',
lineWidth: 4,
radius: 4,
}
}
],
summary: [
{
defaultColor: '#ededed',
defaultStroke: '#f8f8f8',
defaultLabel: '#666666',
hoverColor: '#666666',
hoverStroke: '#f8f8f8',
hoverLabel: '#ffffff',
lineWidth: 4,
radius: 4,
},{
defaultColor: '#6495ed',
defaultStroke: '#f8f8f8',
defaultLabel: '#ffffff',
hoverColor: '#87cefa',
hoverStroke: '#f8f8f8',
hoverLabel: '#666666',
lineWidth: 4,
radius: 4,
},{
defaultColor: '#e2a7ff',
defaultStroke: '#f8f8f8',
defaultLabel: '#ffffff',
hoverColor: '#e7beff',
hoverStroke: '#f8f8f8',
hoverLabel: '#666666',
lineWidth: 4,
radius: 4,
},{
defaultColor: '#ffa07a',
defaultStroke: '#f8f8f8',
defaultLabel: '#ffffff',
hoverColor: '#f7a989',
hoverStroke: '#f8f8f8',
hoverLabel: '#666666',
lineWidth: 4,
radius: 4,
},
],
achievement: [
{
defaultColor: '#ededed',
defaultStroke: '#cccccc',
defaultLabel: '#000000',
hoverColor: '#eeeeee',
hoverStroke: '#cccccc',
hoverLabel: '#efefef',
lineWidth: 4,
radius: 0,
},{
defaultColor: '#6495ed',
defaultStroke: '#cccccc',
defaultLabel: '#eeeeee',
hoverColor: '#87cefa',
hoverStroke: '#cccccc',
hoverLabel: '#3b3b3b',
lineWidth: 4,
radius: 0,
},{
defaultColor: '#e2a7ff',
defaultStroke: '#cccccc',
defaultLabel: '#eeeeee',
hoverColor: '#e7beff',
hoverStroke: '#cccccc',
hoverLabel: '#3b3b3b',
lineWidth: 4,
radius: 0,
},{
defaultColor: '#ffa07a',
defaultStroke: '#cccccc',
defaultLabel: '#eeeeee',
hoverColor: '#f7a989',
hoverStroke: '#cccccc',
hoverLabel: '#3b3b3b',
lineWidth: 4,
radius: 0,
}
]
},
class: {
btn_main: {
defaultColor: '#ffffff',
defaultStroke: '#cccccc',
defaultLabel: '#000000',
hoverColor: '#ff7878',
hoverStroke: '#cccccc',
hoverLabel: '#ffffff',
lineWidth: 2,
radius: 4,
},
btn_small: {
defaultColor: '#5865f2',
defaultStroke: '#eeeeee',
defaultLabel: '#eeeeee',
hoverColor: '#1160b0',
hoverStroke: '#eeeeee',
hoverLabel: '#eeeeee',
lineWidth: 0,
radius: 4,
},
title: {
color: '#000000',
},
font_default: {
color: '#000000',
}
},
pages: {
[pages.MAIN]: {
vars: {
btnRemake: 'btn_main',
labTitle: 'title',
labSubTitle: 'title',
},
names: {
btnSmall: 'btn_small',
}
},
[pages.TALENT]: {
vars: {
btnDrawCard: 'btn_main',
btnNext: 'btn_main',
title: 'title',
}
},
[pages.PROPERTY]: {
vars: {
btnRandomAllocate: 'btn_main',
btnNext: 'btn_main',
title: 'title',
},
names: {
font_default: 'font_default',
property: {
colorFilter: '#000000ff'
}
}
},
[pages.TRAJECTORY]: {
vars: {
btnSummary: 'btn_main',
boxTrajectory: {
defaultColor: '#ffffff',
defaultStroke: '#9b9b9b',
defaultLabel: '#eeeeee',
hoverColor: '#ffffff',
hoverStroke: '#9b9b9b',
hoverLabel: '#eeeeee',
lineWidth: 1,
radius: 4,
},
boxSpeed: {
colorFilter: '#666666ff'
}
},
names: {
propertyBox: {
defaultColor: '#8d8d8d',
defaultStroke: '#eeeeee',
defaultLabel: '#ffffff',
hoverColor: '#8d8d8d',
hoverStroke: '#eeeeee',
hoverLabel: '#ffffff',
lineWidth: 2,
radius: 4,
},
propertyValue: {
defaultColor: '#ffffff',
defaultStroke: '#eeeeee',
defaultLabel: '#222831',
hoverColor: '#ffffff',
hoverStroke: '#eeeeee',
hoverLabel: '#222831',
lineWidth: 0,
radius: 4,
}
}
},
[pages.SUMMARY]: {
vars: {
btnAgain: 'btn_main',
title: 'title',
},
names: {
font_default: 'font_default',
}
},
[pages.ACHIEVEMENT]: {
vars: {
btnBack: 'btn_small',
btnRank: 'btn_small',
},
names: {
font_default: 'font_default',
title: 'title',
}
},
[pages.THANKS]: {
vars: {
btnBack: 'btn_small',
},
}
},
popups: {
[popups.ACHIEVEMENT]: {
vars: {
bg1: {
defaultColor: '#ffffff',
defaultStroke: '#84ff55',
hoverColor: '#ffffff',
hoverStroke: '#84ff55',
lineWidth: 1,
}
}
}
} }
} }
} }
const themes = { default: def, cyber }; const themes = { default: dark, cyber, dark, light };
export default { themes, pages, popups }; export default { themes, pages, popups };