Skip to content

Commit

Permalink
🎉(new)Index.js file added!
Browse files Browse the repository at this point in the history
  • Loading branch information
klaudiosinani committed Jun 11, 2017
1 parent 9d54c57 commit 1dee958
Showing 1 changed file with 134 additions and 0 deletions.
134 changes: 134 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
const homeDir = require('home-dir');
const path = homeDir('/.hyper_plugins/node_modules/hyper-pokemon/backgrounds/');
const extension = '.png';


exports.decorateConfig = (config, t) => {

let primary, secondary, text;

switch (config.pokemon) {
case 'pikachu':
primary = '#F6BD20';
secondary = '#623108';
break;

default:
if (config.pokemonSyntax === 'light') {
primary = '#383A42';
secondary = '#383A42';
} else {
primary = '#FAFAFA';
secondary = '#FAFAFA';
}

}

const syntax = {
dark: {
borderColor: primary,
cursorColor: primary,
foregroundColor: secondary,
backgroundColor: '#383A42',
colors: {
black: primary,
red: secondary,
green: secondary,
yellow: secondary,
blue: secondary,
magenta: secondary,
cyan: secondary,
white: secondary,
lightBlack: primary,
lightRed: secondary,
lightGreen: secondary,
lightYellow: secondary,
lightBlue: secondary,
lightMagenta: secondary,
lightCyan: secondary,
colorCubes: primary,
grayscale: primary
}
},

light: {
borderColor: primary,
cursorColor: primary,
foregroundColor: secondary,
backgroundColor: '#FAFAFA',
colors: {
black: primary,
red: secondary,
green: secondary,
yellow: secondary,
blue: secondary,
magenta: secondary,
cyan: secondary,
white: secondary,
lightBlack: primary,
lightRed: secondary,
lightGreen: secondary,
lightYellow: secondary,
lightBlue: secondary,
lightMagenta: secondary,
lightCyan: secondary,
colorCubes: primary,
grayscale: primary
}
}
};

var assemblePath = path + config.pokemon + extension;

if (process.platform === 'win32') {
var pathToTheme = assemblePath.replace(/\\/g, "/");
} else {
var pathToTheme = assemblePath;
}

return Object.assign({}, config,
(config.pokemonSyntax === 'light') ?
syntax.light :
syntax.dark, {
termCSS: `
${config.termCSS || ''}
::selection {
background: ${primary} !important;
}
x-screen {
background: transparent !important;
}
`,
css: `
${config.css || ''}
.terms_terms {
background: url(${pathToTheme}) center;
background-size: cover;
}
.header_header, .header_windowHeader {
background-color: ${primary} !important;
}
.tabs_nav .tabs_list {
border-bottom: 0;
}
.tabs_nav .tabs_title,
.tabs_nav .tabs_list .tab_tab {
color: ${secondary};
border: 0;
}
.tabs_nav .tabs_list .tab_tab:not(.tab_active) {
background-color: rgba(0,0,0,0.1);
}
.tabs_nav .tabs_list .tab_tab:not(.tab_active):hover {
color: ${primary};
}
.tabs_nav .tabs_list .tab_active .tab_text {
border-bottom: 3px solid ${secondary};
}
.terms_terms .terms_termGroup .splitpane_panes .splitpane_divider {
background-color: ${secondary} !important;
}
`
}
);
};

0 comments on commit 1dee958

Please sign in to comment.