Commit 2ce29df0 authored by techird's avatar techird

add compact mode

parent 6f062454
...@@ -8,7 +8,9 @@ KityMinder.LANG['zh-cn'] = { ...@@ -8,7 +8,9 @@ KityMinder.LANG['zh-cn'] = {
}, },
'theme': { 'theme': {
'classic': '脑图经典', 'classic': '脑图经典',
'classic-compact': '紧凑经典',
'snow': '温柔冷光', 'snow': '温柔冷光',
'snow-compact': '紧凑冷光',
'fish': '鱼骨图', 'fish': '鱼骨图',
'wire': '线框', 'wire': '线框',
'fresh-red': '清新红', 'fresh-red': '清新红',
......
KityMinder.registerTheme('classic', { ['classic', 'classic-compact'].forEach(function(name) {
var compact = name == 'classic-compact';
KityMinder.registerTheme(name, {
'background': '#3A4144 url(ui/theme/default/images/grid.png) repeat', 'background': '#3A4144 url(ui/theme/default/images/grid.png) repeat',
'root-color': '#430', 'root-color': '#430',
'root-background': '#e9df98', 'root-background': '#e9df98',
'root-stroke': '#e9df98', 'root-stroke': '#e9df98',
'root-font-size': 24, 'root-font-size': 24,
'root-padding': [15, 25], 'root-padding': compact ? [10, 25] : [15, 25],
'root-margin': [30, 100], 'root-margin': compact ? [15, 25] : [30, 100],
'root-radius': 30, 'root-radius': 30,
'root-space': 10, 'root-space': 10,
'root-shadow': 'rgba(0, 0, 0, .25)', 'root-shadow': 'rgba(0, 0, 0, .25)',
...@@ -15,8 +18,8 @@ KityMinder.registerTheme('classic', { ...@@ -15,8 +18,8 @@ KityMinder.registerTheme('classic', {
'main-background': '#a4c5c0', 'main-background': '#a4c5c0',
'main-stroke': '#a4c5c0', 'main-stroke': '#a4c5c0',
'main-font-size': 16, 'main-font-size': 16,
'main-padding': [6, 20], 'main-padding': compact ? [5, 15] : [6, 20],
'main-margin': 20, 'main-margin': compact ? [5, 10] : 20,
'main-radius': 10, 'main-radius': 10,
'main-space': 5, 'main-space': 5,
'main-shadow': 'rgba(0, 0, 0, .25)', 'main-shadow': 'rgba(0, 0, 0, .25)',
...@@ -26,7 +29,7 @@ KityMinder.registerTheme('classic', { ...@@ -26,7 +29,7 @@ KityMinder.registerTheme('classic', {
'sub-stroke': 'none', 'sub-stroke': 'none',
'sub-font-size': 12, 'sub-font-size': 12,
'sub-padding': [5, 10], 'sub-padding': [5, 10],
'sub-margin': [15, 20], 'sub-margin': compact ? [5, 10] : [15, 20],
'sub-tree-margin': 30, 'sub-tree-margin': 30,
'sub-radius': 5, 'sub-radius': 5,
'sub-space': 5, 'sub-space': 5,
...@@ -54,4 +57,5 @@ KityMinder.registerTheme('classic', { ...@@ -54,4 +57,5 @@ KityMinder.registerTheme('classic', {
'text-selection-color': 'rgb(27,171,255)', 'text-selection-color': 'rgb(27,171,255)',
'line-height':1.5 'line-height':1.5
});
}); });
\ No newline at end of file
KityMinder.registerTheme('snow', {
['snow', 'snow-compact'].forEach(function(name) {
var compact = name == 'snow-compact';
KityMinder.registerTheme(name, {
'background': '#3A4144 url(ui/theme/default/images/grid.png) repeat', 'background': '#3A4144 url(ui/theme/default/images/grid.png) repeat',
'root-color': '#430', 'root-color': '#430',
'root-background': '#e9df98', 'root-background': '#e9df98',
'root-stroke': '#e9df98', 'root-stroke': '#e9df98',
'root-font-size': 24, 'root-font-size': 24,
'root-padding': [15, 25], 'root-padding': compact ? [5, 10] : [15, 25],
'root-margin': 30, 'root-margin': compact ? 15 : 30,
'root-radius': 5, 'root-radius': 5,
'root-space': 10, 'root-space': 10,
'root-shadow': 'rgba(0, 0, 0, .25)', 'root-shadow': 'rgba(0, 0, 0, .25)',
...@@ -15,8 +20,8 @@ KityMinder.registerTheme('snow', { ...@@ -15,8 +20,8 @@ KityMinder.registerTheme('snow', {
'main-background': '#a4c5c0', 'main-background': '#a4c5c0',
'main-stroke': '#a4c5c0', 'main-stroke': '#a4c5c0',
'main-font-size': 16, 'main-font-size': 16,
'main-padding': [6, 20], 'main-padding': compact ? [4, 10] : [6, 20],
'main-margin': [20, 40], 'main-margin': compact ? [5, 10] : [20, 40],
'main-radius': 5, 'main-radius': 5,
'main-space': 5, 'main-space': 5,
'main-shadow': 'rgba(0, 0, 0, .25)', 'main-shadow': 'rgba(0, 0, 0, .25)',
...@@ -26,7 +31,7 @@ KityMinder.registerTheme('snow', { ...@@ -26,7 +31,7 @@ KityMinder.registerTheme('snow', {
'sub-stroke': 'white', 'sub-stroke': 'white',
'sub-font-size': 12, 'sub-font-size': 12,
'sub-padding': [5, 10], 'sub-padding': [5, 10],
'sub-margin': [10, 20], 'sub-margin': compact ? [5, 10] : [10, 20],
'sub-radius': 5, 'sub-radius': 5,
'sub-space': 5, 'sub-space': 5,
...@@ -50,4 +55,5 @@ KityMinder.registerTheme('snow', { ...@@ -50,4 +55,5 @@ KityMinder.registerTheme('snow', {
'text-selection-color': 'rgb(27,171,255)', 'text-selection-color': 'rgb(27,171,255)',
'line-height':1.5 'line-height':1.5
});
}); });
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment